Hi!
I’ve read (extensively I thought…) the forum to figure out how to create a button on my overview UI which would trigger a script that powers on (2 minutes) and off (15 seconds) a plug, as long as the button is on.
I am facing a few issues (which could all be related):
- adding the script in my scripts.yaml seemed not to work and Lovelace tells me there is no such script
- adding it to configuration.yaml instead somewhat does the same as Lovelace says entity not available
So here is what I added:
usbpi_test:
alias: Test the USB Key on a Pi
sequence:
- service: switch.turn_on
data:
entity_id: switch.plug
- delay:
minutes: 2 # time for Pi to start properly
- service: switch.turn_off
data:
entity_id: switch.plug
- service: script.turn_on
data:
entity_id: script.usbpi_test_loop
usbpi_test_loop:
alias: USB key test - Loop
sequence:
- delay:
seconds: 15 # time to leave the Pi off
- service: script.turn_on
data:
entity_id: script.usbpi_test
(also had identations issues but those seems to be resolved).
Now hassio is giving me this error:
Invalid config for [script]: expected dictionary for dictionary value @ data[‘script’]. Got [OrderedDict([(‘alias’, ‘Test the USB Key on a Pi’), (‘usbpi_test’, None), (‘sequence’, [OrderedDict([(‘service’, ‘switch.turn_on’), (‘data’, None), (‘entity_id’, ‘switch.plug’)]), OrderedDict([(‘delay’, OrderedDict([(‘minutes’, 2)]))]), OrderedDict([(‘service’, ‘switch.turn_off’), (‘data’, OrderedDict([(‘entity_id’, ‘switch.plug’)]))]), OrderedDict([(‘service’, ‘script.turn_on’), (‘data’, OrderedDict([(‘entity_id’, ‘script.usbpi_test_loop’)]))])])]), OrderedDict([(‘alias’, 'USB key test - Lo…(See /config/configuration.yaml, line 32). Invalid config for [automation]: Invalid time specified: 120 @ data[‘trigger’][0][‘at’][0]. Got None. (See /config/configuration.yaml, line 28).
Any idea what I am missing?
Thank you.
Fred