I have upgraded my Pi - unfortunately it also installs the latest nightly version of pilight.
With the installed older version my rules have worked like a charm. Now - pilight won't start.
I replaced the old device-names by the suggested ones in the wiki, so that the first two error-lines have gone.
But i don't have the time yet to study all threads to search for the solution to get my rule work again with
the new nightly.
Could somebody (more experienced in this topic) help me? The goal is to switch my tvbacklight to on 15 minutes after sunset :-)
I really appreciate your help
EDIT: I changed the rule in this way:
Maybe this will be a solution - i have to wait until 15 minutes after sunriseset is reached...
well done - the device has switched to on around 21:20 oclock
With the installed older version my rules have worked like a charm. Now - pilight won't start.
Code:
pilight-daemon: ERROR: config device #6 "sunriseset", protocol names are reserved words
pilight-daemon: ERROR: config device #7 "datetime", protocol names are reserved words
pilight-daemon: ERROR: DATE_FORMAT requires at least three parameters when passing a datetime string e.g. DATE_FORMAT(01-01-2015, 175-Bad address-%Y, %Y-Bad address-0)
pilight-daemon: INFO: rule #1 was parsed until: ... (sunriseset.sunset == DATE_FORMAT(datetime, %H.%M)) AND tvbacklight.state IS off THEN switch DEVICE tvbacklight TO on AFTER 15 MINUTE
pilight-daemon: INFO: rule #1 TV_Backlight_AutoON was parsed in 0.000583 seconds
I replaced the old device-names by the suggested ones in the wiki, so that the first two error-lines have gone.
But i don't have the time yet to study all threads to search for the solution to get my rule work again with
the new nightly.
Could somebody (more experienced in this topic) help me? The goal is to switch my tvbacklight to on 15 minutes after sunset :-)
Code:
"devices": {
"tvbacklight": {
"protocol": [ "intertechno_old" ],
"id": [{
"id": 12,
"unit": 4
}],
"state": "off"
},
"sonnenaufuntergang": {
"protocol": [ "sunriseset" ],
"id": [{
"longitude": 8.550002500000005,
"latitude": 47.367347
}],
"sunrise": 5.34,
"sunset": 21.27,
"sun": "rise"
},
"zeitunddatum": {
"protocol": [ "datetime" ],
"id": [{
"longitude": 8.550002500000005,
"latitude": 47.367347
}],
"year": 2015,
"month": 7,
"day": 2,
"hour": 20,
"minute": 45,
"second": 18,
"weekday": 5,
"dst": 1
},
"outside": {
"protocol": [ "openweathermap" ],
"id": [{
"country": "ch",
"location": "Waedenswil"
}],
"humidity": 68.00,
"temperature": 21.48,
"sunrise": 5.33,
"sunset": 21.25,
"sun": "set",
"update": 1
},
"rules": {
"TV_Backlight_AutoON": {
"rule": "IF (sunriseset.sunset == DATE_FORMAT(datetime, %H.%M)) AND tvbacklight.state IS off THEN switch DEVICE tvbacklight TO on AFTER 15 MINUTE",
"active": 1
},
"gui": {
"tvbacklight": {
"name": "TV Hintergrundbeleuchtung",
"group": [ "Schlafzimmer #9" ],
"media": [ "all" ]
},
"zeitunddatum": {
"name": "Zeit & Datum",
"group": [ "Info" ],
"format": "HH:mm:ss DD-MM-YYYY"
},
"outside": {
"name": "Temperatur",
"group": [ "Info" ],
"media": [ "all" ]
},
"settings": {
"log-level": 4,
"pid-file": "/var/run/pilight.pid",
"log-file": "/var/log/pilight.log",
"webserver-enable": 1,
"webserver-root": "/usr/local/share/pilight/",
"webserver-http-port": 5001,
"webserver-cache": 1,
"ntp-servers": [ "0.ch.pool.ntp.org", "1.ch.pool.ntp.org" ]
},
I really appreciate your help
EDIT: I changed the rule in this way:
Code:
"rules": {
"TV_Backlight_AutoON": {
"rule": "IF sunriseset.sun IS set AND tvbacklight.state IS off THEN switch DEVICE tvbacklight TO on AFTER 15 MINUTE",
"active": 1
well done - the device has switched to on around 21:20 oclock