Jump to content

Sonoff SNZB-02 temp/humidity sensor support requested


PatPend

Recommended Posts

@simplextech I installed the Hubitat nodeserver on Polyglot running on a Pi and successfully configured a number of devices and it works beautifully.  However today I paired a Sonoff SNZB-02 temperature & humidity sensor, enabled it it the Maker API, but the sensor is is not discovered by the nodeserver.   The full details of the device are:

{"name":"Sonoff Zigbee Temperature/Humidity Sensor","label":"Front Porch Temp/Hum ZB","type":"Sonoff Zigbee Temperature/Humidity Sensor","id":"6","date":"2021-12-12T18:53:23+0000","model":null,"manufacturer":null,"capabilities":["RelativeHumidityMeasurement","Configuration","Battery","TemperatureMeasurement","Sensor"],"attributes":{"humidity":"34","dataType":"NUMBER","values":null,"battery":"100","temperature":"47.21"},"commands":[{"command":"configure"}]}]

I get the gist of hubitat-poly.py and suspect the SNZB-02 falling through discover function but beyond that I am clueless how to proceed.  Any ideas how to get this device working?

Link to comment
Share on other sites

6 hours ago, PatPend said:

I get the gist of hubitat-poly.py and suspect the SNZB-02 falling through discover function but beyond that I am clueless how to proceed.  Any ideas how to get this device working?

I wasn't even aware anyone was still using this nodeserver.  With the information provided I can take a look and see what it will take to add support for that device.

Link to comment
Share on other sites

Hubitat nodeserver is awesome and gave my system a new lease on life.  It enabled the ISY to use HE as a secondary hub to expand ZWave coverage in my home and also add Zigbee to the mix as a bonus.  Thank you for sharing it & for taking a look at the SNZB-02.

Link to comment
Share on other sites

I applied the update via the nodeserver store and restarted.  The SNZB-02 appears in the node list, but in the node detail list all sensor values show as 0 (temp, hum, battery).  On the ISY side, the SNZB-02 does not appear.  I tried restarting the admin console and also rebooted both the ISY and Polyglot, with no difference.  As a side note, I'm curious why it was decided to create a new THSensor class for the SNZB-02 rather than use the existing MultiSensorTH class.

Here are the Maker API device details and how things looked in the Nodeserver and the ISY 

{"id":"6","name":"Sonoff Zigbee Temperature/Humidity Sensor","label":"Front Porch Temp/Hum ZB","type":"Sonoff Zigbee Temperature/Humidity Sensor","attributes":[{"name":"humidity","currentValue":36,"dataType":"NUMBER"},{"name":"battery","currentValue":100,"dataType":"NUMBER"},{"name":"temperature","currentValue":50.13,"dataType":"NUMBER"}],"capabilities":["RelativeHumidityMeasurement",{"attributes":[{"name":"humidity","dataType":null}]},"Configuration","Battery",{"attributes":[{"name":"battery","dataType":null}]},"TemperatureMeasurement",{"attributes":[{"name":"temperature","dataType":null}]},"Sensor"],"commands":["configure"]}

Polyglot.thumb.jpg.9398d5652de9dfe48f401bb63dd26dd4.jpg

663366136_Untitled2.jpeg.9610ba3a9fd09c5f5a7170437c17691d.jpeg

Lastly here an excerpt from the Polyglot UI log file, if you need me to use a different file and/or run particular tests let me know.

2021-12-14 07:56:26,008 NodeServer polyinterface      INFO     hubitat-poly:start: Started Hubitat
2021-12-14 07:56:26,009 NodeServer polyinterface      INFO     polyinterface:removeNotice: Sending removenotice to Polyglot for index {'key': 'HubitatNotice'}
2021-12-14 07:56:26,010 NodeServer polyinterface      INFO     polyinterface:saveCustomParams: Sending customParams to Polyglot.
2021-12-14 07:56:26,275 NodeServer polyinterface      INFO     polyinterface:addNode: Adding node Garage Driveway Floods ZW(1)
2021-12-14 07:56:26,276 NodeServer polyinterface      INFO     polyinterface:addNode: Adding node Old Master Bedroom Light ZW(4)
2021-12-14 07:56:26,278 NodeServer polyinterface      INFO     polyinterface:addNode: Adding node Old Master Bedroom Fan ZW(5)
2021-12-14 07:56:26,280 NodeServer polyinterface      INFO     polyinterface:addNode: Adding node Front Porch Temp/Hum ZB(6)
2021-12-14 07:56:26,282 NodeServer polyinterface      INFO     polyinterface:addNode: Adding node Guest Bath Vanity Lights(9)
2021-12-14 07:56:26,284 NodeServer polyinterface      INFO     polyinterface:addNode: Adding node Office Outlet(10)
2021-12-14 07:58:06,750 NodeServer polyinterface      INFO     polyinterface:reportDriver: Updating Driver 9 - ST: 100, uom: 78
2021-12-14 07:58:12,453 NodeServer polyinterface      INFO     polyinterface:reportDriver: Updating Driver 9 - ST: 0, uom: 78
2021-12-14 07:58:16,920 NodeServer polyinterface      INFO     polyinterface:reportDriver: Updating Driver 10 - ST: 100, uom: 78
2021-12-14 07:58:18,565 NodeServer polyinterface      INFO     polyinterface:reportDriver: Updating Driver 10 - ST: 0, uom: 78
2021-12-14 08:01:59,541 NodeServer polyinterface      INFO     polyinterface:reportDriver: Updating Driver 1 - ST: 100, uom: 78
2021-12-14 08:02:01,918 NodeServer polyinterface      INFO     polyinterface:reportDriver: Updating Driver 1 - ST: 0, uom: 78
2021-12-14 08:03:50,600 NodeServer lomond             WARNING  websocket:feed: disconnecting websocket
2021-12-14 08:03:50,607 NodeServer polyinterface      ERROR    polyinterface:write: Exception in thread NodeServer:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "./hubitat-poly.py", line 29, in start
    self.hubitat_events()
  File "./hubitat-poly.py", line 205, in hubitat_events
    m_node = self.nodes[_deviceId]
KeyError: '6'

    

 

Thanks, Russ

 

Link to comment
Share on other sites

3 hours ago, PatPend said:

As a side note, I'm curious why it was decided to create a new THSensor class for the SNZB-02 rather than use the existing MultiSensorTH class.

The MultiSensorTH is for a Motion Sensor with Temp/Humi capabilities.  I created the new class just for Temp/Humi devices.

Looks like the connection failed in processing the websocket data for the new device.  I'll have to look into that.

Link to comment
Share on other sites

3 hours ago, PatPend said:

I tried restarting the admin console and also rebooted both the ISY and Polyglot, with no difference.

Run 'discover' from the controller node.  It seems that it's partially finding the device but it didn't create it in the ISY and could be causing the update failure.

Link to comment
Share on other sites

On 12/14/2021 at 12:45 PM, simplextech said:

Run 'discover' from the controller node.  It seems that it's partially finding the device but it didn't create it in the ISY and could be causing the update failure.

Do you mean "Re-Discover" on the ISY...  ?  If you meant something else I apologize for misunderstanding.

873772965_isydiscover.thumb.jpeg.90b22030e9bd5d5cc814820c53b3f043.jpeg

 

Anyhow, I tried doing a Re-Discover and there was no noticeable change on the ISY or Polyglot. 

I also tried a different driver for the SNZB-02 that supports rounding the temperature and humidity values.   It provides some additional useful details shown below.  Interestingly the Hubitat nodeserver behaves exactly the same way with this driver, all values = 0 (I changed the node type in hubitat-poly.py to match the spelling in the 3rd party driver).  I plan on running this driver going forward but I can switch back the the built-in driver for troubleshooting if you prefer.  

{"id":"6","name":"Sonoff Zigbee Temperature/Humidity Sensor","label":"Front Porch Temp/Hum ZB","type":"Zigbee - Sonoff Temperature & Humidity Sensor","attributes":[{"name":"lastCheckin","currentValue":"2021-12-15 09:05:56","dataType":"DATE"},{"name":"batteryLastReplaced","currentValue":"2021-12-14 23:53:52","dataType":"STRING"},{"name":"temperature","currentValue":43,"dataType":"NUMBER"},{"name":"absoluteHumidity","currentValue":null,"dataType":"NUMBER"},{"name":"notPresentCounter","currentValue":0,"dataType":"NUMBER"},{"name":"pressure","currentValue":null,"dataType":"NUMBER"},{"name":"battery","currentValue":100,"dataType":"NUMBER"},{"name":"presence","currentValue":"present","dataType":"ENUM","values":["present","not present"]},{"name":"lastCheckinEpoch","currentValue":null,"dataType":"NUMBER"},{"name":"restoredCounter","currentValue":0,"dataType":"NUMBER"},{"name":"driver","currentValue":"v1.0.1.1123b","dataType":"STRING"},{"name":"humidity","currentValue":46,"dataType":"NUMBER"}],"capabilities":["RelativeHumidityMeasurement",{"attributes":[{"name":"humidity","dataType":null}]},"Refresh","Battery",{"attributes":[{"name":"battery","dataType":null}]},"PressureMeasurement",{"attributes":[{"name":"pressure","dataType":null}]},"Initialize","TemperatureMeasurement",{"attributes":[{"name":"temperature","dataType":null}]},"Sensor","PresenceSensor",{"attributes":[{"name":"presence","dataType":null}]}],"commands":["forceRecoveryMode","initialize","refresh","resetBatteryReplacedDate","resetRestoredCounter"]}

 

Link to comment
Share on other sites

Playing around some more, it turns out Virtual Devices don't get picked up by the ISY either :-(

 

 

{"id":"11","name":"Drinks & TV","label":"Drinks & TV","type":"Virtual Dimmer","attributes":[{"name":"level","currentValue":50,"dataType":"NUMBER"},{"name":"switch","currentValue":"off","dataType":"ENUM","values":["on","off"]}],"capabilities":["SwitchLevel",{"attributes":[{"name":"level","dataType":null}]},"Switch",{"attributes":[{"name":"switch","dataType":null}]},"Refresh"],"commands":["off","on","refresh","setLevel"]}
Link to comment
Share on other sites

4 hours ago, PatPend said:

Playing around some more, it turns out Virtual Devices don't get picked up by the ISY either :-(

 

 

{"id":"11","name":"Drinks & TV","label":"Drinks & TV","type":"Virtual Dimmer","attributes":[{"name":"level","currentValue":50,"dataType":"NUMBER"},{"name":"switch","currentValue":"off","dataType":"ENUM","values":["on","off"]}],"capabilities":["SwitchLevel",{"attributes":[{"name":"level","dataType":null}]},"Switch",{"attributes":[{"name":"switch","dataType":null}]},"Refresh"],"commands":["off","on","refresh","setLevel"]}

Not surprised.  I can't remember but I don't think virtual devices existed yet with Hubitat.  

I did push a small update that would catch the exception thrown from your last logs.  However I don't have enough information yet to try and figure out why the device isn't updating or being created in the ISY.  If you can update and let things run and send some logs that would be helpful.  This blind hunting is a reason why I've never added support for devices  or written nodeservers for devices that I don't have to physically verify and test with.

Link to comment
Share on other sites

11 hours ago, simplextech said:

This blind hunting is a reason why I've never added support for devices  or written nodeservers for devices that I don't have to physically verify and test with.

I'm happy to donate a SNZB-02 to your device collection if that helps.  You can keep it or trade it for a beverage if you like :-) - PM me your address and I'll send it asap.

BTW my hope for an HE virtual device is to be able include it in an ISY scene, then set up a rule in HE that triggers when the ISY scene changes to perform an action.  For example, change the on-level of a zwave dimmer on the HE network.

thanks, Russ

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...