Device status information in an expression


#1

I’m trying to figure out how to return specific device details in a notification from webCoRe. For example, I want a notification with the text “motion sensor [name] is [status]” (where status is active/inactive)…

I want to do this for a handful of devices, but I can’t seem to figure out how to get access to device information within an expression. I have found the variables $device and $state and I’ve seen in the docs that you simply use [device_name] to access the device, but I don’t quite understand how these fit together, or if I’m missing something entirely.


Convert UTC / Epoch Time to Human Time
#2

Like this???

Here’s what it looks like in my notification feed. …

You_Doodle_2018-02-14T11_22_37Z


#3

You can also reference all (including custom) attributes by inserting this into a message field:

{([ device name : attribute name ])}

You can also build in expressions such as:

{age([ front door : contact ])}

Which will return how long the front door contact has been in it’s current open/closed state.


#4

Sort of, I was able to find this information since it’s just accessing devices already referenced in your trigger… I was looking specifically for how to access a device and attribute by name, which now seems to have been answered


#5

Awesome! This is exactly what I was looking for. Thank you! I couldn’t seem to find this info in the docs.