Page 2 of 2

Re: Checking Dreambox state

Posted: Tuesday 07 October 2014 9:46
by Morcegolas
Sure, here they are:
ImageUploadedByTapatalk1412667978.382946.jpg
ImageUploadedByTapatalk1412667978.382946.jpg (116.07 KiB) Viewed 5588 times
ImageUploadedByTapatalk1412667964.767919.jpg
ImageUploadedByTapatalk1412667964.767919.jpg (123.53 KiB) Viewed 5588 times
ImageUploadedByTapatalk1412667944.335060.jpg
ImageUploadedByTapatalk1412667944.335060.jpg (112.23 KiB) Viewed 5588 times

Re: Checking Dreambox state

Posted: Tuesday 07 October 2014 11:09
by D'rMorris
That's the python folder :-). Now the contents of the Screens subfolder please ;-).

Re: Checking Dreambox state

Posted: Tuesday 07 October 2014 12:35
by Morcegolas
ImageUploadedByTapatalk1412678116.196390.jpg
ImageUploadedByTapatalk1412678116.196390.jpg (135.74 KiB) Viewed 5577 times
Sorry. ;)

Re: Checking Dreambox state

Posted: Saturday 21 February 2015 0:06
by kabouter
I think I found an better way to do this.
Just create an dummy...
Just use http://dreambox_ipaddress/web/powerstate?newstate=4 for the on action.
and use http://dreambox_ipaddress/web/powerstate?newstate=5 for the standby action.
You can use this on every linux machine. e.q. as Dreambox or Vuduo etc.

Re: Checking Dreambox state

Posted: Sunday 01 March 2015 1:55
by free_nsc
Alternatively, to check current Enigma 2 status ie if it's in Standby , send:
http://e2ipaddress/web/powerstate?=

it will return:

Code: Select all

<e2powerstate>
<e2instandby>true</e2instandby>
</e2powerstate>
I also thought of alternative ways of using dreambox for home automation mainly around sending a messages back to dreambox to notify user on certain conditions. A bit like Push notifications at the moment. E.g. doorbell rang so someone at the door (it might be even possible to switch channel to an IPCam stream) or if temperature downstairs dropped to certain level message could be produced to inform user. You could also ask for Yes/No type of question so could even turn the central heating on from the dreambox remote. Here with the documenation on message facility:
Requests:
http://dreambox/web/message?text={messa ... agetimeout}
Parameter:
messagetext=Text of Message
messagetype=Number from 0 to 3, 0= Yes/No, 1= Info, 2=Message, 3=Attention
timeout=Can be empty or the Number of seconds the Message should disappear after.
Result:

Code: Select all

<e2message>
   <e2result>True</e2result>
   <e2resulttext>Message send to screen</e2resulttext>
</e2message>
Requests:
http://dreambox/web/messageanswer?getanswer=now
Result:

Code: Select all

<e2message>
   <e2result>True</e2result>
   <e2resulttext>Answer is (YES|NO)!</e2resulttext>
</e2message>
Very handy

Re: Checking Dreambox state

Posted: Sunday 08 March 2015 17:04
by PeterFleur
So if we would combine Kabouter and free_nsc posts (Because you also turn on the dreambox with the remote sometimes) how could we get an accurate script that updates Domoticz with Luo on the device Dreambox?

Peter

Re: Checking Dreambox state

Posted: Tuesday 09 June 2015 11:49
by D'rMorris
Morcegolas wrote:
D'rMorris wrote: ...
Then in the directory /usr/lib/enigma2/python/Screens, there is a script called Standby.py. In this script, I added (made bold what I added):
---
I have Standby.pyo :/ can't edit that on vi, Using Dreambox 7020HD with Openatv 4.1.

Hope you can help me.
Thanks.
Don't know if it is still of interest to you, but I found out how you can install the .py files:
- Login in via SSH to your dreambox
- Execute command: opkg install enigma2-src
- Then edit the .py file as described in this thread
- Reboot box

Re: Checking Dreambox state

Posted: Thursday 24 March 2016 17:07
by tuspam
I modded a lite code for my 2 STB with enigma2.
Script check state STB and change state virtual switch in domoticz (only change state without any action). You don't need make any changes in Your enigma2 device.
Script recognize states: ON, OFF, POWER OFF

Add to crone -e for checking state every minute

Code: Select all

*/1 * * * * /home/pi/domoticz/scripts/enigma2/check_enigma2_online.sh
Install xmlstartlet for domoticz if You need

Code: Select all

sudo apt-get install xmlstarlet
check_enigma2_online.sh

Code: Select all

#!/bin/bash

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

if [ $enigma2LivingStatus = "true" ]
then
curl 'http://domoticzIP:Port/json.htm?type=command&param=udevice&idx=142&nvalue=0&svalue=0'
    echo "$enigma2LivingStatus"
    echo enigma2 Living is in standby

elif [ $enigma2LivingStatus = "false" ]
then
curl 'http://domoticzIP:Port/json.htm?type=command&param=udevice&idx=142&nvalue=1&svalue=1'
    echo "$enigma2LivingStatus"
    echo enigma2 Living is not in standby

else
curl 'http://domoticzIP:Port/json.htm?type=command&param=udevice&idx=142&nvalue=0&svalue=0'
    echo "$enigma2LivingStatus"
    echo enigma2 Living is in standby
    echo enigma2 Living not found

rm -r /home/pi/domoticz/scripts/enigma2/powerstate_enigma2_living.xml
fi

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

if [ $enigma2BedroomStatus = "true" ]
then
curl 'http://domoticzIP:Port/json.htm?type=command&param=udevice&idx=139&nvalue=0&svalue=0'
    echo "$enigma2BedroomStatus"
    echo enigma2 Bedroom is in standby

elif [ $enigma2BedroomStatus = "false" ]
then
curl 'http://domoticzIP:Port/json.htm?type=command&param=udevice&idx=139&nvalue=1&svalue=1'
    echo "$enigma2BedroomStatus"
    echo enigma2 Bedroom is not in standby

else
curl 'http://domoticzIP:Port/json.htm?type=command&param=udevice&idx=139&nvalue=0&svalue=0'
    echo "$enigma2BedroomStatus"
    echo enigma2 Bedroom is in standby
    echo enigma2 Bedroom not found

rm -r /home/pi/domoticz/scripts/enigma2/powerstate_enigma2_living.xml
rm -r /home/pi/domoticz/scripts/enigma2/powerstate_enigma2_bedroom.xml
fi
In my case stb1 got idx 142 and second one 139
Sorry for my lang

Re: Checking Dreambox state

Posted: Sunday 04 September 2016 11:58
by simon_rb
Does anyone know the command to grab the play time/status bar when playing a recording. It's the bar along the bottom so you can fast forward 30 mins or whatever really quickly.. Know what I mean?

Cheers

Re: Checking Dreambox state

Posted: Sunday 04 September 2016 13:52
by Derik

Re: Checking Dreambox state

Posted: Sunday 23 October 2016 18:21
by simon_rb
Can't find any reference to what I'm after

Thanks anyways

Re: Checking Dreambox state

Posted: Sunday 16 April 2017 0:45
by madrian
I need little help with volume control. I have a dummy slider for volume control and this lua script:

Code: Select all

commandArray = {}
if devicechanged['VU'] then
	print('Level : '..tonumber(otherdevices_svalues['VU']))
	commandArray['OpenURL']="http://192.168.1.99/web/vol?set=set" .. otherdevices_svalues['VU']
end
return commandArray
It works like a charm, but the slider does not change when I change volume from remote control...for obvious reasons.

I thought that simple script like:

STATE=$(curl -s "http://192.168.1.99/web/vol??set=state" | xmllint --xpath '//e2volume/e2current/text()' -)
curl "192.168.1.54:8080/json.htm?type=command&param=udevice&idx=37&nvalue=1&svalue=$STATE"

(running every minutes) solves the problem, but it is not 100% good. If I change volume on remote, then when this script runs the volume OSD is showing again on the TV (because Domoticz is registering the devicechanged['VU'] and the lua script get running.

The real question is:

It is possible to change slider value, without triggering devicechanged['VU']?

Re: Checking Dreambox state

Posted: Sunday 27 August 2017 9:12
by zicht
free_nsc wrote: Sunday 01 March 2015 1:55 Alternatively, to check current Enigma 2 status ie if it's in Standby , send:
http://e2ipaddress/web/powerstate?=

it will return:

Code: Select all

<e2powerstate>
<e2instandby>true</e2instandby>
</e2powerstate>
I also thought of alternative ways of using dreambox for home automation mainly around sending a messages back to dreambox to notify user on certain conditions. A bit like Push notifications at the moment. E.g. doorbell rang so someone at the door (it might be even possible to switch channel to an IPCam stream) or if temperature downstairs dropped to certain level message could be produced to inform user. You could also ask for Yes/No type of question so could even turn the central heating on from the dreambox remote. Here with the documenation on message facility:
Requests:
http://dreambox/web/message?text={messa ... agetimeout}
Parameter:
messagetext=Text of Message
messagetype=Number from 0 to 3, 0= Yes/No, 1= Info, 2=Message, 3=Attention
timeout=Can be empty or the Number of seconds the Message should disappear after.
Result:

Code: Select all

<e2message>
   <e2result>True</e2result>
   <e2resulttext>Message send to screen</e2resulttext>
</e2message>
Requests:
http://dreambox/web/messageanswer?getanswer=now
Result:

Code: Select all

<e2message>
   <e2result>True</e2result>
   <e2resulttext>Answer is (YES|NO)!</e2resulttext>
</e2message>
Very handy
All commands can be found here if you want to construct a remote for enigma
https://dream.reichholf.net/wiki/Enigma ... cellaneous

I have created a slector switch with simple HTTP commands in place in domoticz for :
Off - turn from on to standby
On - turn on from standby
r- reboot enigma box
Chup - next channel
Chdwn - prev channel
Vup- volume up
Vdwn- volume down
Rec - Instand record only current program (and it ends after program finishes

i have created a text sensor in domoticz showing current station and program
I check with isAlive if the box is reachable --> if hard turned off from mainswitch no polling is done.
All in lua... Anything in the link above can be done in domoticz,..your imagination is the limit.

BUT it would be nice to have something like a kodi remote for enigma in domoticz !

Re: Checking Dreambox state

Posted: Thursday 07 December 2017 22:57
by kofec
If some want. I have created python plugin for Domoticz. Any comment are welcome.

https://github.com/kofec/Domoticz-Enigma2

Re: Checking Dreambox state

Posted: Sunday 25 November 2018 15:27
by NoProfesor
kofec wrote: Thursday 07 December 2017 22:57 If some want. I have created python plugin for Domoticz. Any comment are welcome.

https://github.com/kofec/Domoticz-Enigma2
I installed it,
I added the hardware,
but i do not see device. What can be wrong?

I do not understand this as;
""First use script "tinycontrol.py" to verify if you have needed python modules e.g:

./enigma2.py 192.168.1.1
./enigma2.py -h
usage: enigma2.py [-h] [--user USER] [--password PASSWORD] IPaddress

Comunicate with Enigma2.

positional arguments:
IPaddress IP address of Enigma2

optional arguments:
-h, --help show this help message and exit
--user USER Username to login to
--password PASSWORD Password to login to""

Re: Checking Dreambox state

Posted: Monday 26 November 2018 20:29
by kofec
you have to provide IP address of your Tuner: probably it is not 192.168.1.1
./enigma2.py x.x.x.x