Create a button to turn a switch on only, don't want the user to be able to turn it off

I have an ISY994i interfacing with Insteon Switches. I have a scene that shows up in Home Assistant as a switch, however I don’t want this scene to ever be turned off. I want to put a button in my dashboard that every time it is clicked it will turn this switch on and there is no way to turn it off.

I am sure someone out there has explained how to do this, but I sure can’t find it by searching. Any help figuring out how to do this would be appreciated!

Thanks,
John Vickers

Just change the tap_action to invoke switch.turn_on instead of switch.toggle.

Peter,

I don’t see turn_on as an option in either the link you provided or the drop down interface for available tap actions. Can you point me to an example where someone has done this recently?

Thanks,
John Vickers

  1. choose “Call Service” at Tap Action
  2. pick “switch: turn_on” at Service
  3. select whichever switch you want to turn on

Sorry, yes, what @M1ke said, @jgvicke. Unfortunately, you didn’t say which kind of button you’re using and whether you’re working through YAML or the UI so I couldn’t be more specific (I tend to configure most things via YAML).

In YAML, assuming the built-in Lovelace button card, something like this should work (untested):

type: button
name: Turn On Switch
tap_action:
  action: call-service
  service: switch.turn_on
  service_data:
    entity_id: switch.my_switch

If you work via the UI, you can set it up through there and then toggle to see the YAML and compare.

Ah, it works with the button card. I was first trying to get it working with the Entities card and it wasn’t working as expected. I can now make it work through both the interface and the code side. Thanks for the clarification.

Thanks,
John Vickers

1 Like