New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BRT-100-TRV improvements #4832
BRT-100-TRV improvements #4832
Conversation
My bad, I should have run the linter! Will do next time. How do I get around the |
While the TRV supports half degree temperature setpoints, the Zigbee protocol only supports integer values, both for setting and reporting.
e86100b
to
f13a679
Compare
Thanks! |
This has broken my TRVs. They are say unknown now. In the operation dropdown I can now only see heat but if I select it it changes back to unknown again, error in mqtt Invalid modes mode:` system_mode Look into it later, got to work! |
Why? The thermostats supports |
Fractional values are not exposed over Zigbee: zigbee-herdsman-converters/converters/toZigbee.js Lines 3431 to 3434 in e4317cc
zigbee-herdsman-converters/converters/fromZigbee.js Lines 4058 to 4059 in e4317cc
so from the Z2M point of view, only 1 increments are supported in practice. That's why if you try to set e.g. 20.5, it will snap to 21. The converter is rounding up before sending the value. So we might as well declare than only integer increments are supported.
|
Thanks for that. I just checked again and you're right. I could've sworn this was working some time ago though |
This update indeed broke my TRV also: And I do agree with @Impact123 that I could put 0.5 degrees in Z2M before cause I have a scheduler still configured to push it to 20.5° instead of rounded numbers. Still remains the question how come this worked in the past if Zigbee doesn't allow fractional numbers. 0.5 seems nothing but it's actually a difference in heating the room just too warm cause of the delay in heating up the room ;) |
For everybody affected by this PR: there is a workaround at Koenkk/zigbee2mqtt#14771 (comment) (which is, flip between preset & manual once so that the TRV reports a value for Re 0.5, I suggest opening an issue? I'll git blame my way through, if it worked in the past, the code must be somewhere in the history. I would also like to set fractional temperatures if that's possible! |
Yup perfect, I tried changing values to get an update but never thought to click on that one. Regarding the 0.5 have a look if you can, I know there have been other discussions on the 0.5 but each time that it only allows on 1° difference. However I'm pretty sure this TRV allowed 0.5° to be put in Z2M. |
Just a follow up on the 0.5 degree part, I have another TRV from another brand which allows a 0.5 |
I have done a minimum of digging... Support for the BRT-100-TRV was merged Jun 2021 in #2652. As far as I can tell, the code was never able to set half degrees. The explicit rounding up was introduced after two weeks, I am pretty sure because fractional values were triggering a bug in a TuYa function that expected integers (commit & PR don't offer details, so I can only conjecture). Given my (little) experience with TuYa-based devices, there is no way to set a non-integer setpoint. The firmware doesn't expose the functionality over Zigbee to do that. On the bright side, I think the schedule does support half degrees, because those values are multiplied by two, except the current converter only does integers, apparently on purpose. I'll try to update the schedule code, if it works, you'll see a PR. |
…k#4832) * BRT-100-TRV: add constant system_mode * BRT-100-TRV: duplicate valve_state to running_state * BRT-100-TRV: improve accuracy of temperature limits * BRT-100-TRV: change temperature step to 1 While the TRV supports half degree temperature setpoints, the Zigbee protocol only supports integer values, both for setting and reporting.
I am trying to improve the BRT-100-TRV converter a bit. In short, I did:
system_mode
(alwaysheat
) andrunning_state
(duplicate ofvalve_state
). This is mostly to the benefit of Home Assistant: with this PR, HA reports the heating/off state directly in the thermostat widget, and correctly shows "heat" as the only mode (as opposed to heat/cool/auto/etc)I hope the changes are ok. I don't particularly like the way I handled
system_mode
. The valve does not report anything useful for it, as its value would always be "heat" anyway, so I tacked the system mode value to the preset. Is there a better way to expose a constant value?