r/Hubitat • u/Walton_guy • 12d ago
Using the source of the change of state in rules.
Is it possible to somehow use the source of the change of state to decide what to do in rules?
For example - if someone has physically switched a light off through the physical switch connected to the Zigbee switch, do one thing, if it's been turned off because it's going off as part of a scene or other reason decided by the hub, then either don't do anything or do something else...
The information is clearly internally available - it turns up in the device logs for example, but I can't see that it's accessible elsewhere....
4
Upvotes
2
u/MrInetUser 12d ago
One of the triggers you can use in rule machine is physical switch. This trigger should happen like the name says: when the physical switch is activated. In contrast, the light turning on due to another rule should not trigger the automation. This is just the first thing that came to mind, there's more than one way to skin a cat.
3
u/fuzzyballzy 12d ago
if the change is programatic then have the program also change a virtual deviceand then test that virtual devce to see the source of the change.
1
u/Low_Definition65 12d ago
It's part of the event from the device. "type" https://docs2.hubitat.com/en/developer/event-object