Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Momentary command line switch #10

Open
SdeGeata opened this issue Nov 21, 2020 · 3 comments
Open

Momentary command line switch #10

SdeGeata opened this issue Nov 21, 2020 · 3 comments

Comments

@SdeGeata
Copy link

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 ?).

@twrecked
Copy link
Owner

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.

@SdeGeata
Copy link
Author

Ok thanks. I'll try to figure something out along those lines.

@SeByDocKy
Copy link

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.

What's a pity, I was also exactly in this case .... why not extend with "command: True" as option ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants