Hello dear community,
with the help of an workmate on my working place i have found the mistake.
This doesn´t work:
{
"id": "dream_7080",
"name": "DM7080",
"class": "ShellSwitch",
"onCommand": "curl --silent http://dm7080/web/powerstate=4",
"offCommand": "curl --silent http://dm7080/web/powerstate=5",
"getStateCommand": "if [[ $(curl -s http://dm7080/web/powerstate? |grep '<e2instandby>' | cut -f2 -d '>'| cut -f1 -d '<') = 'false' ]]; then echo on; else echo off; fi",
"interval": 1000
}
This works
{
"id": "dream_7080",
"name": "DM7080",
"class": "ShellSwitch",
"onCommand": "curl --silent http://dm7080/web/powerstate=4",
"offCommand": "curl --silent http://dm7080/web/powerstate=5",
"getStateCommand": "if [ $(curl -s http://dm7080/web/powerstate? |grep '<e2instandby>' | cut -f2 -d '>'| cut -f1 -d '<') = 'false' ]; then echo on; else echo off; fi",
"interval": 1000
}
The problem was the double [[ ]]…