I am trying to get my Wemo switch up and running through Domoticz. See the thread
viewtopic.php?f=17&t=4971&start=20for more explanation.
Because these are my first steps in scripting and running a script. I will try and explain my best.
- I go to a particular folder within my scripts folder in domoticz with
There are 2 scripts within this folder
Code: Select all
pi@raspberrypi:~/domoticz/scripts/wemo$ ls
wemo_off.sh wemo_on.sh
For example, the code within one of these scripts is the following:
Code: Select all
#!/bin/sh
sudo wemo switch "espresso" ON
When I run manually this script within the commandline, the script runs fine and when I check the status of my wemo switch it says that it is on. No problem here, everything works.
Code: Select all
pi@raspberrypi:~/domoticz/scripts/wemo$ ./wemo_on.sh
And then to check if the script worked, the status is confirmed as ON
Code: Select all
pi@raspberrypi:~/domoticz/scripts/wemo$ wemo -v switch "espresso" status
on
The point is that, when I make a virtual switch through Hardware --> create a virtual sensor and than add in the configuration of this virtual switch. That for the ON action the script wemo_on.sh has to be started and for the off action the wemo_off.sh script has to be started. And I save this configuration, the script does not work. Because my Wemo switch is not activated on or off.
The Domoticz log is recording some action, and it looks like the script is activated:
Code: Select all
2017-02-22 22:48:41.648 User: Admin initiated a switch command (61/Wemo/On)
2017-02-22 22:48:46.648 (Dummy1) Light/Switch (Wemo)
But again, the switch is not activated. What am I doing wrong? The script is working from the commandline, but not through the virtual switch.