Thank you guys, I’ve updated the code above to include the changes to get the Humidity into the tiles as well.
The 0x30:3 is just a left over of the original code I found to handle the event; I’m quite sure you can remove it without ill effects.
The way to identify a specific device or manufacturer is to use the manufacturerSpecificGet() command and check the resulting ManufacturerSpecificReport.
@Rboy, are you sure about this? I tried changing mine to this, and the humidity value doesn’t update. I changed it back to:
And it started working again. Just a letting you know what I’m seeing.
Are you sure it’s supposed to be 2 and not 3?
0x31 is sensorMultilevel; and the code handles V3; so, from what I can understand, you want to use 0x31:3 - which is what I’m using.
0x30 is definitely not required, see this from the command class:
Sensor Binary 0x30 V1 V2
Sensor Multilevel 0x31 V1 V2 V3 V4 V5
We only need 0x31. There are 5 versions, by default ST uses V3 but CT-100 uses V2 for reporting Humidity hence I changed this to 2, this is what is working for me (I’ve also update the code above)
def zwaveEvent(physicalgraph.zwave.commands.multiinstancev1.MultiInstanceCmdEncap cmd) {
def encapsulatedCommand = cmd.encapsulatedCommand([0x31: 2])
log.debug ("multiinstancev1.MultiInstanceCmdEncap: command from instance ${cmd.instance}: ${encapsulatedCommand}")
if (encapsulatedCommand) {
return zwaveEvent(encapsulatedCommand)
}
}
Make sure you publish/refresh and then restart your app (kill and restart).
0x31:3 should also work without issue, I was just being compliant to the CT-100 docs
Also note that it takes time to update upto 24 hours to get the info.
That depends how frequently you poll the thermostat; as the CT100 is very lazy pushing back changes of its own initiative, I actually explicitly poll it every few minutes; I get an updated HR reading every time.
I’ve been facing an issue since yesterday, while battery value is being returned from the device the map command doesn’t seem to be working. this is JUST for battery (humidity, temperature etc are working).
def zwaveEvent(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) {
def nowTime = new Date().time
state.lastBatteryGet = nowTime
def map = [ name: "battery", unit: "%" ]
log.debug "Battery level $cmd.batteryLevel%"
if (cmd.batteryLevel == 0xFF || cmd.batteryLevel == 0) {
map.value = 1
map.descriptionText = "battery is low!"
sendEvent(name: "BatteryLevel", value: "battery is low!")
} else {
map.value = cmd.batteryLevel
sendEvent(name: "BatteryLevel", value: "battery is $cmd.batteryLevel%")
}
map
}
This was working fine till the day before (no change in code).
2 things aren’t happening:
- The sendEvent is not working, there is notification in the activity log
- The tile is not updating (the map command is not working)
the log.debug is working fine, the rest of the parameters are working fine (both sendevent and tile updates).
@minollo are you seeing this also?
@duncan, @bflorian - are there any issues with the platform in the past 48 hours which is preventing battery map updates and sendevent messages from posting?
See the log below, you’ll see the info returned from the device. The debug also works, but the map command isn’t working and the sendevent isn’t either (I don’t see this in the device activity)
c45dc2e0-2f12-48ba-89ab-2cb845a687a1 11:16:22 PM: debug Parse returned [[name:battery, unit:%, value:100, isStateChange:false, displayed:false, linkText:Basement Thermostat, descriptionText:Basement Thermostat battery is 100%]]
c45dc2e0-2f12-48ba-89ab-2cb845a687a1 11:16:22 PM: debug Battery level 100%
Something with the platform is broken, if I change
map.value = cmd.batteryLevel
to:
map.value = 12
It starts working, If I revert back it stops and again only for battery!
For what it’s worth, my battery readings have worked properly this night. Maybe a hiccup? As you know, I use a somewhat simpler event handler though.
That’s pretty weird. Try
map.value = cmd.batteryLevel as Integer
Are you checking the full “from device” events list that includes the ones that are hidden because they aren’t state changes?
Okay this is VERY wierd. I have 3 thermostats running of the same device type. I made the change as you suggested.
First it only worked with 1 one device. Then after 2 refreshes it worked with the second device (first refresh didn’t work). then finally after a few more refreshes it worked with the 3rd device. I’ll monitor it.
But can you help me understand 2 things:
- Why is the code map.value = cmd.batteryLevel working for everything EXCEPT battery, possibly why it stopped working 2 days ago without this explicit typecast
- Interestingly what’s the corelation between the typecast and the sendEvent? Before this typecast even the sendEvent didn’t work, after the typecast it started working.
I’m sorry but I didn’t understand your reference to full from device. What is that? The code I"m using is exactly as I have posted in my post above. thanks @duncan
BTW the handler is being called because the log.debug line is being printed, just the that map command and sendEvent functions were not being processed without the typecast
@duncan This has stopped working completely, just the battery (humidity mapping and other mappings are working just battery isn’t).
Can you please help me understand what you meant by
“Are you checking the full “from device” events list that includes the ones that are hidden because they aren’t state changes?”
What should I be looking at?
Also just to confirm, can one call sendEvent from a zWaveEvent, because that used to work earlier but no longer works now.
thanks
I added this line
map.isStateChange = true
and it started working. @duncan any idea why and what this line does and if there’s any downside to it?
FWIW… I don’t see any problem with battery reporting on my thermostats…
hah! now I’m truly lost, how come it works for one and not another user, same code, same device, same platform.
@RBoy I just meant if you don’t click here you won’t see the battery events except when the percentage has changed (which is what isStateChange tracks):
You shouldn’t call sendEvent from an event handler, you should use createEvent to set all the required parameters and then return the event object from the zwaveEvent method and then the parse method.
