Files
OpenHAB-FFR/rules/Dienste.rules
Patrick Niebeling 9347d3284d Save
Signed-off-by: Patrick Niebeling <patrick.niebeling@adacor.com>
2023-01-12 09:47:48 +01:00

23 lines
901 B
Plaintext

rule "Abruf Dienste"
when
// Time cron "0 * * ? * *" or
Time cron "0 0 19 ? * MON-FRI" or
Time cron "0 16 14 ? * MON-FRI" or
Time cron "0 0 7 ? * SAT,SUN"
then
logInfo("HTTPGET", "Abfrage Erfolgt")
NotificationPatrickPushover.sendCommand("Abfrage Erfolgt")
var String jsonString = sendHttpGetRequest("https://fms.ffhstm.de/dienste_lesen_json.php")
postUpdate(FFDienstZVD,transform("JSONPATH", "$.DIENSTE.C", jsonString))
postUpdate(FFDienstIUK2,transform("JSONPATH", "$.DIENSTE.D", jsonString))
postUpdate(FFDienstIUK3,transform("JSONPATH", "$.DIENSTE.E", jsonString))
var String IUKN = transform("JSONPATH", "$.DIENSTE.F", jsonString)
if (!IUKN.contains("DIENSTE")) {
postUpdate(FFDienstIUKN,IUKN)
} else {
postUpdate(FFDienstIUKN,"")
}
postUpdate(FFSperrungen,transform("JSONPATH", "$.SPERRUNG", jsonString))
end