Being new to HA (docker latest-v8) I wonder about the concept in HA to define appropriate scan intervals for different sensor types and number of sensors connected to a sensor netowrk. Example: Having a 1-wire sensor network with abount 50+ sensors it takes some time to poll all sensors. I am using owserver as service provided as docker container and use the HA 1-Wire Integration. From known smarthome systems like FHEM or iobroker I know that polling update rate or scan intervals can be specified e.g. by entity.
Having spent considerable amount of time searching for a solution in HA I have not found a solution yet.
onewire-update-interval-caching topic 343711
onewire-add-scan-interval-option topic 311586
post look open state and the suggested solutions found here
are not clear to me.
Having a controlled and suitable sensor update rate in alignment with the physics (temp changes depend on media) it is also beneficial to reduce data to be stored. For keeping important historical data I am using an influxdb2.x and do not want this to be polluted with redundant data.
Could someone pls. recommend best way and hands-on example to define scan/polling interval of 300 seconds for my 1-wire sensors.
Thanx in advance for your help.
P.S. had to stripe links because new users can only post 2 links in a post.
two more questions:
2. could the template of the 1-wire entitiy be extended to add the value of the alias directly in the GUI?
3. is there a way to make the alias editable through GUI ?
Using more and more multi sensors such as combinations of DS2438 + DS1820 or DS2450 (next release) connected to one 1-wie device the re-definition of the polling intervall becomes a challenging task.
Assume there are 30 1-wire devices with each 3 sensors connected then this list is becomming 90 entries. My list today has already some 50 entries … with upcoming DS2450 it will get much longer.
suggest to add in the GUI a parameter to modify the default scanning interval from 30 seconds to custom value. will look now how to make such request in the right way …
This is unlikely to happen. It was changed to make it slightly difficult on purpose to prevent people with less understanding from spamming external servers (there were complaints made to Home Assistant in the past).
@tom_l
It was changed to make it slightly difficult on purpose to prevent people with less understanding from spamming external servers…
you misunderstood. it is not to get faster but much slower… with reasonable and maintainable efforts. here is how I think parameter could be limited in config_flow.py suitable for 1-wire devices. there is no way to poll all my sensors in 30 seconds . And updating long lists is error prone and loosing auto discovery.
The complaint that generated the change was about ICMP pings. Too many users were pinging external servers too frequently. As @petro indicates, you still have control over the ping interval. Here is how I ping a server on my LAN every ten seconds:
# In 2023.12.1 the polling frequency default is 30 seconds.
# You can change this in an automation:
alias: Ping-TenSeconds
description: Ping entities every ten seconds
trigger:
- platform: time_pattern
seconds: /10
condition: []
action:
- service: homeassistant.update_entity
target:
entity_id: binary_sensor.zeus_ping
data: {}
mode: single
@stevemann yes, I know as mentioned above in the thread.
Key point is that the argument about much too fast scan intervals could easily be mitigated with proper parameter limitation as suggested … then there is no point in that argument any more - right ?
my list would get near 100 lines and growing, which is error prone while loosing auto-discovery.
a hiericical way to define scan intervals is a key feature to fine tune smarthome systems and to optimize and limit amount of data needed to record. in serial slow networks it will even not be possible to scan in suggested intervals.
This will likely never get implemented. Just make an automation using a template pointing out integration entities and filtering what you don’t want. It’s a simple automation.
For my use case the selection needs to be narrowed further down to the entities of the onewire sensor platform, while other onewire platforms like switches or binary_sensor shall not be affected.
Ideally I am thinking about a three step selection
1+2: all entities from a specific platform (here sensor) inside an integration entity (here onewire) but I could not find a platform_entity selector.
{{ integration_entities('onewire')| platform_entities('sensor')}}
since sensor is the platform name this can be achieved with the following entity selection
3: then filter further down if needed e.g. to select specific channels from DS2450 family 20.
@tom-ha
was this code only an idea by you ? Or is it really working ?
I am asking, because I am trying to set the SCAN_INTERVAL via GUI in my custom_intgegration. (sensor integration)
Currently I am adding the intervall in the const.py
SCAN_INTERVAL = timedelta(seconds=60) # updateinterval in seconds
globally for all my entries.
So far this is working.
My question is, (if this code is rerally working) if I use the code in my config_flow.py data template how is Home Assistant handling / update this value ?
Because if I check my entities in developer tool, they dont have the attribute for scan_interval.