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
A LiteX project which builds a SoC with DRAM / HDIM output via the GPDI SYZYGY addon.

ButterStick GPDI LiteX demo A LiteX project which builds a SoC with DRAM / HDIM output via the GPDI SYZYGY addon. Getting started Connect GPDI board t

4 Nov 21, 2021
a library for using WS2812b leds (aka neopixels) with Raspberry Pi Pico

pico_ws2812b a library for using WS2812b leds (aka neopixels) with Raspberry Pi Pico You'll first need to save the ws2812b.py file to your device (for

76 Nov 25, 2022
Example code to sending USB Gadget multimedia keys via Python

Send Multimedia USB HID Keys via Python As an USB Gadget in Linux This gives a simple script with zero dependencies that can easily run on any Linux d

DevOps Nirvana 2 Jan 02, 2023
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
Designed a system that can efficiently sort recyclables and transfer them to corresponding bins using Python, a Raspberry Pi, and Quanser Labs.

System for Sorting and Recycling Containers - Project 3 Table of contents Overview The challenge Screenshot My process Built with Code snippets What I

Mit Patel 2 Dec 02, 2022
Parametric open source reconstructions of Voron printed parts

The Parametric Voron This repository contains Fusion 360 reconstructions of various printed parts from the Voron printers

Matthew Lloyd 26 Dec 19, 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
Create (templateable) cameras that display qr codes in homeassistant

QRCam This custom component creates cameras displaying qrcodes. The QRCodes can be static or generated from templates. If you use a template as conten

Jannes Müller 5 Oct 06, 2022
What if home automation was homoiconic? Just transformations of data? No more YAML!

radiale what if home-automation was also homoiconic? The upper or proximal row contains three bones, to which Gegenbaur has applied the terms radiale,

Felix Barbalet 21 Mar 26, 2022
Make your MacOS keyboard brightness fade in and out

Make your MacOS keyboard brightness fade in and out. (It's working depends on the Kbrightness file, which only works for 2015 Macs, so this will only work on 2015 Macs.)

1 Dec 16, 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
Testing out some (stolen) DMA code for RP2040 Micropython

RP2040_micropython_dma testing out some (stolen) DMA code for RP2040 Micropython. Heavy inspiration and some code from https://iosoft.blog/2021/10/26/

2 Dec 29, 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
Baseline model for Augmented Home Assistant

Dataset Preparation Step 1. Rename the Virtual-Home output directory to 'vh.[name]', for example: 'vh.door' Make sure the directory contains 100+ fram

Stanford HCI 1 Aug 24, 2022
A Simple Python KeyLogger App

✨ Kurulum Uygulamayı bilgisayarınızda kullana bilmek için bazı işlemler yapmanız gerekiyor. Aşağıdaki yönlendirmeleri takip ederek bunu yapabilirsiniz

VorteX 7 Jun 11, 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 01, 2022
a fork of the OnionShare software better optimized for lower spec lightweight machines and ARM processors

OnionShare-Optimized A fork of the OnionShare software better optimized for lower spec lightweight machines and ARM processors such as Raspberry Pi or

ALTPORT 4 Aug 05, 2021
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
Home assiatant Custom component: Camera Archiver

Camera archiver Archive your ftp camera meadia files on other ftp with files renaming and event creation. Event can be used for send information to el

1 Jan 06, 2022
Volkswagen ID component for Home Assistant

Volkswagen ID component for Home Assistant This folder contains both a generic Python 3 library for the Volkswagen ID API and a component for Home Ass

55 Jan 07, 2023