I’ve managed to create some toggle on and off switches (that run different scripts for on and off), but can’t seem to get the syntax right to simply activate/run a switch that doesn’t have an ‘off’ counterpart.
Yes, I’ve managed to do that to setup toggle switches where it runs different scripts for ‘on’ and ‘off’ commands. But in this this case I don’t want a toggle for on and off, just a way to activate/run a single script (I tired just adding an ‘on’ script like that without the ‘off’ part, but it showed 2 lightning bolt icons, one for on and one for off).
I guess it’s something really simple, just haven’t managed to get it right so far.
shell_command:
restart_disk_enclosure: /home/homeassistant/.homeassistant/scripts/restart-disk-enclosure.sh
script
run_the_script:
alias: Test the Script
sequence:
- service: shell_command.restart-disk-enclosure
Then tried these 2 under entities in a group in the default view
script.restart-disk-enclosure
script.shell_command.restart-disk-enclosure
One them causes Home Assistant to revert back to a default view (not the customised one I’ve created), and the other one doesn’t show at all in the group or Home view
I used the all in one installer, so hass --script check_config doesn’t work. I tried ‘homeassistant --script check_config’ but that didn’t work either.
I was logged into my default account (pi) and don’t even know how to log into the ‘homeassistant’ account, I don’t know what the password is
As I wrote previously, in this case where do I add the path to the script I want to run?
( /home/homeassistant/.homeassistant/scripts/restart-disk-enclosure.sh )
I’m guessing I don’t replace ‘YOUR_COMMANDLINE_SWITCH’ with the path to my script?
( /home/homeassistant/.homeassistant/scripts/restart-disk-enclosure.sh )