michaelahern / homebridge-airthings

A Homebridge plugin for Airthings air quality monitors via the Airthings Consumer API.
ISC License
38 stars 6 forks source link

Cache accessory? #29

Open athurdent opened 1 year ago

athurdent commented 1 year ago

First of all, thank you for this awesome plugin! I have been trying to use e.g. 2.5 PPM sensor data in my automations. Unfortunately this only works as long as I do not restart Homebridge. After a restart, the 2.5 PPM condition is gone from my automation. Complete noob here, but as the AirThings View do not appear in Homebridge cached accessories, maybe this is the cause for my automations to stop working after a restart? If so, would it be possible to cache the devices?

michaelahern commented 1 year ago

This is likely because I naively originally created this as an accessory plugin instead of a platform plugin, and there doesn't appear to be a way to do caching with accessory plugins. Switching to a platform plugin model would have backward compatibility issues with all existing users. Will keep this issue open to track feedback or upvotes if others are interested in this..