dalinicus / homeassistant-acinfinity

AC Infinity integration for Home Assistant for UIS based controllers
MIT License
75 stars 4 forks source link

Ability to change the frequency in which sensor data is pulled. #32

Closed almighty059 closed 11 months ago

almighty059 commented 11 months ago

The integration seems to pull data every 30 seconds or at least that's what it shows in the history on Home Assistant. I have automations setup in Home Assistant that trigger when there are changes in temperature, humidity, and vpd. Since there are three event that I use as triggers my automation is being run more than I would like it to. Is there anyway to add a feature to change the frequency in which the data is being pulled? So instead of it being 30 seconds I could change it to 1 min or 2 minutes?

As I was writing this I thought of a possible work around for now which I think would work. I all three of the above mentioned sensors pull data at 30 second intervals then I could probably just use one of them as a trigger. I could then probably setup condition in my automation that check the state of all three sensors and then preform any actions accordingly. That should work to decrease the amount of times the automation is run from 6 times a minute to 2 times a minute but that's it. A feature that adds the option to change the frequency in which the data is being pulled would allow me to decrease that even more.

dalinicus commented 11 months ago

Are you using the 1.1 release or the main branch? I refactored the data polling to use the home assistant built it data coordinators instead of ad-hoc poling... (#22) the changes are bundled in with unrelated changes that also add like 15 new setting entities per device connected to the controller, so I was working on a custom lovelace card to organize them all before I released it at version 1.2.

I'll take a look around the HA API for the data coordinator and see if there's an update interval setting. If so, I'll throw an option in the config dialog for it :)

dalinicus commented 11 months ago

image Sure is :) I'll whip you up a change.

dalinicus commented 11 months ago

This will be included in the 1.2.0 release. I've published a pre-release version that include this and many other changes since the last release. If you'd like to use this feature now, you can enable beta versions from the "Re-download" dialog in HACS

image image

dalinicus commented 11 months ago

additional-configuration