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
This is a collection of python modules that interact with the Ryze Tello drone.

This is a collection of python modules that interact with the Ryze Tello drone.

DJI-SDK 1.2k Jan 03, 2023
Like htop (CPU and memory usage), but for your case LEDs. 😄

Like htop (CPU and memory usage), but for your case LEDs. 😄

Derek Anderson 3 Dec 08, 2021
Resmed_myair_sensors - This is a Home Assistant custom component to pull daily CPAP data from ResMed's myAir service using an undocumented API

resmed_myair This component will set up the following platforms. Platform Description sensor Show info from the myAir API. Installation Using the tool

Preston Tamkin 17 Dec 29, 2022
Python Wrapper for Homeassistant's REST API

HomeassistantAPI Python Wrapper for Homeassistant's REST API Please ⭐️ the repo if you find this project useful or cool! Here is a quick example. from

Nate 29 Dec 31, 2022
My self-hosting infrastructure, fully automated from empty disk to operating services

Khue's Homelab Current status: ALPHA This project utilizes Infrastructure as Code to automate provisioning, operating, and updating self-hosted servic

Khue Doan 6.4k Dec 31, 2022
Setup DevTerm to be a cool non-GUI device

DevTerm hobby project I bought this amazing device: DevTerm A-0604. It has a beefy ARM processor, runs a custom version of Armbian, embraces Open Sour

Alex Shteinikov 9 Nov 17, 2022
A Python program that makes it easy to manage modules on a CircuitPython device!

CircuitPython-Bundle-Manager-v2 A Python program that makes it easy to manage modules on a CircuitPython device! The CircuitPython Bundle Manager v2 i

Ckyiu 1 Dec 18, 2021
A DUCO (Duino-Coin) miner for GigaDevice ARM boards.

GD32 Duino-Coin Miner Description Contains the firmware and miner software for mining DUCO (Duino-Coin) on GigaDevice GD32 chips. Supported boards GD3

Maximilian Gerhardt 2 Feb 20, 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
Automatic Watering System using Soil Moisture Sensor and RTC Timer with Arduino

Automatic-Watering-System - Technical Answers to Real-World Problems. Evolution of Watering Manually to Watering Automatically.

Vaishnavi Pothugunta 4 Dec 31, 2021
A dashboard for Raspberry Pi to display environmental weather data, rain radar, weather forecast, etc. written in Python

Weather Clock for Raspberry PI This project is a dashboard for Raspberry Pi to display environmental weather data, rain radar, weather forecast, etc.

Markus Geiger 1 May 01, 2022
CircuitPython library for the CH559 USB to Serial chip

CH559 (USB to Serial) CircuitPython Library Why? Because you might want to get keyboard/mouse/gamepad/HID input into your CircuitPython projects witho

Guy Dupont 3 Nov 19, 2022
HA-Edge-Connector - HA Edge Connector For Python

HA-Edge-Connector 1. Required a. Smartthings Hub & Homeassistant must be in same

chals 21 Dec 29, 2022
Watson-Assistant with integration capabilities

Watson-Assistant-Integration Watson-Assistant with integration capabilities "main.py" should be deployed as Cloud Function (Action) on IBM Cloud. For

Sergey Usachev 1 Dec 20, 2021
A Python class for controlling the Pimoroni RGB Keypad for Raspberry Pi Pico

rgbkeypad A Python class for controlling the Pimoroni RGB Keypad for the Raspberry Pi Pico. Compatible with MicroPython and CircuitPython. keypad = RG

Martin O'Hanlon 43 Nov 11, 2022
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
E-Ink Magic Calendar that automatically syncs to Google Calendar and runs off a battery powered Raspberry Pi Zero

E-Ink Magic Calendar that automatically syncs to Google Calendar and runs off a battery powered Raspberry Pi Zero

2.8k Dec 30, 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
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
Mycodo is open source software for the Raspberry Pi that couples inputs and outputs in interesting ways to sense and manipulate the environment.

Mycodo Environmental Regulation System Latest version: 8.12.9 Mycodo is open source software for the Raspberry Pi that couples inputs and outputs in i

Kyle Gabriel 2.3k Dec 29, 2022