Attribute as a Global Variable

My IP cams show up in Hubitat as motion sensors which have ā€œattributesā€ such as objects detected (e.g. ā€œpersonā€, ā€œtruckā€, ā€œdogā€ etc.).
Iā€™d like to get Pushover notifications (which currently works when the IP cam detects motion) but would like to add the attribute (specifically the object detected) into the notification.

The Pushover Notifications app allows for including Global Variables in the notification. Does anyone know how to get the Attributes of a sensor to show up as a Global Variable? TIA from a relative newbie!

Easiest way would seem to be to create a rule that is triggered by the attribute change and have it store the new value in a global variable.

Thanks thebearmay for your suggestions and help!

One problem I am running into is that my IP cams retain the last Object identified as an attribute so if a ā€œpersonā€ has been previously detected, and is detected again, no change will occur in the attribute so a change in attribute cannot be used as a trigger. Although Iā€™m new to all this, I can figure out another trigger to use (perhaps the motion detection itself). However, I canā€™t figure out how to get the last attribute value into my Global Variable ā€œObjectā€. I can set the value but I want the Global Variable to reflect the current value of the ā€œobject attributeā€ in the IP cam. Also, since I have several IP cams, it seems that I would have to set up a Global Variable for each camera? Thanks for your help and TIA to anyone else that can chime in as well.

Motion should work.

image

I called my Global Variable objectAttrib so:

image

At this point you can select the device and attribute.

Easiest would be to set up one Global per camera, but with a little extra effort you may be able to append or prepend a camera name.

1 Like

@thebearmay,
Thank you so much for your selfless help! Got everything working and learned a lot in the process after spinning my wheels for several hours before your instructions. I set up one RM4.1 rule that automatically sets the object attribute as the variable value in each global variable (one global variable for each of my IP cams). Thank you for taking the trouble to help me out. Much appreciated!

1 Like

Just paying it forward, lot of good people on here helped me early on (and actually still help me); seems like a good way to thank them for their efforts.

1 Like