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
The goal of this project is for anyone with an old printer to be able to double-sided printing.

Welcome to PDF-double-side! Hi! I'm 15. I have a old printer so I can't print double-sided outs. The goal of this project is for anyone with an old pr

DejaVu 4 Dec 28, 2021
Intel Realsense t265 into Unreal Engine

t265_UE Intel Realsense t265 into Unreal Engine. Windows only, and Livelink plugin is 4.26.2 only at the moment. Might recompile it for different vers

Bjarke Aagaard 30 Jan 02, 2023
Windhager myComfort custom component for Home Assistant

Windhager myComfort custom component for Home Assistant

5 Apr 27, 2022
Quasi-static control of the centroid of quadruped robot

Quasi-static control of quadruped robot   This is a demo of the quasi-static controller for the centroid of the quadruped robot. The Quadratic Program

Junwen Cui 21 Dec 12, 2022
Home Assistant custom component to help ev-chargers stay below peak hourly energy levels.

Peaqev ev-charging Peaqev ev-charging is an attempt of charging an ev without breaching a preset monthly max-peak energy level. In order for this inte

Magnus Eldén 35 Dec 24, 2022
A simple non-official manager interface I'm using for my Raspberry Pis.

My Raspberry Pi Manager Overview I have two Raspberry Pi 4 Model B devices that I hooked up to my two TVs (one in my bedroom and the other in my new g

Christian Deacon 21 Jan 04, 2023
Classes and functions for animated text and graphics on an LED display

LEDarcade A collection of classes and functions for animated text and graphics on an Adafruit LED Matrix.

datagod 31 Jan 04, 2023
Technical Answers to Real-World Problems. Evolution of Watering Manually to Watering Automatically.

Automatic Watering System using Soil Moisture Sensor and RTC Timer with Arduino Technical Answers to Real-World Problems Know the plant, Grow the plan

NelakurthiSudheer 3 Jan 03, 2022
An open source two key macro-pad modeled to look like a cartoony melting popsicle

macropopsicle An open source two key macro-pad modeled to look like a cartoony melting popsicle. Build instructions Parts List -1x Top case half (3D p

17 Aug 18, 2022
Repo for the esp32s2 version of the Wi-Fi Nugget

Repo for the esp32s2 version of the Wi-Fi Nugget

HakCat 30 Nov 05, 2022
Brogrammer-keyboard - FIrmware for the Brogrammer Keyboard v1.0

Brogrammer Keyboard Firmware The package contains the firmware that runs on the Brogrammer Keyboard v1.0 See https://imgur.com/a/oY5QZ14 This keyboard

Devin Hartleben 1 Apr 21, 2022
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
A script and GUI for controlling stepper motors from an arduino

A script and GUI for controlling stepper motors from an arduino (nema 23 in my case but should work for others in general)

Pip 2 Aug 01, 2022
Vvim - Keyboardless Vim interactions

This is done via a hardware glove that the user wears. The glove detects the finger's positions and translates them into key presses. It's currently a work in progress.

Boyd Kane 8 Nov 17, 2022
Shotgrid Toolkit Engine for Gaffer

Shotgun toolkit engine for Gaffer Contact : Diego Garcia Huerta Overview Implementation of a shotgun engine for Gaffer. It supports the classic bootst

Diego Garcia Huerta 12 May 21, 2022
Segger Embedded Studio project for building & debugging Flipper Zero firmware.

Segger Embedded Studio project for Flipper Zero firmware Установка Добавить данный репозиторий в качестве сабмодуля в корень локальной копии репозитор

25 Dec 28, 2022
Philippe 1 Jan 09, 2022
My 500 LED xmas tree

xmastree2020 This repository contains the code used for Matt's Christmas tree, as featured in "I wired my tree with 500 LED lights and calculated thei

Stand-up Maths 581 Jan 07, 2023
A Python script to monitor the latest block on an LCD.

PiHole-Monitoring A Python script to monitor the latest block on a lcd display. The first number represents the dns queries from the last 24h, the sec

Maxi 4 Dec 05, 2022
Doughskript interpreter for converting simple command sequences into executable Arduino C++ code.

Doughskript interpreter for converting simple command sequences into executable Arduino C++ code.

Svjatoslav 2 Jan 11, 2022