This is quite a significant change and it would change how data is fetched from the gateway. The integration would probably have to be rewritten completely. Without having studied this in great detail, I believe a downside would be a reduction in the responsiveness on updates of the state of the devices. On the upside, this might make the integration more stable.
Going down this route would allow exposing batteries for all entities and I know this has been a requested feature in the past.
yes, that would be awesome too (batteries)
btw, Ever since I added 2 Starkvind devices, I felt the connection issues to the Tradfri gateway have increased. Though the last Tradfri firmware update has improved things a lot, your words above make me believe it to be a good thing reviewing that aspect too. If responsiveness is at play, constant polling updating of the devices might interfere with robustness of the system.
Introducing the DataUpdateCoordinator would be wise for that matter alone?
To clarify, we don’t poll today, but subscribe to changes. Using the co-ordinator could possibly improve stability, but I don’t know for sure. I rarely experience stability issues myself so it’s not for that reason we should make this change.
No, for sure.
thats not what I suggested. Having the additional functionality would be the driver. Batteries and air quality would be very useful to the toolset.
(if that could streamline some (severe) stability issues we’ve been experiencing that would be a nice side catch…)
I corrected my wording I the previous post
I’ve been interested in learning about the data co-ordinator for a while so I took a stab at it this weekend. I just invited @Mariusthvdb to the private repo where this sits to test it.
A few words of caution: the process around handling the integration is not super stable. When I added the custom integration to my system, all devices ended up having duplicates. I had to remove
the integration and add it back again, and then restart, for it to work. Consider adding this custom integration as a breaking change.
Also, I don’t have a blind device so I haven’t been able to test if it works. Please let me know if you do and if it works (including the battery status).
got I up and running (had to smart guess the startup data… being ip and secret code). Not seeing any battery sensors yet, I do see a air purifier sensor
maybe I need te restart once more. just to be sure: is there a minimum HA version for this? My instance is running 2021.12.6, I take it that would suffice?
o, and: WOW, thanks! great start of the new year thats for sure.
this is magic! (even though the measurement displays a huge difference for which I checked the app, and ‘Ella’ was switched-off, so I guess it then doesnt measure the quality either). Yep, turning it on immediately shows a better result. Might be a thing to note in the integration: if turned off, the air sensor is not useful?
there is 1 anomaly (also in core btw) for the open close button of my cover:
I’ve pushed three different fixes to the repo that hopefully addresses the issues raised here. I don’t have any of the missing devices so it’s difficult for me to debug this
i installed it, but still dont see the repeaters… will need to have a closer look.
could it be that the core integration on my other instance suffers from this extra traffic to the Gateway? seeing
WARNING (MainThread) [homeassistant.components.tradfri.base_class] Observation failed for Bureau right
on all my devices/entities, and had to reload the integration manually . and again after toggling a light in the CC, my core integration loses connection so it seems
believe we need a speedy migration of the core integration to use your CC setup!
btw, I just gave it another restart, with all new files for the fix. The same (even couple of extra) ‘already existing’ errors were issued, and I now have 30 more entities all with a suffix _2… so this needs a bit more investigating
o well, I did it manually for now. Will do like that on a next update
we might need that sooner than later, because the 2 systems wont co-exist and I’ll have to install this CC on my production system (not possible to live without the Tradfri integration there…)