syepes
March 1, 2020, 7:39pm
1
Hello,
I am trying to build a condition that only executes the action if the device attribute is true
(Boolean), I have been trying to make this work for the past hour but either I am missing sometime or this is not supported.
Questions:
Is this supported?
Is this a driver attribute definition issue?
UI Issue:
This is the driver I am using:
capability "Sensor"
capability "Refresh"
capability "Configuration"
capability "Initialize"
command "clearState"
attribute "rainMeter", "number"
attribute "rainRate", "number"
attribute "rainTotal", "number"
attribute "rain", "enum", ["true","false"]
attribute "rainHeavy", "enum", ["true","false"]
fingerprint mfr:"0154", prod:"0004"
fingerprint deviceId: "17", inClusters: "0x5E, 0x31, 0x70, 0x85, 0x80, 0x84, 0x32, 0x7A, 0x5A, 0x59, 0x73, 0x86, 0x72"
}
preferences {
section { // General
input name: "logLevel", title: "Log Level", type: "enum", options: LOG_LEVELS, defaultValue: DEFAULT_LOG_LEVEL, required: false
input name: "logDescText", title: "Log Description Text", type: "bool", defaultValue: false, required: false
codahq
March 1, 2020, 8:41pm
2
Known limitation:
What device is this? How was the attribute "chime" defined? Chances are it was incorrectly defined as something that doesn't exist or maybe boolean isn't working. I couldn't find an example of it anywhere on a google 'site:github.com "hubitat" "bool" "attribute"' search.
I most often see attributes defined as type "string", "enum", or "number" but "bool" should work according to this.
https://docs.hubitat.com/index.php?title=Attribute_Object
You might want to use 1 or 0 or "true" or "false" or "some thing" and "something else" for now.
syepes
March 1, 2020, 10:37pm
3
@codahq
Thanks for the pointer!
Fix the issue by converting the driver to an enum
capability "Sensor"
capability "Refresh"
capability "Configuration"
capability "Initialize"
command "clearState"
attribute "rainMeter", "number"
attribute "rainRate", "number"
attribute "rainTotal", "number"
attribute "rain", "enum", ["true","false"]
attribute "rainHeavy", "enum", ["true","false"]
fingerprint mfr:"0154", prod:"0004"
fingerprint deviceId: "17", inClusters: "0x5E, 0x31, 0x70, 0x85, 0x80, 0x84, 0x32, 0x7A, 0x5A, 0x59, 0x73, 0x86, 0x72"
}
preferences {
section { // General
input name: "logLevel", title: "Log Level", type: "enum", options: LOG_LEVELS, defaultValue: DEFAULT_LOG_LEVEL, required: false
input name: "logDescText", title: "Log Description Text", type: "bool", defaultValue: false, required: false
1 Like
system
Closed
September 19, 2022, 7:11pm
4
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.