pcourbin / ecodevices_rt2 Goto Github PK
View Code? Open in Web Editor NEWHome Assistant custom component for GCE Ecodevices RT2
License: Apache License 2.0
Home Assistant custom component for GCE Ecodevices RT2
License: Apache License 2.0
Support for HACS would be nice.
https://github.com/hacs/
Instant sensors are not listed in Home Assistant Energy electricity grid consumption.
This prevent to use the EcoDevice RT2 as a source.
There seems to have a requirement for that https://www.home-assistant.io/more-info/statistics/
Bonjour,
un autre point que je remarque et qui n'est pas très pratique, j'ai l'impression que les sensors sont considérés comme injoignable par HA tant que leur valeur est à 0.
Je m'explique j'ai un compteur d'eau à impulsion branché sur l'entrée 1 du RT2 que je récupère par la config suivante :
name: Eau_jour
type: "post"
id: 2
unit_of_measurement: "L"
state_class: "total_increasing"
icon: "mdi:water"
Et le sensor correspondant Eau_jour_indexday reste considéré comme injoignable si la valeur est à 0 (notamment de minuit jusqu'à au 1er litre qu'on tire le matin)
Cela peut laisser penser que l'intégration ne fonctionne plus, c'est perturbant.
Hello and thanks for your adaptation of this integration for Ecodevice RT2.
The new energy features of 2021.8 allow you to set different sources of energy.
Could you adapt you integration to manage it?
Some info :
https://www.home-assistant.io/more-info/statistics/
https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics
Merci!
I have a lot of bug since configuration of the relay of the RT2
Version of add-on : 2.2.3
Version HA : 2022.2.9
ecodevices_rt2:
- name: EcoRT2
host: "192.168.31.3"
port: 80 # Optional, default: 80
api_key: ########
update_after_switch: 0 # Optional, default: 0 (seconds)
scan_interval: 3
devices:
- name: Relais_EcoD
type: "api"
component: "switch"
api_get: "Get"
api_get_value: "R"
api_get_entry: "R1"
api_on_get: "SetR"
api_on_get_value: "1"
api_off_get: "ClearR"
api_off_get_value: "1"
Logger: custom_components.ecodevices_rt2.switches.switch_ecodevicesrt2
Source: custom_components/ecodevices_rt2/switches/switch_ecodevicesrt2.py:32
Integration: GCE Ecodevices RT2 ([documentation](https://github.com/pcourbin/ecodevices_rt2), [issues](https://github.com/pcourbin/ecodevices_rt2/issues))
First occurred: 28 février 2022, 15:44:55 (2 occurrences)
Last logged: 07:45:23
Device data no retrieve Relais_EcoD: Blocking calls must be done in the executor or a separate thread; Use `await hass.async_add_executor_job()` at custom_components/ecodevices_rt2/switches/switch_api.py, line 44: self.ecort2.get( (False)
2.2.1
(from HACS)
ecodevices_rt2:
- name: EcoRT2
host: "192.168.1.105"
port: 80 # Optional, default: 80
api_key: "Mypassword"
update_after_switch: 0.1 # Optional, default: 0 (seconds)
scan_interval: 30
devices:
- name: Index Linky
type: "api"
component: "sensor"
api_get: "Index"
api_get_value: "All"
api_get_entry: "Index_TI1"
device_class: "power"
unit_of_measurement: "Wh"
icon: "mdi:flash"
State of created entites are still "unavaible"
The direct access to the api with http://192.168.1.105/api/xdevices.json?key=Mypassword&Index=all is OK
In the Integration UI (configuration/ntegration), there is "2 appareils" (french), "1 entity", each created entity are showned as "appareil" and "entity" (normal ??)
Unexpected error fetching ecodevices_rt2 data: Expecting value: line 4 column 19 (char 80)
19:24:01 – (ERREUR) GCE Ecodevices RT2 (intégration personnalisée) - message survenu pour la première fois à 19:17:31 et apparu 15 fois.
...text
Logger: custom_components.ecodevices_rt2
Source: custom_components/ecodevices_rt2/__init__.py:139
Integration: GCE Ecodevices RT2 (documentation, issues)
First occurred: 19:17:31 (15 occurrences)
Last logged: 19:24:01
Unexpected error fetching ecodevices_rt2 data: Expecting value: line 4 column 19 (char 80)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh
self.data = await self._async_update_data()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data
return await self.update_method()
File "/config/custom_components/ecodevices_rt2/__init__.py", line 139, in async_update_data
return await hass.async_add_executor_job(ecort2.get_all_cached)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/site-packages/pyecodevices_rt2/ecodevices_rt2.py", line 84, in get_all_cached
self.get(complete_command, cached_ms=0)
File "/usr/local/lib/python3.8/site-packages/pyecodevices_rt2/ecodevices_rt2.py", line 110, in get
response = self._request(complete_command)
File "/usr/local/lib/python3.8/site-packages/pyecodevices_rt2/ecodevices_rt2.py", line 62, in _request
content = r.json()
File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 900, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/lib/python3.8/site-packages/simplejson/__init__.py", line 525, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 4 column 19 (char 80)
v2.2.3
- name: Index Chauffe Eau
type: "toroid"
id: 1
Comme indiqué ici, les sensors créés sont en kWh alors que la mesure sur le RT2 est en Wh.
De plus, le changement de l'unité avec le paramètre "unit_of_measurement" ne change que l'unité du prix et pas de la puissance.
Il faut le préciser sur la documentation, voir ajouter l'explication pour changer l'unité par ailleurs, notamment dans customize.yaml
sensor.index_chauffe_eau_consumptionindex:
unit_of_measurement: Wh
Add your logs here.
Bonjour,
depuis la mise à jour de mon RT2 (je ne sais pas s'il y a un lien de cause à effet direct), j'ai fréquemment ces erreurs qui remontent dans les logs HA :
Logger: custom_components.ecodevices_rt2
Source: helpers/update_coordinator.py:151
Integration: GCE Ecodevices RT2 (documentation, issues)
First occurred: 16:55:31 (4 occurrences)
Last logged: 17:13:11
Error requesting ecodevices_rt2 data: HTTPConnectionPool(host='192.168.31.3', port=80): Max retries exceeded with url: /api/xdevices.json?key=XXXXXX&Get=P (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7effe2664a00>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
Error requesting ecodevices_rt2 data: HTTPConnectionPool(host='192.168.31.3', port=80): Max retries exceeded with url: /api/xdevices.json?key=XXXXXX&Get=D (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7effdff7d480>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
Error requesting ecodevices_rt2 data: HTTPConnectionPool(host='192.168.31.3', port=80): Max retries exceeded with url: /api/xdevices.json?key=XXXXXX&Get=D (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f000126add0>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
Error requesting ecodevices_rt2 data: HTTPConnectionPool(host='192.168.31.3', port=80): Max retries exceeded with url: /api/xdevices.json?key=XXXXXX&Price=all (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7effe185ca60>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
Ma configuration est la suivante :
ecodevices_rt2:
- name: EcoRT2
host: "192.168.31.3"
port: 80 # Optional, default: 80
api_key: XXXXXX
update_after_switch: 0 # Optional, default: 0 (seconds)
scan_interval: 5
devices:
- name: Elect_instant
type: "api"
component: "sensor"
api_get: "Get"
api_get_value: "P"
api_get_entry: "INSTANT_POSTE1"
# type: "post"
# id: 1
device_class: "energy"
unit_of_measurement: "Wh"
state_class: "measurement"
icon: "mdi:flash"
- name: Elect_jour
type: "post"
id: 1
device_class: "energy"
unit_of_measurement: "Wh"
state_class: "measurement"
icon: "mdi:flash"
- name: Injec_jour
type: "api"
component: "sensor"
api_get: "DIndex"
api_get_value: "S"
api_get_entry: "P1_SSP1"
# type: "post"
# id: 1
# subpost: 2
device_class: "energy"
unit_of_measurement: "kWh"
state_class: "total_increasing"
icon: "mdi:flash"
- name: Eau_jour
type: "post"
id: 2
unit_of_measurement: "L"
state_class: "total_increasing"
icon: "mdi:water"
- name: Relais_EcoD
type: "relay"
id: 1
Last version 2.2.6
It seams impossible to change the unit of the counter, wich in my case, connected in the RT2 device on the water counter.
Unit should be liter or m3
In the sensor entity here is the information shown
rt2 compteur eau Index
Il y a 4 minutes
262 035 Wh
It's strange because with this config when I go in the sensor rt2 compteur eau price
It's shown
rt2 compteur eau Price Il y a 8 minutes 56,06 L
So here the value is in liters and not in Euros...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.