![]() ![]() Just add before the “else” something like : This is a simple modification of rich’s script I found a simple -though ugly- way to get power consumption over a wemo insight switch You can download the updated script here: * There was a typo in GETFRIENDLYNAME you were actually using SetFriendlyName in the actual command and so were always setting the WeMo’s friendly name to “Pool Filter”. * GETSTATE will cause the shell script to exit with status code 0 if the wemo is off, or 1 if the wemo is on – useful for when this script is called from other scripts * commands no longer need to be entered in all uppercase ![]() * added an option so that you can force the port to use by specifying the IP address as “IP_ADDRESS:PORT” (e.g. For some reason, instead of returning a 404 when using an incorrect port, my WeMo would just sit there and not respond until curl eventually times out (this is possibly a change they made in a newer firmware?) I changed the call to curl to enforce a timeout of 1 second (if your wemo takes longer than that to respond, it’s probably seriously messed up) * auto detection of the port works much better now. Great script! I’ve modified it a bit, and have added some new features as well as fixed some bugs. I don’t write code for a living and there’s probably gross inefficiencies and poor syntax, but it WORKS. wemo_control IP_ADDRESS ON/OFF/GETSTATE/GETSIGNALSTRENGTH/GETFRIENDLYNAME and the functions are pretty self-explanatory. wemo_control IP_ADDRESS ON/OFF/GETSTATE/GETSIGNALSTRENGTH/GETFRIENDLYNAME”Ĭurl -0 -A ” -X POST -H ‘Accept: ‘ -H ‘Content-type: text/xml charset=”utf-8″‘ -H “SOAPACTION: \”urn:Belkin:service:basicevent:1#GetBinaryState\”" –data ‘1’ -s |Ĭopy/Paste or download here: wemo_control.sh wemo_control IP_ADDRESS ON/OFF/GETSTATE/GETSIGNALSTRENGTH/GETFRIENDLYNAME ![]() I like plain-old vanilla shell scripts that I can just run from any local machine, and I’ve hacked up various XML snippets I’ve found and just rely on curl for the following script that I put together: Numerous folks have written tools to control some of the functions of these, but everything I came across was dependent on other libraries, was incomplete, or didn’t work when I tested it. ![]() Fortunately, I could care less how the app experience is, since I only needed it to initially deploy the devices, and planned from the get-go to write my own code to control them. Clearly the issues they’re having getting the app side right are driving down the reviews. It’s their current apps that leave a LOT to be desired. Belkin has collected quite a few negative reviews for these devices, and it’s a shame, because the hardware seems real solid. You **have** to set them up with the app they supply for smartphones, but after that I hoped I could find a way to control them directly. If you choose to utilize Andy emulator as opposed to BlueStacks or if you are planning to install free WeMo for MAC, you can stick to the exact same method.It’s no surprise I’m a huge fan of home automation and tech toys, and I recently picked up a pair of Belkin WeMo’s. In case you don't discover the WeMo application in google playstore you could still download the APK from this webpage and install the application. Regular most android games and apps are eliminated from the google play store if they do not abide by Policies.
0 Comments
Leave a Reply. |