Home Assistant custom integration for e-distribución

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
Nordpool_diff custom integration for Home Assistant

nordpool_diff custom integration for Home Assistant Requires https://github.com/custom-components/nordpool Applies non-causal FIR differentiator1 to N

Joonas Pulakka 45 Dec 23, 2022
Smart EQ connect - Custom Integration for Home Assistant

Smart EQ Connect platform as a Custom Component for Home Assistant.

Rene Nulsch 2 Jan 4, 2022
Universal Xiaomi MIoT integration for Home Assistant

Xiaomi MIoT Raw 简体中文 | English MIoT 协议是小米智能家居从 2018 年起推行的智能设备通信协议规范,此后凡是可接入米家的设备均通过此协议进行通信。此插件按照 MIoT 协议规范与设备通信,实现对设备的状态读取及控制。

null 1.9k Jan 2, 2023
Home Assistant integration for energy consumption data from UK SMETS (Smart) meters using the Hildebrand Glow API.

Hildebrand Glow (DCC) Integration Home Assistant integration for energy consumption data from UK SMETS (Smart) meters using the Hildebrand Glow API. T

Aniket 153 Dec 30, 2022
Electrolux Pure i9 robot vacuum integration for Home Assistant.

Home Assistant Pure i9 This repository integrates your Electrolux Pure i9 robot vacuum with the smart home platform Home Assistant. The integration co

Niklas Ekman 15 Dec 22, 2022
Water quality integration for Home Assistant with data provided by Budapest FVM

Water Quality FVM (Budapest, HU) custom integration for Home Assistant This custom component integrates water quality information provided by Budapest

Atticus Maximus 3 Dec 23, 2021
A Home Assistant integration for Solaredge inverters

A Home Assistant integration for Solaredge inverters. Supports multiple inverters chained through RS485.

Seth 50 Dec 23, 2022
OPNsense integration with Home Assistant

hass-opnsense Join OPNsense with home-assistant! hass-opnsense uses the built-in xmlrpc service of OPNsense for all interactions. This project is curr

Travis Glenn Hansen 54 Jan 3, 2023
Component for deep integration LedFx from Home Assistant.

LedFX for Home Assistant Component for deep integration LedFx from Home Assistant. Table of Contents FAQ Install Config Performance FAQ Q. What versio

Dmitry Mamontov 28 Dec 13, 2022
Aqara Camera G3 integration for Home Assistant

Aqara Camera G3 integration for Home Assistant ATTENTION: The component only works after enabled telnet. Only supportd stream. Not support still image

null 14 Dec 18, 2022
Sleep As Android integration for Home Assistant

Sleep As Android custom integration This integration will allow you to get events from your SleepAsAndroid application in a form of the sensor states

Igor 84 Dec 30, 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 6, 2023
Ha-rpi gpio - Home Assistant Raspberry Pi GPIO Integration

Home Assistant Raspberry Pi GPIO custom integration This is a spin-off from the

Shay Levy 98 Dec 24, 2022
Custom component for Home Assistant that integrates Candy/Haier Wi-Fi washing machines (also known as Simply-Fi).

Candy Home Assistant component Custom component for Home Assistant that integrates Candy/Haier Wi-Fi washing machines (also known as Simply-Fi). This

Olivér Falvai 61 Dec 29, 2022
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

null 21 Dec 18, 2022
Windhager myComfort custom component for Home Assistant

Windhager myComfort custom component for Home Assistant

null 5 Apr 27, 2022
Home Assistant custom components MPK-Lodz

MPK Łódź sensor This sensor uses unofficial API provided by MPK Łódź. Configuration options Key Type Required Default Description name string False MP

Piotr Machowski 3 Nov 1, 2022
Custom component for MPC-HC for home-assistant

mpc_hc The current mpchc integration in homeassistant violates ADR0004, so it will be deleted from core. This is just the existing integration copied

null 3 Dec 15, 2022
A lightweight script for updating custom components for Home Assistant

Updater for Home Assistant This is a lightweight script for updating custom components for Home Assistant. If for some reason you do not want to use H

Alex X 12 Sep 21, 2022