Closed mzealey closed 2 years ago
Mark Zealey skribis 2022-01-03 10:36 (-0800):
The (LSB of byte at offset 9 * 256) plus byte at offset 10 sometimes contains the heater thermostat actual temperature:
"sometimes"
Unfortunately, that's not useful for a program that doesn't run all the time to catch those rare occasions. My eq3-max project doesn't run in the background, and relies on the hardware to give the answers every time.
This diff makes it work for all my devices, I'm guessing it wouldn't hurt too much?
diff --git a/lib/Max.pm b/lib/Max.pm
index 0351e74..9b40f07 100644
--- a/lib/Max.pm
+++ b/lib/Max.pm
@@ -138,6 +138,8 @@ sub _process_L {
$temp |= !!($setpoint & 0x80) << 8;
$setpoint &= 0x7F;
+ $temp = $date if $temp == 0 and $date > 0 and $device->has_temperature;
+
$device->_set(
mode => $flags & 0x0003,
setpoint => $setpoint / 2,
diff --git a/lib/Max/Device.pm b/lib/Max/Device.pm
index 9ccb817..3cc2e12 100644
--- a/lib/Max/Device.pm
+++ b/lib/Max/Device.pm
@@ -69,7 +69,7 @@ sub flags_as_string {
sub is_cube { $_[0]->{type} == 0 }
sub has_valve { $_[0]->{type} == 1 or $_[0]->{type} == 2 }
-sub has_temperature { $_[0]->{type} == 3 }
+sub has_temperature { $_[0]->{type} >= 1 and $_[0]->{type} <= 3 }
sub has_setpoint { $_[0]->{type} >= 1 and $_[0]->{type} <= 3 }
sub room {
Mark Zealey skribis 2022-01-03 10:36 (-0800):
The (LSB of byte at offset 9 256) plus byte at offset 10 sometimes contains the heater thermostat actual temperature: "sometimes" Unfortunately, that's not useful for a program that doesn't run all the time to catch those rare occasions. My eq3-max project doesn't run in the background, and relies on the hardware to give the answers every* time.
So I think the "sometimes" here is not temporal so much as "some devices do this". But certainly it does come and go for each device as well.
It looks to me like the cube picks up the temperature reported by the trvs and then caches it for a while, if it didn't get an update for whatever reason then it goes back to zero after some time period.
Hm, that's interesting. I guess you're right, it wouldn't hurt. Would love a PR!
Fixed by #15
If I use http://www.dmitry-kazakov.de/ada/max_home_automation.htm I see the following:
But with eq3-max I only see:
It looks like I have the actual temperature values coming in the L: Date field instead, per https://github.com/Bouni/max-cube-protocol/blob/master/L-Message.md:
Not sure how this would be detected, but it's what's happening on all my devices.