Domoticz-Enigma2 Status check

Moderator: leecollings

Post Reply
NoProfesor
Posts: 17
Joined: Wednesday 10 October 2018 21:46
Target OS: -
Domoticz version:
Contact:

Domoticz-Enigma2 Status check

Post by NoProfesor »

Who will help to write LUA or phython script based on bash that will check the status of the enigma2 decoder every 5 or 30 seconds?

Code: Select all

#!/bin/bash

	curl http://192.168.0.193/web/powerstate > /home/pi/domoticz/scripts/enigma2/powerstate_enigma2_living3.xml
	enigma2LivingStatus=`xmlstarlet sel -t -m '//e2instandby' -v . -n </home/pi/domoticz/scripts/enigma2/powerstate_enigma2_living3.xml`

	if [ $enigma2LivingStatus = "true" ]
	then
	curl 'http://192.168.0.193:8080/json.htm?type=command&param=switchlight&idx=13&switchcmd=Off'
    		echo "$enigma2LivingStatus"
    		echo enigma2 Living is in standby

	elif [ $enigma2LivingStatus = "false" ]
	then
	curl 'http://192.168.0.193:8080/json.htm?type=command&param=switchlight&idx=13&switchcmd=On'
    		echo "$enigma2LivingStatus"
    		echo enigma2 Living is not in standby

	else
	curl 'http://192.168.0.193:8080/json.htm?type=command&param=switchlight&idx=13&switchcmd=Off'
    		echo "$enigma2LivingStatus"
    		echo enigma2 Living is in standby
    		echo enigma2 Living not found

	fi
	
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest