bosch-thermostat / home-assistant-bosch-custom-component

HA custom component for Bosch thermostats
Apache License 2.0
216 stars 45 forks source link

Add ETRV “start calibration” button to the home assistant integration #388

Closed roderik-maker closed 6 months ago

roderik-maker commented 7 months ago

Is your feature request related to a problem? Please describe. I have my ETRV’s powered from mains power (I try to avoid batteries when possible). When I do any electric work and have had to flip a breaker and the ETRS comes back online afterwords they need to be recalibrated. I have to manually go into the easy control app, go to settings -> devices and then go into each device to press the “start calibration” button of the respective ETRV. It would be great to add this (“start calibration”) button to home assistant so I can have my valves calibrate again automatically after a power failure. I know this is probably a big ask, but sometimes I forget to recalibrate and then the valves are fully open for days wasting a lot of heat. For me, being able to automatically start the calibration process when needed (the button is only available when a calibration is needed, at least in the app) would be a significant quality of life improvement!

Describe the solution you'd like Add a “start calibration” button component for each ETRV (that becomes available when an ETRV indicates it’s no longer calibrated), or at least a sensor to indicate it is needed for each ETRV connected to the system.

Describe alternatives you've considered Doing it manually each time and setting reminders that activate based on clusters of devices going offline (ie power failure but this doesn’t work if home assistant goes offline too).

Additional I can provide a raw debug scan of my system when the “start calibration” button is available for a few devices in the app, and a second scan that I ran a couple minutes later (after I re calibrated everything) when the “start calibration” button doesn’t show in the app. (As these 2 files contains personal data I’d rather not share them publicly in case I miss any personal details).

Just after a first look, I think I found where (in the raw scan) you can identify the valve needs to be calibrated again.

Before calibration:

{
  "id": "/devices/device3/etrv/status",
  "type": "stringArray",
  "writeable": 0,
  "recordable": 0,
  "used": "true",
  "available": "true",
  "value": [
    {
      "id": 3,
      "valve": "valve_adaption_in_wait_state",
      "battery": "ok"
    }

After calibration:

{
  "id": "/devices/device3/etrv/status",
  "type": "stringArray",
  "writeable": 0,
  "recordable": 0,
  "used": "true",
  "available": "true",
  "value": [
    {
      "id": 3,
      "valve": "valve_adaption_sucessful",
      "battery": "ok"
    }

Even just adding a sensor that indicates if any valve states are in the “valve_adaption_in_wait_state” would already be useful. That way I could send myself notifications to when a calibration is needed. However also adding a trigger to start the calibration would be even better (so I can fully automate the process).

Thank you in advance for your time and for this project. CAN’T BELIEVE BOSCH HASN’T MADE A LOCAL API YET!

pszafer commented 7 months ago

This can only be implemented as sensor as it's not writable URI. I still need your full scan anyway.

roderik-maker commented 7 months ago

Is it okay if I send the files to the gmail linked to your account? Also, out of interest, is it not writable URI because " "writeable": 0, " ? Is there a chance I can find an alternative parameter that triggers the calibration that is writeable?

pszafer commented 7 months ago

it's ok to send an email, although personal data are cut from scan.

roderik-maker commented 7 months ago

Sent you the debug files. Have a good weekend!

pszafer commented 6 months ago

Added in https://github.com/bosch-thermostat/home-assistant-bosch-custom-component/releases/tag/v0.25.0-dev.7

As api returns an array and we don't know what it can return so you'd need to make template sensor from it. Something like this maybe:

{{ state_attr('sensor.device2_etrv_status', 'stateExtra')[0]['valve'] }}

Let me know if that works, then I'll release stable version

masterx1981 commented 6 months ago

Tried the dev 7, but i not see the etrv status under the etrv devices sensors/diagnostics under ha... Need to do someting to recognize the newly exposed sensor? Thanks!

pszafer commented 6 months ago

Devices which are reported as only thermostats are under Bosch sensors.

masterx1981 commented 6 months ago

I still not see the etrv status. Screenshot_20240401_170453_Home Assistant

masterx1981 commented 5 months ago

I think that this, if it's readonly, isn't really needed, as the new error notification implemented in the latest version show correctly the error about an etrv not calibrated (and much more, like dead batteries). The error notification is really useful, thanks!