Ciao Alex e grazie per il tuo lavoro che consente di utilizzare facilmente il dispositivo Alfa in Home Assistant!
Volevo chiederti se è possibile conoscere il momento in cui vengono aggiornati i dati monitorati, in modo da visualizzare opportunamente anche tale informazione.
Grazie ancora.
Ciao Stefano. Non ho capito la domanda. Inoltre, le regole del forum HA impongono di scrivere in inglese, se non puoi/vuoi, scrivimi in italiano nella sezione "Discussions" sul repository GitHub.
Sorry, but I have trouble with English, so I use Google Translate.
I created a Power Flow Card Plus where I would also like to display the time remaining (in seconds) until the monitored values are updated.
It would be a cyclic countdown of the polling interval: Is that possible?
you can configure the polling interval, so it's a known value, but it's not exported by any entity. you can create a helper of type input_number with the polling period value. then you can use that entity (example: input_number.alfa_polling_period) wherever you want.
Ok, but the integration could be more complete if the configuration parameters could also be exported...
In your integration's GitHub repository, I also saw that the code contains constants and variables related to polling: I think it's CONF_SCAN_INTERVAL and scan_interval. Can't they be exported as entities? Are they the correct ones?
I deliberately don't, and it's a quality choice, not a missing feature. In Home Assistant, exposing configuration values as entities is discouraged: they're static, they only change when you edit the options, and they just duplicate something you already set. An entity that never meaningfully changes adds noise without adding information.
If you really need it, fork the project and implement it yourself, that's the power of open-source software.
I probably would, but unfortunately, I don't feel up to developing a GitHub fork.
If I may ask, how can I retrieve the static values of the options, even when they're reset?
The time remaining for a data poll isn't a static value, and I think it's useful for adding precision and dynamism to monitoring...
Thank you for your patience.
The polling period IS a fixed/static value you configure in the Alfa integration. What you want is an expiring timer: The correct Home Assistant tool for it is a Timer helper, which gives a real ticking countdown without writing a new state every second:
Settings → Devices & Services → Helpers → Create Helper → Timer. Name it e.g. "Alfa Next Update", duration 00:01:00 (60 seconds, matching your interval).
Create an automation: trigger = Timer "finished" for that timer → action = Timer "start" the same timer. This re-arms it forever — an endless cyclic countdown of exactly the polling interval.
Optional: a second automation, trigger "Home Assistant started" → action Timer start, so it begins automatically after a reboot.
Now the timer entity shows the remaining seconds and you can drop it straight into Power Flow Card Plus — exactly the precision and dynamism you're after.
If you'd like it synced to the actual poll moment rather than free-running, you can additionally restart the timer whenever one of the Alfa sensors reports a new value, but the free-running version already matches what you described.
All this has NOTHING to do with the integration, in your way of managing your devices, you like to see a timer expiring, I don't think it's useful, and I never saw an integration exposing this nor a user asking this.
Having said that, I hope I've helped you realize what you want, and hope this off-topic discussion doesn't continue further because it's not in the general interest of users of this integration.