Button (one command switch)

Is it possible to have a button (like a switch but with a single command)?

Possible, but not pretty.
Add an input_boolean.
Add an automation that triggers when Input_ oleander is switched to on.
Last step of the automation is to switch the input_boolean back to off.

I think we want (or at least I want) a remote control with buttons to fully controlling an AC or a TV with Broadlink or another IR gateway…

So a script? https://home-assistant.io/components/script/

~Cheers

You could get half way there by using scripts which would give you just “ACTIVATE” in the front end, how you’d change the visual appearance to a button I don’t know but wouldn’t assume it was that complicated if you knew what you were doing.

Other than that just set on and off to the same command and don’t worry that it looks like a toggle.

If you don’t care what it looks like you could just stay with a script imho.

~Cheers

I just did one of these, I used a template with the value_template set to false and no service call for turn_off:

    test_button:
      value_template: "false"
      turn_on:
        service: shell_command.start_vlc
      turn_off:
2 Likes

Can you tell me how looks the whole block of that button? I don’t know what platform I should use for that button.

Check this out:

@oliverdog, i did exactly this (first row TV, second AC), config in my repo
ControlPanel

3 Likes

wow, that’s so cool!

Platform: Switch

Fantastic!!!.. I will try it on weekend… thanks for sharing!!!

works also for Haps.io?

Not tested, but should work fine.