hi! i created a device and in general it works. my platform is a raspberry pi 3 and the actual pimatic version. i wanted to create a switch to (de-) activate ssh. in genral it works, but when creating the device i get an error message:
error [pimatic-shell-execute]: [ShellSwitch#enable-ssh] Error: Command failed: /bin/sh -c if [sudo raspi-config nonint get_ssh 1] then echo 0 else echo 1
/bin/sh: 1: Syntax error: end of file unexpected (expecting “then”)
when i use the switch everything works as expected - no error messages. the error is just at the beginning. how can i eliminate it? i thing it’s just a matter of quoting…
plugin-configuration
{
"plugin": "shell-execute",
"active": true
}
device configuration
{
"onCommand": "sudo raspi-config nonint do_ssh 0",
"offCommand": "sudo raspi-config nonint do_ssh 1",
"getStateCommand": "if [sudo raspi-config nonint get_ssh 1] then echo 0 else echo 1",
"interval": 1000,
"id": "enable-ssh",
"name": "Enable SSH",
"class": "ShellSwitch"
}