mduran80 / daikin_madoka

Home Assistant custom component integration for the BRC1H thermostat (madoka)
MIT License
42 stars 10 forks source link

Polling of devices #9

Closed frigi83 closed 2 years ago

frigi83 commented 2 years ago

Thanks @mduran80 for this custom integration. You have simplified my life. A port on ESPhome would be great, but is to much for my programming knowledge. The Advantage is that you can place a cheap ESP32 to reach the Madoka device.

The real issue is: adding a polling of the status of the devices. Why? You can change the status in Home Assistant and someone operate a change locally on the Madoka. Home Assistant see the change only on reboot.

It would be nice to have the ability to configure a polling interval in the integration, for example 5 minutes to update the status of the Madoka in HA.

There is a workaround with a service?

mduran80 commented 2 years ago

Hi there,

The issue is that by the time the custom integration was developed, it wasn't required to specify the type of polling to be used by the integration. Later on, HA evolved and started to require the specification but I only added it to the "official" integration to be merged into the HA Core (PR still pending though....).

By the way, the code of the "official" integration has been tested in depth. I guess you can copy it and use it directly as a custom integration (without translations as they are handled differently in the Core).

If you just want to specify the polling type, it should be enough to add a field in the manifest for the custom integration as I did for the core:

"iot_class": "local_polling"

https://github.com/mduran80/core/blob/daikin-madoka-integration/homeassistant/components/daikin_madoka/manifest.json

Let me know if it works.

frigi83 commented 2 years ago

@mduran80 you are amazing, it works!