Skip to content
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

Update TZE200_b6wax7g0 moes.ts #8561

Merged
merged 1 commit into from
Jan 5, 2025
Merged

Update TZE200_b6wax7g0 moes.ts #8561

merged 1 commit into from
Jan 5, 2025

Conversation

loodvin
Copy link
Contributor

@loodvin loodvin commented Jan 4, 2025

increased accuracy on both devices

increased accuracy on both devices
@Koenkk Koenkk merged commit bdbd922 into Koenkk:master Jan 5, 2025
2 checks passed
@Koenkk
Copy link
Owner

Koenkk commented Jan 5, 2025

Thanks!

@srett
Copy link
Contributor

srett commented Jan 26, 2025

@loodvin Does this actually work for you? If so, maybe there are different firmware versions of this device around after all, because mine don't accept .5 increases.

When I go from 17 to 17.5, the TRV will jump to 18 and after a second or two, this is reflected in zigbee2mqtt.
When I go from 18 to 17.5, the TRV stays at 18 and zigbee2mqtt never updates the state.

@loodvin
Copy link
Contributor Author

loodvin commented Jan 26, 2025

@loodvin Does this actually work for you? If so, maybe there are different firmware versions of this device around after all, because mine don't accept .5 increases.

When I go from 17 to 17.5, the TRV will jump to 18 and after a second or two, this is reflected in zigbee2mqtt. When I go from 18 to 17.5, the TRV stays at 18 and zigbee2mqtt never updates the state.

I honestly can't check. It seems that on the device itself you can set it within the 0.5 limit. I don't have a test stand.

@loodvin
Copy link
Contributor Author

loodvin commented Jan 26, 2025

I'll test it tomorrow and write back

@loodvin
Copy link
Contributor Author

loodvin commented Jan 27, 2025

@srett I have the same as you, but I remember exactly that the accuracy of the device is within 0.5, so I made the changes.
Please check for yourself, I don't have access to my thermostat now.
Most likely, integers because
image

@srett
Copy link
Contributor

srett commented Jan 27, 2025

@loodvin yes, on the device it's .5 steps, but I remember even when I still used ZHA it could only do whole steps via zigbee, and when I researched it, someone somewhere said it's limited by the zigbee implementation of the device.
What I don't know if whether it could do .5 steps if you'd use the official Tuya hub and app.

Still, I'll dabble around in legacy.ts later today to see if it's possible to get this to do .5 somehow...

@srett
Copy link
Contributor

srett commented Jan 28, 2025

Indeed, it's sent as an int (4 bytes), so removing the Math.round call would break further down when calling convertDecimalValueTo4ByteHexArray as that one hilariously breaks when passed a non-integer value.
So this commit should be reverted, sadly no way to support .5 steps :-(

I wonder if it would make sense trying to catch these cases more generally to prevent accidents like this. For example removing the Math.round calls in call sites like the aforementioned moesS_thermostat_current_heating_setpoint and instead moving it directly into setDataPointValue, and printing a warning if the passed value was not integer already.
Of course this has to be done carefully, as some call sites might be actually handling float values and then call round for good reason, but many call sites, just like moesS_thermostat_current_heating_setpoint, seem to only call it as a safety measure in case their call sites improperly pass floating point values. @Koenkk any thoughts on this?

@loodvin
Copy link
Contributor Author

loodvin commented Jan 28, 2025

I completely agree. Yesterday I got errors with non-integer numbers.

loodvin added a commit to loodvin/zigbee-herdsman-converters that referenced this pull request Jan 28, 2025
description and analysis in Koenkk#8561
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants