GithubHelp home page GithubHelp logo

jagalindo / edistribucion Goto Github PK

View Code? Open in Web Editor NEW

This project forked from trocotronic/edistribucion

37.0 37.0 12.0 45 KB

API para e-distribución (Endesa distribución)

License: GNU General Public License v3.0

Python 100.00%

edistribucion's Introduction

Hi there 👋

💬 About me!

José Ángel has developed his professional activity working in the United States, France, and Spain. His research areas are software product lines and product configuration. He began his undergraduate studies at the University of Seville by taking a diploma in Computer Engineering. Later, he continued his career in the studies of Bachelor's Degree in Computer Engineering and Master's Degree in Software Engineering and Technology. His first research work was focused on the development of variability management tools such as FaMa and BeTTy, which are widely used both in academia and industry in the context of product lines.

His PhD thesis explores the use of automatic analysis of models in high variability systems. He obtained a doctoral degree from the University of Seville and the University of Rennes 1 in March 2015 through a co-tutorship program. He has developed his postdoctoral research activity in the Diverse research group at the INRIA research center. José Ángel combined research activities in other areas such as the development of techniques for big data analysis or the management of variability in highly configurable systems. Currently, he works as a Lecturer at the University of Seville.

Loving code to research and teach!

edistribucion's People

Contributors

bvis avatar flosoft avatar jagalindo avatar rsciriano avatar trocotronic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

edistribucion's Issues

Ayuda con i-DE

Buenos días,

Perdonad que cree un Issue para esto, pero ando buscando ayuda para hacer algo similar a esto pero para i-DE.

Sabéis si es más o menos sencillo adaptar el código de Endesa para usarlo con i-DE (Iberdrola) y luego tener los datos en Home Assistant?

Muchas gracias

Bloqueos Distribuidora

Al parecer edistribucion ha restringido el numero de llamadas a la API y está bloqueando el servicio.

Por defecto., ¿Cuántas llamadas diarias se realizan? ¿cada cuanto tiempo?

Les acabo de poner email para que desbloqueen mi usuario y de paso que me digan el maximo de operaciones diarias y de esta forma podemos ajustar nuestro script (ya os comento cuando me responda edistribucion)

Gracias.

Error en la carga del sensor Contador

Este error se originó a partir de una integración personalizada.

Logger: custom_components.edistribucion.sensor
Source: custom_components/edistribucion/sensor.py:91
Integration: EDistribucion Sensor (documentation, issues)
First occurred: 1:52:20 (3 occurrences)
Last logged: 2:32:52

Fail to setup Contador e-distribución
Traceback (most recent call last):
File "/config/custom_components/edistribucion/sensor.py", line 91, in getAttrData
attributes['Estado ICP'] = meter['data']['estadoICP']
TypeError: 'NoneType' object is not subscriptable
#########################
Me da este error al cargar home assistant. Si entro por web al contador funciona bien, incluso diría que mejor que antes, más rápido y falla menos. Pienso que han hecho algun cambio o algún tipo de baneo a la integración.
Utilizo esta versión
https://github.com/jjprz/edistribucion
tuneada un poco. El sensor Prevision de facturación es un desastre ahora mismo porque en Edistribucion no están los últimos periodos de facturación, si estuvieran sería otra cosa seguramente.
El sensor Potencia Máxima es menos interesante para mi.
Lo que funciona muy bien es el sensor Consumo no facturado, es perfecto en cuanto facturan se reinicia y se actualiza dos veces al dia, una pasadas las 00 y la otra varía pero antes de la tarde ya está actualizado hasta las 23:59 del dia anterior.
Como decía he tuneado un poco el sensor Consumono facturado:
Screenshot_20210808-024037_Home Assistant
Pero algunos datos tengo que cambiar editando cada mes porque son variables y yo no tengo conocimientos para poder importar desde un input_number o algo así para poder cambiar la potencia contratada, precio medio de cada periodo y lo que marca el contador en cada periodo. En este sensor si sería interesante importar el esiosApi.
Screenshot_20210808-030639_Home Assistant

Es todo, ojalá os sirva este comentario para mejorar y corregir.
Perdon por el tocho y gracias por vuestro trabajo.

no me aparece sensor.edistribucion

He instalado con HACS (y tb he probado de forma manual)
Añadido a configuration.yaml la info del sensor, validado y reiniciado...

pero no me aparece el sensor.edistribucion

q puedo estar haciendo mal?

Personalizar "scan_interval"

Hola,
¿seria posible personalizar el "scan_interval"?

Por defecto, creo que viene establecido en 10m y tu puedes cambiarlo para que actualice cada x segundos.

Lo ideal seria poder establecer programaciones más personalizadas como por ej, que no escanee de tal hora a tal hora (madrugadas donde no hay consumo por ej)

Creo que de esta forma evitaríamos llamadas a la api y tardarían más en banearnos

¿Cómo lo veis? ¿es viable?

Gracias por todo.

No updates since last week

After running successfully for some time, now I'm not receiving updates anymore 😭

I have found this errors in the logs:

Logger: homeassistant.helpers.entity
Source: custom_components/edistribucion/backend/EdistribucionAPI.py:192
First occurred: 1 February 2021, 21:09:31 (24 occurrences)
Last logged: 2 February 2021, 20:59:05

Update for sensor.eds_power_consumption fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 482, in async_device_update
    await task
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/edistribucion/sensor.py", line 51, in update
    meter = edis.get_meter(cups)
  File "/config/custom_components/edistribucion/backend/EdistribucionAPI.py", line 247, in get_meter
    r = self.__command('other.WP_ContadorICP_CTRL.consultarContador=1', post=data)
  File "/config/custom_components/edistribucion/backend/EdistribucionAPI.py", line 134, in __command
    self.__force_login()
  File "/config/custom_components/edistribucion/backend/EdistribucionAPI.py", line 192, in __force_login
    raise EdisError('Unexpected error in loginForm. Cannot continue')
custom_components.edistribucion.backend.EdistribucionAPI.EdisError: Unexpected error in loginForm. Cannot continue

and

Logger: homeassistant.helpers.entity
Source: custom_components/edistribucion/backend/EdistribucionAPI.py:192
First occurred: 1 February 2021, 21:09:31 (24 occurrences)
Last logged: 2 February 2021, 20:59:05

Update for sensor.eds_power_consumption fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 482, in async_device_update
    await task
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/edistribucion/sensor.py", line 51, in update
    meter = edis.get_meter(cups)
  File "/config/custom_components/edistribucion/backend/EdistribucionAPI.py", line 247, in get_meter
    r = self.__command('other.WP_ContadorICP_CTRL.consultarContador=1', post=data)
  File "/config/custom_components/edistribucion/backend/EdistribucionAPI.py", line 134, in __command
    self.__force_login()
  File "/config/custom_components/edistribucion/backend/EdistribucionAPI.py", line 192, in __force_login
    raise EdisError('Unexpected error in loginForm. Cannot continue')
custom_components.edistribucion.backend.EdistribucionAPI.EdisError: Unexpected error in loginForm. Cannot continue

y por cierto, mucha gracias por el trabajo ;) 🍺

Error al gestionar error en get_meter

Parece que hay un error en la generación de la excepción durante el get_meter:

2021-06-04 13:33:02 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.eds_power_consumption fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 350, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 566, in async_device_update
await task
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/edistribucion/sensor.py", line 51, in update
meter = edis.get_meter(cups)
File "/config/custom_components/edistribucion/backend/EdistribucionAPI.py", line 280, in get_meter
r = self.__command('other.WP_ContadorICP_CTRL.consultarContador=1', post=data)
File "/config/custom_components/edistribucion/backend/EdistribucionAPI.py", line 163, in __command
self.__command(command=command, post=post, dashboard=dashboard, accept=accept, content_type=content_type, recursive=True)
File "/config/custom_components/edistribucion/backend/EdistribucionAPI.py", line 166, in __command
raise EdisError('Error processing command: {} ({})'.format(jr['actions'][0]['error'][0]['message'],jr['actions'][0]['error'][0]['exceptionType']))
KeyError: 'exceptionType'

Añadir decimales

Hola!

Antes de nada muchas gracias por el trabajo, la integración está quedando genial.
He conseguido crear el sensor para el panel de energía y, salvo alguna hora que se pierde al contabilizar (supongo que problemas con la API de e-distribución), funciona muy bien.

Mi duda es si se puede añadir 2 decimales al template sensor "eds_meter_reading", para que en la gráfica aparezca más en detalle y no 2kw, 1kw...

Podéis verlo en la imagen adjunta.

Gracias de nuevo!

Screenshot (72)

No credentials provided

Hola.

He probado a añadir en custom_components los archivos del repositorio.

y luego en el configuration.yaml

sensor:
  - platform: edistribucion
    username: mi_usuario
    password: contraseña

pero en los logs indica lo siguiente:
2021-06-02 12:52:18 DEBUG (MainThread) [custom_components.edistribucion] No credentials provided

Actualizaciones Intermitentes

Desde hace unos días se actualiza el sensor solo algunas veces, ya que se obtiene intermitentemente el siguiente error:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 350, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 566, in async_device_update await task File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/edistribucion/sensor.py", line 51, in update meter = edis.get_meter(cups) File "/config/custom_components/edistribucion/backend/EdistribucionAPI.py", line 280, in get_meter r = self.__command('other.WP_ContadorICP_CTRL.consultarContador=1', post=data) File "/config/custom_components/edistribucion/backend/EdistribucionAPI.py", line 163, in __command self.__command(command=command, post=post, dashboard=dashboard, accept=accept, content_type=content_type, recursive=True) File "/config/custom_components/edistribucion/backend/EdistribucionAPI.py", line 166, in __command raise EdisError('Error processing command: {} ({})'.format(jr['actions'][0]['error'][0]['message'],jr['actions'][0]['error'][0]['exceptionType'])) KeyError: 'exceptionType'

Compatibilidad con panel energia home assistant

Buenos días!

Acabo de instalar la integración, aunque de momento creo que no me está funcionando es normal? A parte de eso estaría bien que se integrase con el nuevo panel de energia de home assistsant.

Para ello sólo haria falta que el sensor incluyera estas dos propiedades:

state_class: measurement
last_reset (Fecha del último reinicio del contador del sensor)

Gracias!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.