I'm extending my bedtime event by checking the states of various devices, since I don't want the lights to go off in the middle of a movie. Now, checking the state of XBMC is easy by using this addon. This addon triggers a virtual switch in Domoticz called XBMC and this state is checked in my "bedtime" event.
Besides XBMC, we also have a Dreambox. I've done some research on how to check whether the Dreambox is on and I've come up with the following:
Via wget -N http://USER:[email protected]/web/powerstate or curl http://USER:[email protected]/web/powerstate I am able to generate an XML file with the current status of the box, for example:
<?xml version="1.0" encoding="UTF-8"?>
<e2powerstate>
<e2instandby> true </e2instandby>
</e2powerstate>
Now, using
Code: Select all
find powerstate | xargs grep 'false' -sl
2 problems:
- How do I write this in a lua script so that it triggers my virtual switch "Dreambox"
- Is there a better way of doing this instead of using 1 command to create a file and another to search for files with "true" or "false" in them? Maybe I can interact with the http://USER:[email protected]/web/powerstate directly and grab the standby status directly in lua? Or maybe via a XML parser like luaxml ?
Thanks!