Home Assistant custom integration for e-distribución

Related tags

Hardwareedistribucion
Overview

edistribucion

e-Distribución is an energy distribution company that covers most of South Spain area. If you live in this area, you probably are able to register into their website to get some information about your power demand, energy consumption, or even cycle billing (in terms of consumptions).

Although their application is great, this integration enables you to add a sensor to Home Assistant and getting updated automatically. However, it has some limitations yet, and no front-end support is being provided at the moment.

How to install

  1. Install HACS
  2. Add this repo (https://github.com/uvejota/edistribucion) to the custom repositories in HACS
  3. Install the integration. Please consider that alpha/beta versions are untested, and they might cause bans due to excesive polling.
  4. Add this basic configuration at Home Assistant configuration files (e.g., configuration.yml)
sensor:
  - platform: edistribucion
    username: !secret eds_user # this key may exist in secrets.yaml!
    password: !secret eds_password # this key may exist in secrets.yaml!

At this point, you got an unique default sensor for the integration, namely sensor.edistribucion, linked to those credentials in the e-Distribución platform. This default sensor assumes the first CUPS that appears in the fetched list of CUPS, which frequently is the most recent contract, so this configuration may be valid for most users. If you need a more detailed configuration, please check the section below "What about customisation?".

What about customisation?

This integration allows you to define some "extra" parameters in order to customise your installation. Check the following complete configuration, with annotations:

sensor:
  - platform: edistribucion
    username: !secret eds_user # this key may exist in secrets.yaml!
    password: !secret eds_password # this key may exist in secrets.yaml!
    cups: !secret eds_cups # optional, set your CUPS name. If you fail, it will select the first CUPS like by default
    short_interval: 3 # optional, number of minutes between meter updates (those that contain immediate lectures from your counter)
    long_interval: 60 # optional, number of minutes between cycle updates (those that contain immediate lectures from your counter)
    explode_sensors: # optional, to define extra sensors (separated from sensor.edistribucion) with the names and content specified below
      - cont # total counter energy in kWh
      - power_load # power load in %
      - power_limit # power limit in kWh
      - power # immediate power in kWh
      - energy_today # energy estimation for today in kWh (it requires to start a new day before reporting data)
      - energy_yesterday # energy estimation for yesterday in kWh (it may require a few hours to reflect the accumulated energy)
      - cycle_current # energy estimation for current billing cycle in kWh (it may require a few hours to reflect the accumulated energy)
      - cycle_last # energy estimation for the last billing cycle in kWh (it may require a few hours to reflect the accumulated energy)
      - power_peak # highest power peak in kW during the last 12 months
      - power_peak_mean # mean of monthly power peaks in kW during the last 12 months
      - power_peak_tile90 # percentile 90 of monthly power peaks in kW during the last 12 months

What if this configuration is not enough for you, and you have a great idea to save energy?

Ask for it at https://github.com/uvejota/edistribucion/issues!

Visualisation

Although we are not providing any custom front-end at the moment, you can use the following code to define some basic cards:

type: vertical-stack
title: Consumo eléctrico
cards:
  - type: sensor
    entity: sensor.edistribucion
    graph: line
    name: Potencia instantánea
    detail: 2
  - type: markdown
    content: >-
      **==================== Suministro ====================**
      **Contador:** {{ state_attr("sensor.edistribucion", "Contador") }} 
      **ICP:** {{ state_attr("sensor.edistribucion", "ICP") }}
      **==================== Consumo =====================**
      **Hoy:** {{ state_attr("sensor.edistribucion", "Energía hoy") }}
      **Ayer:** {{ state_attr("sensor.edistribucion", "Energía ayer") }} ({{ state_attr("sensor.edistribucion", "Detalle ayer") }})
      **Ciclo actual:** {{ state_attr("sensor.edistribucion", "Ciclo actual") }}
      **Ciclo anterior:** {{ state_attr("sensor.edistribucion", "Ciclo anterior") }}
      **==================== Potencia ======================**
      **Potencia:** {{ state_attr("sensor.edistribucion", "Potencia") }} 
      **Carga:** {{ state_attr("sensor.edistribucion", "Carga actual") }}
      **Potencia máx.:** {{ state_attr("sensor.edistribucion", "P. Pico") }} 
      **Potencia máx. (media):** {{ state_attr("sensor.edistribucion", "P. Pico (media)") }}
      **Potencia máx. (percentil 90):** {{  state_attr("sensor.edistribucion", "P. Pico (perc. 90)")  }}
      **==================================================**
    title: Informe

image

Credits

This repository is maintained by @uvejota and @jcortizronda for free, as a personal learning project. It was inspired by @jagalindo work (https://github.com/jagalindo/edistribucion), also maintaining some API-related code from @trocotronic repository (https://github.com/trocotronic/edistribucion).

Comments
  • Fields without information

    Fields without information

    Screenshot_2021-07-13-18-22-47-614_io homeassistant companion android

    I see some fields without information.

    Checking the logs, I only see this warning

    
    Este error se originó a partir de una integración personalizada.
    
    Logger: custom_components.edistribucion.eds.EdsHelper
    Source: custom_components/edistribucion/eds/EdsHelper.py:211
    Integration: edistribucion (documentation, issues)
    First occurred: 12 de julio de 2021 20:28:36 (22 occurrences)
    Last logged: 17:49:55
    
    list index out of range
    
    bug 
    opened by nosoyunnanorobot 20
  • No instant power data

    No instant power data

    Hola, I've followed all the steps and have it working but I have no data on some points, see the screenshot, I've tried to reinstall it, reboot HA several times, but only those attributes are not getting data, any idea?

    image

    bug 
    opened by danfigi 10
  • Access file not found error

    Access file not found error

    I'm having some issues configuring this integration.

    My sensors.yaml file is filled with the config specified, like this:

    ############# Edistribucion
    - platform: edistribucion
      username: !secret edistribucion_user
      password: !secret edistribucion_password
    

    After everything setup and once I reboot I get the following error on logs:

    Logger: root
    Source: custom_components/edistribucion/api/EdistribucionAPI.py:81
    Integration: edistribucion (documentation, issues)
    First occurred: 12:30:24 PM (1 occurrences)
    Last logged: 12:30:24 PM
    
    Access file not found
    
    

    And this error as well:

    This error originated from a custom integration.
    
    Logger: root
    Source: custom_components/edistribucion/api/EdistribucionAPI.py:72
    Integration: edistribucion (documentation, issues)
    First occurred: 12:30:24 PM (1 occurrences)
    Last logged: 12:30:24 PM
    
    Session file not found
    
    

    Might be some error while trying to create both files (permissions issues on folder?) or some error login (not able to retrieve session cookie, so not creating the files).

    Any thought?

    opened by msanchezt 7
  • Option to define SCAN_INTERVAL

    Option to define SCAN_INTERVAL

    Would be nice being able to define SCAN_INTERVAL.

    I've currently modified it to SCAN_INTERVAL=1 minute, so I'm able to get more real time info and trigger some almost real time alerts when my Carga actual % goes over 100% for example (I have the 15 minutes delay where I'm allowed to be over 100%).

    Not sure how to add this option for the end user, though.

    enhancement 
    opened by msanchezt 7
  • Problem with historical data

    Problem with historical data

    I have problems with historical data: HD

    I suspect that the problem is due to the fact that I have the same CUPS in two periods. This is due to a rate change.

    CUPS

    A few days ago I opened another incident for the same issue, and after some changes, other users were fixed. It's not my case. You are on version 1.1.2

    Thanks.

    bug 
    opened by nosoyunnanorobot 5
  • Showing State...?

    Showing State...?

    Hi again, another interesting thing, could be a sensor, showing if addon is connected to edistribucion, and if it`s working. In my case, since yesterday isn't working, for some problems of edistribucion, and it could be nice, to check some way...

    Thanks :)

    enhancement 
    opened by silversegarra 5
  • Sensor for ufd

    Sensor for ufd

    Hello and thank you for your great work.

    Unfortunately, I live in Madrid where instead edistribucion I use ufd. Could it be possible to make the integration more "generic" so we can use it with other companies (ufd as I mentioned)?

    I can help with whatever you need. Please let me know. I can access the platform without any issues.

    Thank you in advance

    enhancement 
    opened by eherranzr 5
  • Sensor energy_yesterday_detail

    Sensor energy_yesterday_detail

    Hello, first of all thanks for your great work. I would like to be able to have the energy_yesterday_detail sensor but it gives me an error, the idea was to make a counter so that it would add up so much peak, valley etc. I have tried but it has always given me an error. All the best

    enhancement in progress 
    opened by JJoaquinrl 4
  • EDSConnector.get_meter() API endpoint seems to be no longer working

    EDSConnector.get_meter() API endpoint seems to be no longer working

    ¡Hola! Antes que nada, quiero agradecerte por este componente. Me parece súper útil.

    Ayer instalé este componente en reemplazo del de @jagalindo, pero desde entonces las métricas del ICP han dejado de funcionar.

    Escarbando un poco en el código, y comparando con el comportamiento desde mi navegador, he notado que el endpoint para obtener las métricas es diferente:

    • Actualmente: other.WP_ContadorICP_CTRL.consultarContador=1
    • En mi navegador: other.WP_ContadorICP_F2_CTRL.consultarContador=1

    He hecho el cambio "a fuego" en mi instalación, y ahora tengo métricas. 🎉

    ¿Quieres que te haga un PR con el cambio? No soy ni remótamente experto en Python, pero creo que añadir unos caracteres a un string está dentro de mis capacidades. 😛

    opened by poveden 3
  • Consumo electrico unknow muestra mi contador pero no el consumo: no state history found

    Consumo electrico unknow muestra mi contador pero no el consumo: no state history found

    hola configure la integración sin problema, primero el sensor y no dio error, luego configuré la tarjeta con el código de la plantilla de su README.md de su web y me muestra los datos de mi contador pero en la parte superior donde debería mostrarme el consumo me dice: unknow y muestra el mensaje: no state history found, ¿ alguien podría ayudarme? entiendo que la configuración es correcta porque muestra mis datos y mi contador, pero no el Consumo eléctrico que debería mostrar en la parte superior. un saludo y gracias de antemano.

    opened by yusepe42 2
  • Error

    Error "US6-RecICPTimeOUT"

    I'm getting this error when running this from both Home Assistant and manually executing the test_eds script:

    Error processing command: {"redirect":false,"message":"En estos momentos no podemos conectar con tu contador. Por favor, prueba más tarde.","labelParam":[""],"label":"","isWPException":true,"isLabel":true,"code":"US6-RecICPTimeOUT"}

    • On the response I see that "Potencia demanadada" has no value (maybe because of the error?)
    • I see 2 "Contador (kWh)" variables, both are "-", why 2? And any idea why no value?
    • CUPS: ES00XXXXXXXXXXXMD0F
    • Contador (kWh): -
    • Contador (kWh): -
    • Estado ICP: -
    • Carga actual (%): -
    • Potencia contratada (kW): 4.8
    • Potencia demandada (kW): -
    • Hoy (kWh): 0 (P1: 0 | P2: 0 | P3: 0)
    • Ayer (kWh): 12.43 (P1: 1.89 | P2: 1.18 | P3: 9.36)
    • Ciclo anterior (kWh): 244.064 en 28 días (8.72 kWh/día)
    • Ciclo actual (kWh): 377.806 en 41 días (9.21 kWh/día)
    • Potencia máxima (kW): 4.3 el 26/07/2020
    • Potencia media (kW): 3.2
    • Potencia percentil (99 | 95 | 90) (kW): 4.25 | 4.04 | 3.79
    opened by msanchezt 2
  • No recibo información especifica del contador

    No recibo información especifica del contador

    Hola. Primero de todo gracias por esta fabulosa integración. Todo bien hasta la última actualización, primero tuve problemas con la actualización, al reiniciar mi HA volvía a tener la misma versión anterior. Esto al final se solucionó. Pero lo que no he podido resolver es que no recibo información del contador, IPC y carga actual. Que he de modificar? miré la documentación pero la verdad no he visto como solucionarlo. Gracias por todo!!!

    opened by danieltidona 2
  • Integración panel energy home assistant, last_reset

    Integración panel energy home assistant, last_reset

    Para que la integración con el nuevo panel de energía funcione sería necesario añadir el atributo last_reset a cada sensor, de forma que home assistant reconozca desde que fecha es válido el valor leido. Sino no es posible añadir estos sensores al panel de energia. Gracias! (https://www.home-assistant.io/more-info/statistics/)

    opened by yevon 1
  • Configure the sensors to track statistics

    Configure the sensors to track statistics

    With the new Energy control panel I would like to use the consumed energy as with the edistribution integration. The HA help pages suggest to follow this long term statistics config: https://developers.home-assistant.io/docs/core/entity/sensor#long-term-statistics.

    THANKS!

    opened by amaia81 0
Releases(v1.1.4)
Owner
VMG
PhD in Telecommunications Engineering
VMG
Turn your Raspberry Pi Pico into a USB Rubber Ducky

pico-ducky Turn your Raspberry Pi Pico into a USB Rubber Ducky Install Requirements CircuitPython for the Raspberry Pi Pico adafruit-circuitpython-bun

Konstantinos 5 Nov 08, 2022
Better support for Nuki devices to the Home Assistant

Another attempt to add a better support for Nuki devices to the Home Assistant Features: Lock interface implementation Uses local webhook from bridge

Konstantin 105 Jan 07, 2023
🐱🖨Cat printer is a portable thermal printer sold on AliExpress for around $20.

Cat printer is a portable thermal printer sold on AliExpress for around $20. This repository contains Python code for talking to the cat printer over

671 Jan 05, 2023
CPU benchmark by calculating Pi, powered by Python3

cpu-benchmark Info: CPU benchmark by calculating Pi, powered by Python 3. Algorithm The program calculates pi with an accuracy of 10,000 decimal place

Alex Dedyura 20 Jan 03, 2023
A ch341dll Wrap is for using in Python 32bits windows to access I2C SPI and MDIO (by GPIO), and Demo with display PC sreen on OLED by i2c or SPI .

ch341dll_wrap_typcal_app A ch341dll Wrap is for using in Python 32bits windows to access I2C SPI and MDIO (by GPIO). In addition, I provided 3 Demo. I

13 Jan 02, 2023
A blender 2.9x addon for managing camera settings

TMG-Camera-Tools A blender 2.9x addon for managing camera settings Tutorial showcasing current features

Mainman002 12 Apr 16, 2022
This is a python script to grab data from Zyxel NSA310 NAS and display in Home Asisstant as sensors.

Home-Assistant Python Scripts Python Scripts for Home-Assistant (http://www.home-assistant.io) Zyxel-NSA310-Home-Assistant Monitoring This is a python

6 Oct 31, 2022
Various programs in Atari BASIC for #FujiNet for Atari 8-bit

FujiNet Various programs in Atari BASIC for #FujiNet for Atari 8-bit FujiNet-3D Tic Tac Toe In 1978, Scott Adams wrote a 3-D Tic Tac Toe game, for pla

Kay Savetz 2 Jan 01, 2022
Uses the Duke Energy Gateway to import near real time energy usage into Home Assistant

Duke Energy Gateway This is a custom integration for Home Assistant. It pulls near-real-time energy usage from Duke Energy via the Duke Energy Gateway

Michael Meli 28 Dec 23, 2022
Ingeniamotion is a library that works over ingenialink and aims to simplify the interaction with Ingenia's drives.

Ingeniamotion Ingeniamotion is a library that works over ingenialink and aims to simplify the interaction with Ingenia's drives. Requirements Python 3

Ingenia Motion Control 7 Dec 15, 2022
An IoT Trivia app that shows you how to take a JSON web API such as the opentdb.com API and stream and display it on a FeatherS2 in an OLED display.

CircuitPython IoT Trivia ESP32-S2 OLED Version An IoT Trivia app that shows you how to take a JSON web API such as the opentdb.com API and stream and

Kevin Thomas 1 Nov 27, 2021
SALUS THERMOSTAT Custom component for Home-Assistant

Home-Assistant Custom Components Custom Components for Home-Assistant (http://www.home-assistant.io) Salus Thermostat Climate Component My device is R

21 Dec 18, 2022
Skykettle ha - Redmond SkyKettle integration for Home Assistant

Redmond SkyKettle integration for Home Assistant This integration allows to cont

Alexey 'Cluster' Avdyukhin 48 Jan 06, 2023
FHEM Connector for FHT Heating devices

home-assistant-fht from: https://github.com/Rsclub22 FHEM Connector for FHT Heating devices (connected via FHEM) Requires FHEM to work You can find FH

5 Dec 01, 2022
PBA: Pleco Breeding Assistant

A small monitor that reports the external, fishroom and water change parameters to have suitable water parameters and induce breeding. These two features already represent 50% of the "reproductive su

Mirko Mancin 1 Jan 19, 2022
Python script for printing to the Hanshow price-tag

This repository contains Python code for talking to the ATC_TLSR_Paper open-source firmware for the Hanshow e-paper pricetag. Installation # Clone the

12 Oct 06, 2022
2D waypoints will be predefined in ROS based robots to navigate to the destination avoiding obstacles.

A number of 2D waypoints will be predefined in ROS based robots to navigate to the destination avoiding obstacles.

Arghya Chatterjee 5 Nov 05, 2022
HACS gives you a powerful UI to handle downloads of all your custom needs.

HACS (Home Assistant Community Store) Manage (Install, track, upgrade) and discover custom elements for Home Assistant directly from the UI. What? HAC

HACS 3.2k Jan 04, 2023
Lego Mindstorms EV3 and Lego Spike Prime

Lego Mindstorms EV3 and Lego Spike Prime What is FLL? The FIRST LEGO League Challenge Robotics Tournament challenges students from 9 to 16 years old t

Danimar Campos da Costa 1 Nov 14, 2021
Ansible tools for operating and managing fleets of Blinksticks in harmony using the Blinkstick Python library.

Ansible tools for operating and managing fleets of Blinksticks in harmony using the Blinkstick Python library.

Greg Robinson 3 Aug 10, 2022