Automation Rule - differentiate between physical change and programmatic change

I am in the process of migrating from SmartThings with WebCore to Hass.io.
So far everything is working well, aside from my own difficulties with the learning curve.
Is there a way in automatons or in Node-Red (either one) to differentiate if a switch was turned on/off by a physical switch or pragmatically? I currently have a couple of automatons in WebCore that only trigger if the physical switch was turned on/off, I would like to do the same in Home Assistant.

1 Like

How did the other software know if the physical switch was turned on? What kind of feedback did it use?

I am not sure how it did it, but here is a snip of one of my WebCore routines that only fire if it was physically changed so that it doesn’t fire for any automations changing the state of the light.

you would either have to have some sort of feedback that the switch was physically operated that you could bring into HA or you’re going to need to do some funky stuff with input_booleans or something that will check to see if the switch state changed but not from a HA automation. But even that won’t fix the issue for when the switch is not operated physically or from an automation but instead thru the HA frontend.

I’m not sure how you can solve that problem without knowing more about your switch.