-
-
Notifications
You must be signed in to change notification settings - Fork 911
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
Thermostat setpoint - can only set integer values with Qubino ZMNHID1 #776
Comments
Can you provide logs please? |
Sure, I want to get this to work. Problem is that there is no trace relative to this issue in OZW_log.txt. Here is the content of options.xml, so that you may tell me what to adjust if needed: <?xml version="1.0" encoding="utf-8"?>
<!-- To be effective, this file should be placed in the user data folder specified in the Options::Create method -->
<Options xmlns='http://code.google.com/p/open-zwave/'>
<Option name="logging" value="true" />
<Option name="Associate" value="true" />
<Option name="NotifyTransactions" value="false" />
<Option name="DriverMaxAttempts" value="5" />
<Option name="SaveConfiguration" value="true" />
<!-- <Option name="RetryTimeout" value="40000" /> -->
<!-- If you are using any Security Devices, you MUST set a network Key -->
<!-- <Option name="NetworkKey" value="0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10" /> -->
<!-- Some Devices have a big UserCode Table, that can mean startup times
when refreshing Session Variables is very long (Especialy on Security
Devices) This option will make the UserCode CC stop on the first
"available" usercode slot rather than retrieve every one -->
<Option name="RefreshAllUserCodes" value="false" />
<Option name="ThreadTerminateTimeout" value="5000" />
</Options> Let me add that this is using OpenZWave 1.4-34-gb426e49 static-linked to the current domoticz beta's. Regards, |
I believe you have to make a adjustment to Domoticz to enable OZW logging. You would have to ask them, as I don't know how. |
Here we go, below is the log file showing the issue:
2016-02-18 19:56:24.572 Info, Node007, Value::Set - COMMAND_CLASS_THERMOSTAT_SETPOINT - Heating 1 - 1 - 1 - 22.5
2016-02-18 19:56:34.724 Info, Node007, Received thermostat setpoint report: Setpoint Heating 1 = 49C This corresponds exactly to the behaviour described in my 1st post above. There is a strange side effect to this problem: the setpoints for either this thermostat or the others, randomly change unit from C to F, with a decimal place. You may see that at line 3121: the setpoint of node 008 was 22C, it is now... 22.0F ! Let me know how I may help. |
Justin, Did you find time to look into the log? Regards, |
I will soon. Sorry, been on a rather insane travel schedule these few weeks. |
Hello Justin, Worry not, I'm also quite overloaded these days. |
Hello Justin, Trying to get this moving, I have investigated the observed behaviour vs. the code, and done some googling on the thermostat setpoint data frame (which doesn't return much anyway). What is the reasoning behind this line in ThermostatSetpoint.cpp/bool hermostatSetpoint::HandleMsg():
Is this assuming that if scale is not null, then the setpoint is in F, a ZW-standard conformant behaviour? Regards, |
Unlikely to be a bug… scale is decoded from the packet sent by the device….. From: Stéphane Guillard [email protected] Hello Justin, Trying to get this moving, I have investigated the observed behaviour vs. the code, and done some googling on the thermostat setpoint data frame (which doesn't return much anyway). What is the reasoning behind this line in ThermostatSetpoint.cpp/bool hermostatSetpoint::HandleMsg() Is this assuming that if we get a scale, then the setpoint is in F? I tend to think this is wrong from my experiments with the Qubino. — |
Hello Justin, There is definately something wrong. When I change any of my 4 Qubino's setpoints using the OZW control panel, even to an integer °C value, they randomly (but frequently) return an aberrant decimal °F value. Example like in my top post: I switch from 19 to 20C; the module returns -6.8F. It is very difficult to diagnose on my house system, as when it occurs, it takes a lot of delete zwcfg/reboot cycles before they all revert to °C setpoints, meanwhile the house heating behaves randomly. So I have bought a spare Zstick and a spare Qubino thermostat, which I will set up as a troubleshooting platform. I will let you know when I have found something. Regards, |
Hello Justin, Another try:
0x01 0x0E 0x00 0x04 0x00 0x08 0x08 0xx43 0x03 0x01 0x34 0x00 0x00 0x00 0xDC 0x5C I have manually traced it through ReadMsg() -> ProcessMsg() -> HandleApplicationCommandHandlerRequest() -> ApplicationCommandHandler() -> ThermostatSetpoint.cpp/HandleMsg() -> CommandClass.cpp/ExtractValue() And this is where there seems to be something wrong:
uint8 _valueOffset // = 1 Note the // = 1 comment. As far as I can see, _valueOffset is used without being initialized, since ThermostatSetpoint.cpp/HandleMsg() calls ExtractValue() with only 3 parameters :
and _valueOffset is the 4th parameter of ExtractValue() prototype : string CommandClass::ExtractValue Thus these lines from ExtractValue() can't work if they assume _valueOffset to be 1 while this variable hasn't been set:
Which would pretty much explain why I get random thermostat setpoint report values? Regards, |
Check the prototype in the header file. That's where the default value is set if it's not passed. |
Hello Justin, All right, as a primarily C coder, I'm not so much used to not feeding all parameters to functions and relying on const presets for others. I checked the prototype and indeed the default is 1. But I went on manually decoding my frame. ExtractValue() receives 0x34 0x00 0x00 0x00 0xDC, which turns out to be:
Problem is that as scale is 2 (and not 0), ThermostatSetpoint.cpp/HandleMsg() assumes that this value is in F and not in C, which is obviously wrong in our case. This is the issue I was suspecting in an earlier post above. I've googled and found similar issues with other thermostats and other zwave stacks (zwave.me seems to have similar issues). So I guess that the assumption value->SetUnits( scale ? "F" : "C" ) in ThermostatSetpoint.cpp/HandleMsg() doesn't [always] work; at least for the Qubino it doesn't. Is there a reference documentation somewhere as to how to interpret the scale value? in which case, what does '2' mean? For the record, here is what I found at https://community.smartthings.com/t/integration-of-z-wave-danfoss-thermostat/23310/12 :
This one would give me C rather than F with my scale == 2 :) Regards and thank you for your continued/appreciated support, |
Hooray! I build an OZW+domoticz with just the change below in ThermostatSetpoint.cpp:
changed to:
And this not only removes all those nasty C to F + aberrant setpoint value issues, But also, allows me to input and set decimal setpoints like 20.1! and it just works. There is still one (minor) issue, which I'll be running after now: in OZWCP, in order to set 20.1, I have to enter 20.10 otherwise the input value is rounded to 20. Justin, could you hint me where to look at? (I suspect wrong decimal or precision encoding or precision in ozw). Regards, |
Okay I've also found the cause for this last one. When entering a setpoint with one decimal place, like 22.5, OZW rightly turns that into an integer (225) and a 'precision' field of 1, telling the receiving thermostat that the last 1 digit in the integer is decimal part. Then OZW rightly checks that 225 as an integer can be transmitted with a single byte, so size == 1. Problem, the Qubino explicitly requires 2 bytes for setpoints : http://doc.eedomus.com/files/Qubino_Flush_on_off_thermostat-PLUS_user-manual_V1.1_eng-3.pdf says:
So we have a case where:
Which I temporarily hack-fixed in CommandClass.cpp/ValueToInteger() by changing:
to:
This works fine, from domoticz and from OZWCP I can now successfully set any 1-decimal place setpoint like 22.2, 19.3 etc. Of course it can't stay that way. I will ask Qubino why their module ignores 1-byte value setpoints. Justin, what is your take on this? Regards, |
For the Scale Issue - There is no Value Defined for 2. Its only 0 - F and 1 - C. I suspect a Encoding Error here when Qubino send the message (they send 0b10 rather than 0b01 for C) - A few other vendors have got this messed up. I'll add a workaround for that soon. (#819) For the Precision Problem - This is a bug from the device. If they want 2 decimal places, they should set precision to 2. Again, another work around is required. (#820) |
Hello Justin, Glad you finally found time to catch up:) For the C/F issue, may I suggest to keep it simple and just apply the following change to ThermostatSetpoint.cpp:
changed to:
This fixes the issue with ZMNHID1, while leaving the spec-conformant modules unaffected; this is the solution applied in other ZWave stacks. For the precision/encoding issue, I dare disagree :) the problem is not an issue with precision/decimal places (ZMNHID1 accepts 0, 1 or 2 decimal places), but rather in the fact that ZMNHID1 requires at least 2 bytes when there is at least 1 decimal place for the equivalent integer value, even when the value can be encoded with 1 byte. Examples:
So what we have is OZW encoding with a single byte all values with an integer equivalent below or equal 255, regardless of precision. But ZMNHID1 rejects single byte setpoints except when precision == 0. Why is beyond me but thats how it works. So the workaround I implemented is to force OZW to encode with 2 or 4 bytes (but not 1) when precision >= 1. This works, but cannot stay since it doesn't make much sense to generalize such a limitation just for the ZMNHID1... Bottom line, I don't know a smart way to fix this, except maybe to create an exception list in OZW, which would for instance forbid 1 byte value encoding when talking to a ZMNHID1 thermostat... Regards, |
Try putting:
|
looking at your decode above, its a truely messed up device. I thought maybe we could store the size param we receive from the device, and use that that when sending a value, but they send as 4 bytes with precision of 1, and then expect a 2 byte set message....
|
btw, the override_precision is going to mess up your REPORT messages, but it should fix the SET messages. if that works out, then I can put in a config option for these fubar devices and go from there |
@stephaneguillard do you wrote a device xml file for the module? |
Hello Justin, The problem does not lie in OZW, but in the fact that the module doesn't accept 1-byte encoding, regardless of precision. As said already, any setpoint, regardless of precision, which integer equivalent value is <=256, will be encoded as a single byte value by OZW. This is perfectly valid, but the Qubino will ignore the setpoint message. What I did for my workaround patch is not to tweak precision, but to force OZW to send 2 bytes even when the integer value is <=256. I have no idea how to handle this adequately, other than ask qubino to fix their firmware, which wont happen... At least you could patch the °C/°K issue in the way I suggested, as this works and is harmless for other appliances. nchery: I have made a working XML file for this device. I don't remember if I commited it to OZW github; as a matter of fact, it doesn't seem to be in the config/qubino directory... |
when will this change be incorporated to a OZwave update? in ThermostatSetpoint.cpp file. |
@stephaneguillard Did you do any testing with my suggestion above? if you can try that, and post the log file, I know how to add this fix to OZW via a Config option.... until then... Regarding precision - As I already pointed out, I will take a different approach. (I have been told that Z-Wave supports reporting in kelvin's - although I've never seen a device do/need kelvins...) The correct fix is to put in a config option that says these devices send the scale as a bitmap rather than a byte (or visa versa) As for when: |
Hello,
Using OZW control panel:
http://s.guillard.free.fr/Domoticz/22.jpg
http://s.guillard.free.fr/Domoticz/22.5.jpg
Here the setpoint was 22; I input '22.5', and the new setpoint is now 49
All of my 4 Qubino ZMNHID1 behave the same.
I have looked into the OpenZWave config file, and "Heating 1" is defined as "decimal":
The ZMNHID1 documentation states (exact text copied below):
"
COMMAND_CLASS_THERMOSTAT_SETPOINT
The [...] thermostat supports temperature setpoint, which is 2 bytes long, scale is °C and precision is 1 (it means 0.1°C)
"
Is the bug in OZW, or in the ZMNHID1 ?
Regards,
Stéphane
The text was updated successfully, but these errors were encountered: