How is state cached? #920
Replies: 6 comments 18 replies
-
Old and new integration work nearly identical, but here i'll describe the current state of the new integration. The CCU sends batches of updates, and if the value for a parameter changes, then this value will be refreshed in HA. The same happens, when a value is changed in the HA UI or by a HA service. On value will be sent for a switch, but multiple values are possible for siren, cover, climate, light, .... Changes values are always sent to the CCU, and the result (callback from CCU) will be displayed in the UI. We don't change values of local entities with the outgoing service call! |
Beta Was this translation helpful? Give feedback.
-
Ok. Thanks for the info.
I understand that you only change the local state by the result of the callback. Sounds reasonable and leads to some glitching e.g., when changeing the temperature with the climate dial UI. But even if the new value is the same as the actual value it is sent out to the device. Example: switch_therme_ausgang_x. In this case I need to check if already in that state to save duty cycle. And I should normally do that everywhere I set something. I was already thinking of writing a generic script to do so and then thought better to ask how this is done and why no state check before.
|
Beta Was this translation helpful? Give feedback.
-
Keep it simple stupid. Hmm. I don't see it that way. Now you impose it to the user to take measures to keep the duty cycle high. Another example: Setting the week program on a heating group. I can see spikes in my duty cycle due to that, going up > 50% sometimes. I got 43 HM/HMIP devices in complete. 584 Entities. Is the effort for
so high? Remark: Yes there might be side effects which I do not see right now. |
Beta Was this translation helpful? Give feedback.
-
Ok. I see that this adds complexity due to things are coupled. Solution for me: Write a "do only when needed" script for switch and light and use these scripts to avoid duplicating the effort in many automations. Not the nicest thing, but better than nothing. |
Beta Was this translation helpful? Give feedback.
-
Yes, I seems you misunderstood due to my recently reported bug on set_paramset. I want to see something like that by default:
Same for light, and week_program and ... Not the complex thing you mentioned. |
Beta Was this translation helpful? Give feedback.
-
https://github.com/danielperna84/hahomematic/releases/tag/2023.2.2 Avoid backend calls if value/state doesn't change Thanks! It seems I can get rid of a lot of special handling in my automations and will see a decline in DC. |
Beta Was this translation helpful? Give feedback.
-
Hi,
just want to understand if things are the same they where in the old integration.
Assume:
I set a switch to on via service switch.turn_on or via device turn on.
If the switch is already on, is that data packet sent over the air again (rising duty cycle) or not?
In the old integration it was sent again which did lead to a lot "check if state is same as new_state and only set if not same set it" in automations.
I would love to get rid of them.
If paket is still sent that might be a possible enhancement to use the feedback state (which is also available in HMIP at least) to avoid extra data packets sent over the air.
Beta Was this translation helpful? Give feedback.
All reactions