• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Program can't be set to state running
#1
After updating pilight 8.0.4 to 8.1.1 I get this error on running programs:

Quote:pilight-daemon: ERROR: /usr/local/lib/pilight/actions/switch.lua:77: device "push-doorbell" can't be set to state "running"

The relevant parts of my config are:

Code:
{
    "devices": {
        "push-doorbell": {
            "protocol": [ "program" ],
            "id": [{
                "name": "push-doorbell"
            }],
            "program": "",
            "arguments": "",
            "stop-command": "",
            "start-command": "bash /home/pi/somescript.sh",
            "state": "stopped",
            "pid": 0
        },
        "doorbell": {
            "protocol": [ "kaku_switch" ],
            "id": [{
                "id": 12345678,
                "unit": 1
            }],
            "state": "off"
        }
    },
    "rules": {
        "doorbell-push": {
            "rule": "IF doorbell.state == on THEN switch DEVICE push-doorbell TO running",
            "active": 1
        }
    },
(...)
}

I already tried filling in the program and arguments parts, but that does not solve the problem. I also tried a simple linux command (sleep 5s) as start-command to make sure it isn't my shell script.
 
Reply
#2
The program protocol has not been implemented in the lua library yet. I would downgrade for now or wait for me to port it.
 
Reply
#3
(07-12-2018, 05:27 PM)curlymo Wrote: The program protocol has not been implemented in the lua library yet. I would downgrade for now or wait for me to port it.

Thank you, I downgraded to 8.0.9 for now.
Is there a list somewhere what is supported and what is not? I searched for it, but didn't found it...
 
Reply
#4
https://manual.pilight.org/changelog.html

But, some things are temporarily removed depending on the development status. As soon as something goes to stable you can be assured that i document exactly what was removed, updated or added.

Please do upgrade again so i can check if the program protocol works again inside the rules.
 
Reply
#5
(07-13-2018, 09:49 AM)curlymo Wrote: Please do upgrade again so i can check if the program protocol works again inside the rules.

I updated again (to 8.1.1-27-g8585b4d5), but the error is still the same.
 
Reply
#6
I will dive deeper into this.
 
Reply
#7
I don't have any issues with that version of pilight:
Code:
[Jul 16 18:47:06:403986] pilight-daemon: DEBUG: broadcasted: {"origin":"receiver","protocol":"datetime","message":{"longitude":4.600000,"latitude":52.300000,"year":2018,"month":7,"day":16,"weekday":2,"hour":20,"minute":47,"second":6,"dst":1},"uuid":"0000-00-0c-29-3714d8"}
[Jul 16 18:47:06:404196] pilight-daemon: DEBUG: rule #1 doorbell-push was parsed in 0.000145 seconds
[Jul 16 18:47:06:404317] pilight-daemon: DEBUG: lua thread on state #0
[Jul 16 18:47:06:405415] pilight-daemon: DEBUG: socket write succeeded: {"origin":"update","type":7,"uuid":"0000-00-0c-29-3714d8","devices":["push-doorbell"],"values":{"timestamp":1531766826,"state":"running"}}

[Jul 16 18:47:06:405427] pilight-daemon: DEBUG: broadcasted: {"origin":"update","type":7,"uuid":"0000-00-0c-29-3714d8","devices":["push-doorbell"],"values":{"timestamp":1531766826,"state":"running"}}
[Jul 16 18:47:06:405447] pilight-daemon: DEBUG: socket write succeeded: {"message":{"name":"push-doorbell","state":"running"},"origin":"receiver","protocol":"program","uuid":"0000-00-0c-29-3714d8"}

[Jul 16 18:47:06:405451] pilight-daemon: DEBUG: broadcasted: {"message":{"name":"push-doorbell","state":"running"},"origin":"receiver","protocol":"program","uuid":"0000-00-0c-29-3714d8"}
[Jul 16 18:47:06:405572] pilight-daemon: DEBUG: socket write succeeded: {"origin":"update","type":7,"uuid":"0000-00-0c-29-3714d8","devices":["push-doorbell"],"values":{"timestamp":1531766826,"state":"pending"}}

[Jul 16 18:47:06:405584] pilight-daemon: DEBUG: broadcasted: {"origin":"update","type":7,"uuid":"0000-00-0c-29-3714d8","devices":["push-doorbell"],"values":{"timestamp":1531766826,"state":"pending"}}
[Jul 16 18:47:06:405606] pilight-daemon: DEBUG: socket write succeeded: {"origin":"sender","protocol":"program","message":{"name":"push-doorbell","state":"pending"},"repeat":1,"uuid":"0000-00-0c-29-3714d8"}

[Jul 16 18:47:06:405612] pilight-daemon: DEBUG: broadcasted: {"origin":"sender","protocol":"program","message":{"name":"push-doorbell","state":"pending"},"repeat":1,"uuid":"0000-00-0c-29-3714d8"}
bash: /home/pi/somescript.sh: No such file or directory
As you can see in the last line, the script is being called (but does not exist on my PC).

This was the config:
Code:
{
        "devices": {
                "push-doorbell": {
                        "protocol": [ "program" ],
                        "id": [{
                                "name": "push-doorbell"
                        }],
                        "program": "",
                        "arguments": "",
                        "stop-command": "",
                        "start-command": "bash /home/pi/somescript.sh",
                        "state": "pending",
                        "pid": 0
                },
                "dt": {
                        "protocol": [ "datetime" ],
                        "id": [{
                                "longitude": 4.6,
                                "latitude": 52.3
                        }],
                        "year": 2018,
                        "month": 7,
                        "day": 16,
                        "weekday": 2,
                        "hour": 20,
                        "minute": 47,
                        "second": 6,
                        "dst": 1
                }
        },
        "rules": {
                "doorbell-push": {
                        "rule": "IF (dt.second % 3) == 0 THEN switch DEVICE push-doorbell TO running",
                        "active": 1
                }
        },
        "gui": {},
        "settings": {
                "log-level": 6,
                "pid-file": "/var/run/pilight.pid",
                "log-file": "/var/log/pilight.log",
                "webserver-root": "/home/pilight/source/daemon/libs/webgui/",
                "webserver-enable": 1,
                "webserver-http-port": 5001,
                "webserver-cache": 0,
                "standalone": 1,
                "port": 5000
        },
        "hardware": {},
        "registry": {
                "webserver": {
                        "ssl": {
                                "certificate": {
                                        "secure": 0,
                                        "location": "/etc/pilight/pilight.pem"
                                }
                        }
                },
                "pilight": {
                        "version": {
                                "current": "8.1.1"
                        }
                }
        }
}
 
Reply
#8
I updated again, to 8.1.1-30-g6d3a9439 this time. Now it works. Same config file loaded as before.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Problem with executing bash script via rule/program dYna 1 783 02-15-2018, 09:06 PM
Last Post: dYna
  Always trigger event on any device state Phil 8 1,914 03-22-2017, 07:30 PM
Last Post: Phil
  action: program bazb 16 7,316 03-31-2016, 09:14 AM
Last Post: Niek
  Difference switching device or state droptix 3 1,961 10-29-2015, 05:52 PM
Last Post: terrar
  pass dimlevel as argument to program device droptix 5 2,205 10-25-2015, 09:43 AM
Last Post: droptix
Question Switch without a state rogier 3 2,793 04-27-2015, 04:50 PM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)