Button to toggle between 50% brightness and off

I’m looking for the easiest, newbie-friendly way of creating a custom: button-card to to toggle between 50% brightness and off. It is easy to toggle between on and off, and easy to create a button that turns on a light at 50%. Is there an easy way for one button to do both?

I have two dozen automations, some scenes, just one script and no templates so far, happy to learn more. I regularly program in python and javascript, not particularly well, and html and css.

You would do a tap action and call service light.toggle. You can then set the brightness % to 50% and it will do what you want. Mine looks something like this:

  tap_action:
    action: call-service
    service: light.toggle
    service_data:
      kelvin: 2700
      brightness_pct: 30
    target:
      entity_id: (put your entity ID here)
1 Like

Perfect! Worked first time! Thank you!

1 Like