https://github.com/unrelatedlabs/java-wemo-bridge
It produces a nice web interface which shows all Wemo devices detected on the network as well as the status and allows for URL control.
Simple UI 'http://localhost:9700
'http://localhost:9700/devices
on 'http://localhost:9700/devices/{name}/on
off 'http://localhost:9700/devices/{name}/off
toggle 'http://localhost:9700/devices/{name}/toggle
Once you have this setup with your Wemo device and can successfully issue on / off commands all you need to do is setup a couple of events in HomeSeer that trigger when a virtual device you create for the wemo is set to on or off.
See in screenshot I have added a new device called wemoswitch1.
Then simply setup a couple of events one for when the device gets turned on and another for when its turned off. The events will run an immediate script which gets the wemobridge url to turn the device on or off.
Make the events look like this obviously changing from on to off as needed, make sure both events are "priority events".
The code for easy copy and pasting is:
&hs.GetURL("http://192.168.0.5:9700","/devices/wemoswitch1/on",TRUE,80)
Obviously once again edit to your own environment including the IP.
Once finished you can now control the wemo device within HomeSeer.
If you want the power state to update automatically here is a bash script that loops every 30 seconds to check the power state and update HomeSeer via JSON. Again edit as needed, the device ref, your IP, name of the device and username and password for curl to access HomeSeer.
I have the below script running automatically at boot to keep HomeSeer and the Wemo device in sync.
Please note that this guide is for technical users only, I will not be providing basic technical assistance nor am I responsible if you mess up your system.
#!/bin/bash
while [ 1 ]
do
# WemoSwitch1 Status Monitor
wemoswitch1=$(curl -s 'http://192.168.0.5:9700/devices/wemoswitch1/state' | cut -d ":" -f 2 | sed 's/}$//')
if [ "$wemoswitch1" = true ] ; then
echo "WemoSwitch1 Online"
curl -u USERNAME:PASSWORD "http://192.168.0.5/JSON?request=controldevicebylabel&ref=443&label=on"
else
echo "WemoSwitch1 Offline"
curl -u USERNAME:PASSWORD "http://192.168.0.5/JSON?request=controldevicebylabel&ref=443&label=off"
fi
sleep 30
done
If HomeSeer could please make an official lighting plugin for Belkin Wemo that would be awesome! The performance with my above method is excellent, I can't tell any delay between pressing on / off and the device going on or off. Also If I turn the device off manually via the button on the Wemo the status updates within HomeSeer within about 30 seconds.
Oh I should also mention that this meathod allows for local control of the wemo device without an internet connection. I purposely have my wemo's not allowed access to the internet.
Video demo of my setup:
https://youtu.be/tAKs-A3fMos
It produces a nice web interface which shows all Wemo devices detected on the network as well as the status and allows for URL control.
Simple UI 'http://localhost:9700
'http://localhost:9700/devices
on 'http://localhost:9700/devices/{name}/on
off 'http://localhost:9700/devices/{name}/off
toggle 'http://localhost:9700/devices/{name}/toggle
Once you have this setup with your Wemo device and can successfully issue on / off commands all you need to do is setup a couple of events in HomeSeer that trigger when a virtual device you create for the wemo is set to on or off.
See in screenshot I have added a new device called wemoswitch1.
Then simply setup a couple of events one for when the device gets turned on and another for when its turned off. The events will run an immediate script which gets the wemobridge url to turn the device on or off.
Make the events look like this obviously changing from on to off as needed, make sure both events are "priority events".
The code for easy copy and pasting is:
&hs.GetURL("http://192.168.0.5:9700","/devices/wemoswitch1/on",TRUE,80)
Obviously once again edit to your own environment including the IP.
Once finished you can now control the wemo device within HomeSeer.
If you want the power state to update automatically here is a bash script that loops every 30 seconds to check the power state and update HomeSeer via JSON. Again edit as needed, the device ref, your IP, name of the device and username and password for curl to access HomeSeer.
I have the below script running automatically at boot to keep HomeSeer and the Wemo device in sync.
Please note that this guide is for technical users only, I will not be providing basic technical assistance nor am I responsible if you mess up your system.
#!/bin/bash
while [ 1 ]
do
# WemoSwitch1 Status Monitor
wemoswitch1=$(curl -s 'http://192.168.0.5:9700/devices/wemoswitch1/state' | cut -d ":" -f 2 | sed 's/}$//')
if [ "$wemoswitch1" = true ] ; then
echo "WemoSwitch1 Online"
curl -u USERNAME:PASSWORD "http://192.168.0.5/JSON?request=controldevicebylabel&ref=443&label=on"
else
echo "WemoSwitch1 Offline"
curl -u USERNAME:PASSWORD "http://192.168.0.5/JSON?request=controldevicebylabel&ref=443&label=off"
fi
sleep 30
done
If HomeSeer could please make an official lighting plugin for Belkin Wemo that would be awesome! The performance with my above method is excellent, I can't tell any delay between pressing on / off and the device going on or off. Also If I turn the device off manually via the button on the Wemo the status updates within HomeSeer within about 30 seconds.
Oh I should also mention that this meathod allows for local control of the wemo device without an internet connection. I purposely have my wemo's not allowed access to the internet.
Video demo of my setup:
https://youtu.be/tAKs-A3fMos
Comment