OpenZWave / open-zwave

a C++ library to control Z-Wave Networks via a USB Z-Wave Controller.
http://www.openzwave.net/
GNU Lesser General Public License v3.0
1.05k stars 911 forks source link

CT101 Humidity sensor requires polling #2215

Closed aav7fl closed 4 years ago

aav7fl commented 4 years ago

Bug overview

There is an issue where the CT101 (<Product type="6501" id="c" name="CT101 Thermostat (Iris)">) requires polling to see any updates provided by the humidity sensor. This bug was briefly mentioned in https://github.com/OpenZWave/open-zwave/issues/1179#issue-214492788, but was overshadowed by the fact that the response object was invalid.

Documentation

Manual

On page 23 of the CT101 Manual.pdf, it states that Encapsulation is the only way to configure the thermostat to send humidity sensor multilevel association reports..

Configuration

There is also a configuration option to set the Humidity Reporting Threshold through configuration option #5 for the device.

Value Threshold
0 Function disabled
1 3% RH
2 (Default) 5% RH
3 10% RH

The PDF manual is missing the table, but the table values can be sourced from here: http://devel.pepper1.net/zwavedb/device/700

Troubleshooting

The CT 101 is a troubled device. For the better part of the last year or so, I thought the humidity sensor in my unit was bad. It wasn't until I noticed the value was being updated each time I restarted the network that I figured something was wrong with the device firmware.

In order to resolve this, I dug into the specs and configuration linked above to see if I could make any device corrections that would be breaking the sensor updates.

First I tried changing the configuration for the humidity reporting threshold. I updated and validated changing the humidity reporting threshold from its default value (2 or 5% RH) to 1 (3% RH).

After boiling a pot of water nearby and waiting 30 minutes, I found there were no multilevel sensor reports sent from the thermostat over the network. After manually polling against the sensor instance, a report was finally sent. The report showed the the RH% had increased by over 15% from its last known value, but the thermostat never sent a report unsolicited.

This conclusion led me to believe there is a bug in the firmware that prevents reports from being sent out unless manually polled. Given the issues this device had in #1179, I strongly believe this to be the case. It was also mentioned in the original post of #1179 that the humidity sensor required manual polling as well.

Attempted Solution

When I enable polling of the value I get an accurate up-to-date data of the humidity sensor. Otherwise the thermostat never sends any multilevel sensor reports (for the associated nodes). While I have manually changed the poll_intensity in the value entry in my ozwcache file from:

<Value type="decimal" genre="user" instance="3" index="5" label="Humidity" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="35">
    <Help>Humidity Sensor Value</Help>
</Value>

to

<Value type="decimal" genre="user" instance="3" index="5" label="Humidity" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="96" min="0" max="0" value="35">
    <Help>Humidity Sensor Value</Help>
</Value>

Clearly this isn't supposed to be modified since it will be overwritten, but doing so allowed me to receive updates from my humidity sensor in the unit.

Full _unchanged_ ozcache XML for CT 101 ```xml 1,128,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 64 1 true 5 2 true 1 Air Temperature Sensor Value Air Temperature Sensor Value Humidity Sensor Value 2 true 3 Set the Thermostat Mode 1 true 5 Set the Thermostat Operating State 0 2 true 1 Set the Thermostat Setpoint Heating 1 Set the Thermostat Setpoint Cooling 1 1 true 5 Set the Fan Mode 1 true 5 Set the Fan State 3 true 1 1 true 5 1 true 1 Revision of the Config file currently loaded Revision of the Config file on the File System Latest Revision of the Config file available for download Manufacturer Specific Device ID/Model Device Serial Number 1 true 5 Current Battery Level 1 true 5 Day of Week Hour Minute 1 true 5 1 true 5 Z-Wave Library Version Z-Wave Protocol Version Application Version 1 true 5 Current Indicator State ```

Logs

Conclusion

I would like to propose polling in enabled on this device for this sensor. Assuming this is the correct way forward, I would be happy to open a pull request, but I'm not sure if I should be approaching this by adding an entry to the CT101.xml file, or if I should be doing something else?

Fishwaldo commented 4 years ago

1st comment - Polling is Bad. :) - In reality - any device that has passed the Z-Wave Plus Certification should be able to provide "instant" updates via the Lifeline Association Groups (as indicated via the extract you provided above).

2nd comment - Enabling Polling is exposed to the Application via a API call as its very dependant upon the end user. We do not enable/disable polling via config files as its a "policy" (some users might want it, others dont). If you need to use polling, please consult whatever application you are using to enable/disable polling.

3rd - If the Instant Updates are not working, you may need to try enabling ForceInstances in the config file. See here and grep other config files for examples. (after changing the config file, you should call RefreshNodeInfo, or shutdown your app, remove zwcache_*.xml and restart). You should see in Association Group 1 (lifeline) a target node of 1.1 (if forceinstances was successful) instead of "1" (where 1 is your Controller NodeID)

If after trying the ForceInstances and you get 1.1 in the association group (and there are no other groups that might be applicable to the Humidity Reporting) then this is a device bug and needs to be reported to the vendor.

aav7fl commented 4 years ago

Thanks for your helpful response 🦸! I will follow up with testing your second third comment over the weekend.

aav7fl commented 4 years ago

I've enabled polling inside qt-openzwave. Given the mess off the outdated CT101, I have no hopes for any firmware fix to be rolled out. I'll just continue polling it for now.

Thanks!