hass-momentary
hass-momentary copied to clipboard
Momentary command line switch
Greetings;
I just came upon your momentary switch and have installed and configured it. However, I am not clear on how I actually make the switch trigger things.
My current setup is using various command lines in switches, but inclusion in momentary throws error messages.
For example, from my configuration.yaml:
- platform: momentary name: Increase + mode: on toggle_for: milliseconds: 500 command_on: !secret arizer_increase command_off: !secret arizer_light_off value_template: "{{ value | regex_search('ACTIVE', ignorecase=True) }}"
produces the following error:
Invalid config for [switch.momentary]: [command_on] is an invalid option for [switch.momentary]. Check: switch.momentary->command_on. (See ?, line ?).
There is no command_on
or command_off
option for the momentary switch, it's just a switch.
I you want to run commands you have to monitor the switch from an automation. See Configuration -> Automations -> Add
on the GUI.
Set up your trigger to act on a state change on the momentary switch and then run your actions. There are more docs here on automation.
Ok thanks. I'll try to figure something out along those lines.
There is no
command_on
orcommand_off
option for the momentary switch, it's just a switch.I you want to run commands you have to monitor the switch from an automation. See
Configuration -> Automations -> Add
on the GUI.Set up your trigger to act on a state change on the momentary switch and then run your actions. There are more docs here on automation.
What's a pity, I was also exactly in this case .... why not extend with "command: True" as option ?