Decided not to not update the wiki, because I have never done that. Feels a little bit strange overwriting somebody else his/her work! Please find below what I used to get my Wemo Switch working.... I found the details for my working setup in
https://ouimeaux.readthedocs.io/en/late ... html#basic. I will post the steps starting from the beginning...
SSH to your Pi/Linux installation with Domotica installed and do:
1. Install Ouimeaux with
2. Ouimeaux requires Python header files to build some dependencies, and I do not know if these are already there on a Raspbian build, so therefore start with
Code: Select all
sudo apt-get install python-setuptools python-dev
3.Then, after everything is installed with a simple
you can see your active devices or do
to check status of your device.
4. Test your device by setting it on or off by
and of course here you replace the name "TV Room" with the name of you Wemo device. Also turn it back off again
5. Within Domoticz we now have to create a virtual switch, to create a virtual switch, you first have to create a virtual hardware device. Go to Setup > Hardware. Type in a name say Dummy1, choose 'Dummy (Does nothing, use for virtual switches only)' from the drop-down. Leave 'Data timeout' disabled. Click on 'Add'. Then go to the 'Switches' tab. Click the 'Manual Light/Switch' button in the upper left corner. Choose the dummy hardware from the drop-down. Enter a name ('WeMo Switch'). Switch type 'On/off'. Type 'X10'. For 'House code' and 'Unit code', choose some random, doesn't really matter. As 'Main Device'.
6.Next we will have to create some scripts to turn on and off your Wemo device. Do
Code: Select all
mkdir /home/pi/domoticz/scripts/wemo
to make a dir within the domoticz scripts "section" and next go to this dir
7. Create a on and off script with
and fill it with the correct code to contact your Wemo device you located earlier. Ofcourse change the "NAMEOFDEVICE" part with the name you found earlier
Code: Select all
#!/bin/sh
sudo wemo switch "NAMEOFDEVICE" ON
Save the script you just created with CTRL+O and close the nano editor CTRL+X
8. Do the same as for step 6 but now for a script with a different name
and code
Code: Select all
#!/bin/sh
sudo wemo switch "NAMEOFDEVICE" OFF
and also here, replace the part "NAMEOFYOURDEVICE" with the name of you specific Wemo device
9. Make the on/off scripts executable with
and
10. Then link the On/off scripts to the dummy switch on/off actions by pressing the edit button of the on/of switch you created at step 5 within domoticz
11. Add to the line "On Action:" the path to the script, in my case it is
Code: Select all
script:///home/pi/domoticz/scripts/wemo/wemo_on.sh
and for the "Off Action" add the path to the off script
Code: Select all
script:///home/pi/domoticz/scripts/wemo/wemo_off.sh
Please note that the path to the script HAS to start with
. Took me a long time to find this out
Now you should be able to control your Wemo device through a switch within domoticz!