help with standby

  • hello
    i'd like to execute a command when enigma2 goes to standby, and another when it leave the standby mode:
    any suggestions?
    i thinked about verify the powestate: i found a way using the webinterface but looks not so good (is there a file that contains the running powerstate?)
    or to edit something and add that command before or after the stanby "command" (which file shoud contains that)?


    thanks to all

  • You can monitor the config- variable config.misc.standbyCounter that is set as soon as the box is sent to standby. I did it like this in KiddyTimer- Plugin (you can find the sourcecode here:


    To attach yourself to the Standby- Event you do something like this:

    Code
    config.misc.standbyCounter.addNotifier(self.enterStandby, initial_call = False)


    And then in the function enterStandby you can monitor, when it comes back by using the Standby- class:


    Python
    from Screens import Standby
    def enterStandby(self,configElement):
        Standby.inStandby.onClose.append(self.endStandby)


    HTH
    Tode

  • many thanks for the reply
    but unlucky i cannot "speak" py :frowning_face: but many thanks the same for the suggestions, i have already downloaded the source and i'll try to understand something: but at this moment look as china language for me


    there is not any file that stores the standby or working state (or system variable, so i can access to it with a simple sh script)? verify that values (if it is present) every xxx seconds is enough for me
    thanks again
    regards

  • ...If you just want to find out the power state you could use this "dirty trick"... :winking_face:


    Issue the following command:


    cat /proc/stb/avs/0/input


    In Standby the result will be: aux


    In Power On mode you get: encoder


    ...hope this helps... :winking_face: