Have a few temp/humidity sensors dont report change unless there is an actual change. So in other words in my humidor there is a very stable humidity level. Graphing that value versus temperature causes me to loose the humidity since it didnt report a value due to no change. How do I make these devices report the value even if it has not changed?
I have tried pollster but for some reason it did not push those values out. It would refresh the sensor and the sensor was up to date in the app. But it would not post those values under its recent activity tab for them to then be exported by my simple event logger.
I’ve moved this to the webcore section of the forum because I’m pretty sure Webcore is the only way you’ll be able to do this.
There are many battery operated sensors which only report when there is a change in the value because that helps lengthen the battery life. And you don’t really want to change that because it will kill the batteries.
Instead, if it were me I would create a virtual sensor to mirror the physical sensor, do the reporting off of the virtual sensor, and keep the virtual sensor updated with the prior value if there has been no change.
That’s still pretty complicated, but I imagine the webcore experts could figure out how to do it.
If you’re unfamiliar with webcore, it’s a community created rules engine for smartthings which is very powerful. And also very popular. You don’t have to be a programmer yourself: there are lots of community members who will be glad to help you set up the necessary rules. They even have their own forum.
The other alternative would be to make some modification to whatever you are using to graph it to pick up the previous value if the current value is null, but you didn’t mention what you are using for the graphing step.
Understood on the battery life point, ideally I would like to report once every 6 hours or so which I imagine would not impact battery life that drastically.
I like the suggestion on the virtual sensor, is that a device I can find a published list already? Do not recall coming across one of those in my readings across the boards and in the app.
Webcore I think eventually is something that will solve this (and a number of other speedbumps) I currently have so will have to start reading up on it! Thanks for the link.
Which sensor and device handler are you using? There’s a good chance it is reporting the value, just not updating it since its the same. You can open live logging in the ide and see if it is communicating the reading every x minutes.
EDIT, seeing this work now in the ST side but with a “refresh” off the piston the sensor does not actually restate its unchanged value. What other method might I use to get its unchanged value expressed again to show in its recent activity tab?
The way my graphing works is that the simple event logger smartapp reads the data off sensors and pushes that to an excel sheet from where I graph that data.
You can edit the device handler to add displayed=true to have it post an event even if nothing changed. Is it using the SmartSense Temp/Humidity Sensor device handler?
See below for some options depending on whether you want it for just temp, just humidity, or both
EDIT: Placing the map.display outside of the if is probably a bad idea, since the if is trapping for a null map. If you want both temp and humidity to post each time, just use both places that are still in the code below.
def parse(String description) {
log.debug "description: $description"
// getEvent will handle temperature and humidity
Map map = zigbee.getEvent(description)
if (!map) {
Map descMap = zigbee.parseDescriptionAsMap(description)
if (descMap.clusterInt == 0x0001 && descMap.commandInt != 0x07 && descMap?.value) {
map = getBatteryResult(Integer.parseInt(descMap.value, 16))
} else if (descMap?.clusterInt == zigbee.TEMPERATURE_MEASUREMENT_CLUSTER && descMap.commandInt == 0x07) {
if (descMap.data[0] == "00") {
log.debug "TEMP REPORTING CONFIG RESPONSE: $descMap"
sendEvent(name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID])
} else {
log.warn "TEMP REPORTING CONFIG FAILED- error code: ${descMap.data[0]}"
}
}
} else if (map.name == "temperature") {
//Add here for temp
map.displayed=true
if (tempOffset) {
map.value = (int) map.value + (int) tempOffset
}
map.descriptionText = temperatureScale == 'C' ? '{{ device.displayName }} was {{ value }}°C' : '{{ device.displayName }} was {{ value }}°F'
map.translatable = true
} else if (map.name == "humidity") {
//Add here for humidity
map.displayed=true
if (humidityOffset) {
map.value = (int) map.value + (int) humidityOffset
}
}
log.debug "Parse returned $map"
return map ? createEvent(map) : [:]
}
You can grab the full code for the stock DH from the ST GitHub, and paste it in as a new device handler, or it might show up in the list if you create one from an example.
Thank you very much for all of this! Trying to read this to understand exactly the changes this implicates and my question is what the interval of that value reported would be at this point? With this script would it report its value constantly or is there some sort of trigger?
It currently only reports it if there has been a change as opposed to a set interval it seems. So in this new scenario what would be the trigger to initiate the report?
The sensor does report currently. It is set in the configuration when pairing to check in the temperature every 5 minutes max and humidity every 60 minutes max. Create and new device handler by model and make the changes outlined above.
Getting this error when trying to create a new device handler, any idea what I might be doing wrong?
“Org.springframework.security.access.AccessDeniedException: Run Locally Permission not allowed for DeviceType: 9074708a-f348-48e8-9407-f819d48f597f”
Also I am still intrigued by possibly using webcore for this, anyone have any insight into how a piston might accomplish a similar task? Looking for a data report every 6 hours or so even.
I don’t think webcore is a way to solve this. ST by default only posts the event to recent activity if there was a change. Getting webcore to query more will still hit that issue.