pblxptr / ecoNET-300-Home-Assistant-Integration

ecoNET300 Home Assistant is a custom integration for ecoNET300 devices.
16 stars 6 forks source link

sensors don't show parameters #1

Closed jontofront closed 1 year ago

jontofront commented 1 year ago

Home Assistant 2022.12.7 Supervisor 2022.11.2 Operating System 9.4 Frontend 20221213.1 - latest

image

Error log

2022-12-22 21:57:19.327 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry ecoNET300 for econet300 Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 372, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/econet300/__init__.py", line 24, in async_setup_entry await api.ping() File "/config/custom_components/econet300/common.py", line 64, in ping await self._client.get_sys_params() File "/config/custom_components/econet300/common.py", line 39, in get_sys_params return await self.get_params("sysParams") File "/config/custom_components/econet300/common.py", line 42, in get_params async with await self._get("http://" + self._host + "/econet/" + reg) as resp: File "/config/custom_components/econet300/common.py", line 53, in _get return await self._session.get(url, auth=self._auth, timeout=5) File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 559, in _request await resp.start(conn) File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 893, in start with self._timer: File "/usr/local/lib/python3.10/site-packages/aiohttp/helpers.py", line 721, in __exit__ raise asyncio.TimeoutError from None asyncio.exceptions.TimeoutError

I am not developer, but maybe it's helps you with sensors, I was made integration by template:

#EcoNET boiler
- platform: rest
  scan_interval: 300
  resource: !secret econet24_host
  method: GET
  name: Boiler
  verify_ssl: false
  username: !secret econet24_user
  password: !secret econet24_psw
  authentication: basic
  headers:
    User-Agent: Home Assistant
    Content-Type: application/json
  value_template: "OK"
  json_attributes:
    - curr
- platform: template
  sensors:
    boiler_fuellevel:
      friendly_name: Fuel level
      unique_id: boiler_fuel_level
      value_template: '{{states.sensor.Boiler.attributes["curr"]["fuelLevel"] }}'
      device_class: battery
      icon_template: mdi:gas-station
      unit_of_measurement: "%"
    boiler_temperature:
      friendly_name: Boiler temperature
      unique_id: boiler_temperature_c
      value_template: '{{states.sensor.Boiler.attributes["curr"]["tempCO"]|int }}'
      device_class: temperature
      unit_of_measurement: "°C"
      icon_template: mdi:coolant-temperature
    boiler_set_temperature:
      friendly_name: Boiler set temperature
      unique_id: boiler_set_temperature_c
      value_template: '{{states.sensor.Boiler.attributes["curr"]["tempCOSet"]|int }}'
      device_class: temperature
      unit_of_measurement: "°C"
      icon_template: mdi:thermometer
    boiler_pumpcoworks:
      friendly_name: Boiler operation
      unique_id: boiler_operation_status
      value_template: '{{states.sensor.Boiler.attributes["curr"]["pumpCOWorks"] }}'
    boiler_output:
      friendly_name: Boiler output
      unique_id: boiler_output_percents
      value_template: '{{states.sensor.Boiler.attributes["curr"]["boilerPower"] }}'
      unit_of_measurement: "%"
      icon_template: mdi:microsoft-powerpoint
    boiler_fan_output:
      friendly_name: Boiler Fan output
      unique_id: boiler_fan_output_percents
      value_template: '{{states.sensor.Boiler.attributes["curr"]["fanPower"]|int }}'
      icon_template: mdi:fan
      unit_of_measurement: "%"
    boiler_mixer_set_temp1:
      friendly_name: Boiler Mixer Heat Set Temperature
      unique_id: boiler_micer_heat_set_temeperature
      value_template: '{{states.sensor.Boiler.attributes["curr"]["mixerSetTemp1"]|int }}'
      device_class: temperature
      unit_of_measurement: "°C"
    boiler_mixer_temp1:
      friendly_name: Boiler Mixer 1 Temperature
      unique_id: boiler_mixer_1_temperature
      value_template: '{{states.sensor.Boiler.attributes["curr"]["mixerTemp1"]|int }}'
      icon_template: mdi:thermometer-lines
      device_class: temperature
      unit_of_measurement: "°C"
    boiler_temp_huw_set:
      friendly_name: Boiler set hot water
      unique_id: boiler_set_hot_wate
      value_template: '{{states.sensor.Boiler.attributes["curr"]["tempCWUSet"] }}'
      device_class: temperature
      unit_of_measurement: "°C"
    temp_huw:
      friendly_name: Hot water
      unique_id: hot_water_temperature
      value_template: '{{states.sensor.Boiler.attributes["curr"]["tempCWU"]|int }}'
      device_class: temperature
      unit_of_measurement: "°C"
    temp_outside:
      friendly_name: Temperature outside
      unique_id: temperature_outside_near_door
      value_template: '{{states.sensor.Boiler.attributes["curr"]["tempExternalSensor"]|int }}'
      device_class: temperature
      unit_of_measurement: "°C"
pblxptr commented 1 year ago

Hello, thanks! Could you please reproduce this? It seems that there was a timeout while requesting sysParams. I'm curious if it happened due to a temporary unreliable network/device. If so then I think I will either increase the timeout value or add a retry policy.

jontofront commented 1 year ago

After update I got Error. (I delete all project and reinstall it) image

I comment one sensor in code https://github.com/pblxptr/ecoNET-300-Home-Assistant-Integration/pull/2

By the way you can close pull request I see you update your code

pblxptr commented 1 year ago

I've already stumbled upon this bug, it's fixed but I haven't pushed commits to master yet. I will push the code to the remote probably today. Btw if you're interested in any sensor that I haven't included in the current configuration please let me know because I mostly rely on what I have in my setup. Also, I'm going to create the first release with only read-only sensors as the writable part is a bit trickier. It requires mapping 'key' to the corresponding param number that is then required by econet300 API, so first I have to figure out the mapping. Btw could you share what fw version you have installed on your ecoNET300 module? You can check it here: http://your_IP/econet/sysParams, it is under 'ecosrvSoftVer' key.

jontofront commented 1 year ago

I've already stumbled upon this bug, it's fixed but I haven't pushed commits to master yet. I will push the code to the remote probably today. Btw if you're interested in any sensor that I haven't included in the current configuration please let me know because I mostly rely on what I have in my setup. Also, I'm going to create the first release with only read-only sensors as the writable part is a bit trickier. It requires mapping 'key' to the corresponding param number that is then required by econet300 API, so first I have to figure out the mapping. Btw could you share what fw version you have installed on your ecoNET300 module? You can check it here: http://your_IP/econet/sysParams, it is under 'ecosrvSoftVer' key.

Sure. If you provide me hows look mapping maybe I can investigate it and create map keys image

image

pblxptr commented 1 year ago

I've already stumbled upon this bug, it's fixed but I haven't pushed commits to master yet. I will push the code to the remote probably today. Btw if you're interested in any sensor that I haven't included in the current configuration please let me know because I mostly rely on what I have in my setup. Also, I'm going to create the first release with only read-only sensors as the writable part is a bit trickier. It requires mapping 'key' to the corresponding param number that is then required by econet300 API, so first I have to figure out the mapping. Btw could you share what fw version you have installed on your ecoNET300 module? You can check it here: http://your_IP/econet/sysParams, under the 'ecosrvSoftVer' key.

Sure. If you provide me hows look mapping maybe I can investigate it and create map keys image

image

Thanks. Could you give me the output of http://IP/econet/rmCurrentDataParamsEdits ? This is probably data with editable parameters including maximum and minimum values. Also, I see that editable parameters will probably have to be cached somehow because the whole system seems to have some kind of "latency". I checked it on econet24.com and it works exactly the same there. Whenever you change some value let's say tempCWU from e.g. 50 to 51 degrees Celsius, it shows the old value for about one minute and after that, it changes it to the desired value. I could leave it like it is on econet24 but I guess that users would complain that the value gets changed with a delay or they would not even notice that the value gets changed after some time. Will see.

jontofront commented 1 year ago

I pull new code now I am get parameters: image

So there are no errors: image

jontofront commented 1 year ago

Thanks. Could you give me the output of http://IP/econet/rmCurrentDataParamsEdits ? This is probably data with editable parameters including maximum and minimum values. Also, I see that editable parameters will probably have to be cached somehow because the whole system seems to have some kind of "latency". I checked it on econet24.com and it works exactly the same there. Whenever you change some value let's say tempCWU from e.g. 50 to 51 degrees Celsius, it shows the old value for about one minute and after that, it changes it to the desired value. I could leave it like it is on econet24 but I guess that users would complain that the value gets changed with a delay or they would not even notice that the value gets changed after some time. Will see.

there are output

{
"currentDataParamsEditsVer":1,
"data":{
"1280":{
"max":68,
"type":4,
"value":37,
"min":30
},
"1798":{
"type":10
},
"2048":{
"max":2,
"type":4,
"value":0,
"min":0
},
"2049":{
"max":2,
"type":4,
"value":0,
"min":0
}
}
}

I try to change boiler temperature an see that: 1280 - Boiler set temperature,

pblxptr commented 1 year ago

Fix already on master