Jump to content


Photo

Standby status reporting to mqtt


  • Please log in to reply
8 replies to this topic

#1 holi

  • Senior Member
  • 108 posts

+8
Neutral

Posted 4 March 2024 - 21:45

Hello. Want to ask, is there any way to report standby status with every single standby change (when I turn on/off box manually). Searching net i`ve found some scripts, but they using cron. I want to report this to Node-Red or Domoticz.



Re: Standby status reporting to mqtt #2 eura

  • Senior Member
  • 83 posts

+5
Neutral

Posted 4 March 2024 - 22:07

I have a script that run crontab every 15 seconds (no problem)
https://dream.reichholf.net/e2web/

Hope you find a working solution.
 



Re: Standby status reporting to mqtt #3 holi

  • Senior Member
  • 108 posts

+8
Neutral

Posted 5 March 2024 - 09:00

I found one solution, but you need to modify the Standby.py file - unfortunately I don't have access to it. Could someone share this file (usr/lib/enigma2/python/Screens - there is already *.pyc but I need *.py)



Re: Standby status reporting to mqtt #4 Tech

  • Forum Moderator
    PLi® Core member
  • 14,925 posts

+486
Excellent

Posted 5 March 2024 - 12:24

Just install the python source files by typing the next command in a telnet client

opkg install enigma2-src

Aan de rand van de afgrond is een stap voorwaarts niet altijd vooruitgang....

On the edge of the abyss, a step forward is not always progress....

Hardware: 2x Daily used Vu+ Ultimo 4K - Vu+ Duo 4K SE and a lot more.... - VisioSat BiBigsat - Jultec Unicable Multiswitch 4 positions: 19.2/23.5/28.2 East - Diseqc motorized flatdish antenna

Software : HomeBuild OpenPLi Develop and Scarthgap builds, local cards driven by OsCam

Press the Geplaatste afbeelding button on the buttom right of this message ;)

Have you tried our wiki yet? Many answers can be found in our OpenPLi wiki


Re: Standby status reporting to mqtt #5 holi

  • Senior Member
  • 108 posts

+8
Neutral

Posted 5 March 2024 - 19:45

Thanks. Is it possible to add a script running function to the Standby.py file? I see an entry there: 

 

if os.path.exists("/usr/script/standby_enter.sh"):

 

But it doesn't run the script placed in that folder.


Re: Standby status reporting to mqtt #6 WanWizard

  • PLi® Core member
  • 70,542 posts

+1,812
Excellent

Posted 5 March 2024 - 20:46

Did you create the script? With that exact name? Make it executable?


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: Standby status reporting to mqtt #7 mrvica

  • Senior Member
  • 1,259 posts

+86
Good

Posted 5 March 2024 - 20:48

you can put the box in standby with

# PowerState 0 = Standby; 1 = Deepstandby; 2 = Reboot; 3 = Restart Enigma2
wget -O - -q http://127.0.0.1/web/powerstate?newstate=0

you can check powerstate with this line, you get false or true as result

wget -O - -q http://127.0.0.1/web/powerstate



Re: Standby status reporting to mqtt #8 holi

  • Senior Member
  • 108 posts

+8
Neutral

Posted 5 March 2024 - 21:03

My bad. Sorry. I check it one more time and i`ve created wrong folder - scripts insted script. Now it`s working. 


Edited by holi, 5 March 2024 - 21:08.


Re: Standby status reporting to mqtt #9 mrvica

  • Senior Member
  • 1,259 posts

+86
Good

Posted 11 March 2024 - 15:09

just in case someone may need it

#!/bin/sh

# powerstate.sh
if [ $(wget -qO - http://localhost/web/powerstate?|grep -c false 2>/dev/null) = 1 ];then
     echo powerstate: on
else
     echo powerstate: standby
fi



2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users