It really doesn’t make a lot of traffic. The native api is very efficient and shouldn’t even send values if they didn’t changed. I have around 100 esphome nodes and some have a 0.1 second interval (like power meters for example). No problems what so ever (beside on the ha side the database grows big fast!) with the amount of traffic - it’s peanuts in the end. Every phone that streams a video probably transmits more traffic in a second than an average esphome node transmits in a whole day.
So beside this “lot of traffic” doesn’t seem to look plausible in any matter you can still “throttle” the amount of data you send to ha while keeping a high internal update interval.
I think this is what your asking for but not 100% sure.
Goes under your sensor. So you have “update_interval: 1s” then 1 x 60 = 60 seconds. HA will get a average every 60 seconds. If you would like to receive a actual number close to average then make the number odd like 61
i’m sorry if you understand the traffic is a problem. I just want to understand the way it work to find the finest way to do it.
maybe it was better if i just asked “can i keep ADC internal even for fast ADC read (1sec)”.
i read ADC voltage from alarm system (sensor/area). i put an treshold to detect if sensor detect or not human.
Then i need fast read (60 sec has no sense). but i dont need to transmit voltage to HA. only changes between DETECT and NOT DETECT (the threshold sensor linked to ADC read)
thank you for your example. but it don’t seems to help me to resolve my problem/question.
You can then just keep the adc sensor internal with the refresh interval you want and create a analog threshold binary sensor which is exposed to ha.
It’s exactly my problem my dear ! look at this :
This one expose “Z1” & “Z1 detect hall” to HA !!! (seems that update_interval force internal to false ) but it work, every second an ADC measure and threshold updated.
And next one (without update_interval) expose only Z1 detect hall (good, internal stay true) , but adc take 1 measure every 60 sec then threshold is also updated every 60 sec too. too slow to get alarm infos. need 1 or max 2 seconds !
Thanks for your answer ! i try to do my best. sorry.
The indetnation was a copy/paste problem, see this screenshot, adapted with your advice “remove name Z1” (i removed, Z2…Z6 to allow you to see indentation) :
and here is the result, continue to post/expose Z1 every second :
The analog threshold hard-codes the value in the compile, I don’t like that. It means every time you want to try a new setting, you have to recompile. I use a helper in HA to hold my threshold so I don’t have to recompile and it allows me to change it easily as needed, on the fly.
How to send 'immediately" (1sec) only “status under/over” changes status when ADC voltage is over/under 1.8V. then without voltage every second.
As sometimes it seems a make bad explainations i say it other way :
ADC changes over/under threshold must be detected/sent in the second. But without post voltage every second.