In integration => KNX => configuration => communication settings, we can enable and disable “state updater”. The description:
“Set default for reading states from the KNX Bus. When disabled, Home Assistant will not actively retrieve entity states from the KNX Bus. Can be overridden by sync_state entity options.”
But according to KNX - Home Assistant, not every device types has sync_state as optional parameter.
For button, scene and notify it wouldn’t make sense.
Climate is an edge case where some configuration would not work without sync_state (when set to False).
Platforms that support respond_to_read would need validation - it can’t read from itself I guess.
For the rest it should be fine. Do you want to add that functions yourself?
I was planning to change the option to turn it on/off in the Configuration menu to make the default strategy and time selectable.
Thanks very much for for reply. If you agree, I would like to add that function by myself, for device types of Fan, Climate, Cover, Switch, except Button, Scene and Notify.
For my case, I would configure Climate for my floor heating. That a power saving screen, sleep for several minutes, wake up, write current temperature to KNX, if the current temperature is lower than expectation, write switch on to KNX.
If totally makes sense for me.
If you have a switch GA for example that doesn’t have a device that saves the state, home assistant will try to read the GA when there is no update for one hour.
But nobody will respond to the read request. Home assistant will therefore set the GA to off and also write it to the bus.
That is not the expected behavior. So in this case one needs to be able to disable the sync for these specific items.
I also have this for dimming GAs where the endpoint is a broadcast address of my DALI Gateway. This address also can’t be read so it will spam the log every hour. Luckily it doesn’t write to the bus in that case.
You can just omit the *_state_address for almost all entity configurations. These are optional. HA will never send a read request then.
For switches you may even set respond_to_read so other knx devices can query HAs state (similar to expose).
That is not the case. States are not changed when no responses are received. Neither will anything be written to the bus.
On startup though it will assume OFF state when there is no response.
If you experience different behavior you should investigate if some automation etc is doing that on your system.
Same problem as herr2d2
sync_state return an error:
Invalid config for 'knx' at KNX.yaml, line 12: 'sync_state' is an invalid option for 'knx', check: knx->light->0->sync_state
sync_state is needed at the init of HA to sync the light state.
After the start up init, it’ is no more needed because the actuator will always return and send the output state on each command (On/off, scene, timing, …)
So yes, it would very nice to have this option. It will reduce significant number of useless telegram on the knx bus.
Absolutely upvote for this feature, especially light ans switch in the YAML. The sync between HA and KNX drops from time to time, and I can’t find the reason.
As far as I am able to see, xknx support the sync_state for lights (https://xknx.io/light) but it is not supported with home assistant yet.
I.e. I have some lights around my house, which are locked during daytime to save energy. This means, that my actor won’t react to any “light ON” command on the KNX Bus.
Unfortunately the actor is not able to respond during “lock-state” with a “status OFF” flag. Because of that home assistant assumes to have switch on the lights successfully - but they are not.
Is there any way to implement sync_state for lights too please?
sync_state is on by default for lights (and every other platform). It does query every hour. It’s not meant to query right after a control-event. This would be a very different feature - which I think somewhere a feature request already exists… but don’t remember where.