Trigger automation only when entity changed on HA GUI?

I have a two web hooks in Home Assistant. Another service on another server calls either of those webhooks to indicate a TRUE or FALSE condition.

I have a HA “helper” of type input_boolean that is designed to indicate that true/false status. I then have two HA automations that are triggered by those two webhooks, and set the input_boolean to true/false. All of this works fine.

It is possible to trigger that on/off state at the remote server using web hooks. I have created two rest commands in the configuration YAML that have those two URLS.

The task I want to achieve now is to call the relevant on/off remote server webhook when the user slides the input_boolean from one state to another in the HA GUI. The part I am not so sure about is how to perform the webhook call to the other server ONLY when the input_boolean changed via the HA GUI, and NOT via the webhook from the external server. I don’t want it to get into a never ending loop calling back and forth. Can I create an automation, with action, calling one of those webhooks, and with a trigger of the input_boolean changing, only via UI, not via the automation called via the webhook?

I know I could have another helper indicating the time of execution of the automation triggered via the webhook, that set the input_boolean, and then only trigger the rest command call if that was more than 10 seconds ago, but I am hoping there might be an attribute of the input_boolean that I could test for?

Thanks

1 Like