Could anybody can help me in this:
I have 2 scripts:
device_on - Power on device, some action
device_off - Power off device, some action
I need to link that scripts with one switch.
switch:
switches:
some_switch:
turn_on:
service: script.device_on
turn_off:
service: script.device_off
I’m beginner and I’m sure that something is missing. Please help
Well, it’s not working like I need. Switch turns off after activating.
Can anyone tell me please what value_template I should use for that switch will not turning off?
You can use an input_boolean and start the scripts with an automation.
input_boolean:
amplituner:
name: Amplituner
inital: off
automation:
turn_amplituner_on:
trigger:
platform: state
enitity_id: amplituner
from: off
to: on
action:
service: script.turn_on
entity_id: script.amplituner_on
My overall goal is to have alexa run a tv script for on and one for off.
I’m having trouble with the formatting of the input boolean component. Am I correct in placing it in with the automations?
Below I have one of the automations that I already have working, I can’t get past the input boolean parsing block errors to add the new automation that I want to put in place for the script. I am using the code from the previous post just to get the formatting in order.
- alias: Morning Lights On
trigger:
platform: time
at: "05:00:00"
action:
service: switch.turn_on
entity_id: group.night_lights
input_boolean:
amplituner:
name: Amplituner
inital: off
- alias: amplituner_on
trigger:
platform: state
entity_id: input_boolean.amplituner
from: 'off'
to: 'on'
action:
service: script.turn_on
entity_id: script.device_off
It needs to go in it’s own file if you use separate files but with out the input_boolean: or in the configuration.yaml like you have it there, i.e. outside of the automation.
I reread and split up my configs and still could not get it to work…until…I realized that “initial” was misspelled and that is why I was not loading. Still not done making this work, but man that wasted some time… Thanks again for the help though, the end is in sight.