Closed TheChatty closed 1 year ago
Thank you for sharing, this would be a really nice improvement
In the current implementation, the sensors are defined in const.py https://github.com/golles/ha-kamstrup_403/blob/main/custom_components/kamstrup_403/const.py#L30-L320 And the protocol is defined in https://github.com/golles/ha-kamstrup_403/blob/main/custom_components/kamstrup_403/kamstrup.py
At the moment __init__.py
loops through all sensors defined in SENSORS.items()
and calls readvar
for each one.
The new way would be to pass SENSORS.items()
down to new function readvars
which prepares a single request for all sensors. The new request would look like:
3F 10 <numSensors> <codeOfSens1> <codeOfSens2> <codeOfSens3> ...
And the single response needs to be taken apart matched to each sensor:
3F 10 <codeOfSens1> <respSens1> <codeOfSens2> <respSens2> <codeOfSens2> ...
See this example for how to request 7 sensors at once and how to decipher the response.
Thanks, my previous comment was supposed to go to #31 (sorry for that)
For now, I marked this as a nice to have in #30. If I won't make it in that PR, I'll do it in the next one
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
PR for this feature is available, see #56
Please, if you have time, test this branch: 29-support-reading-of-multiple-values-at-once
FYI: This feature has been released in version 2.1.0
Did you read the instructions?
The request
I simply tried to read multiple values and it worked. I documented it here.
Additional information
No response