Another solution to the same problem using a dummy Presence sensor device which allows state to be displayed in the GUI without an additional variable device.
Subsequent rules can then be made on the if Daglicht is present/absent
predicate
{
"autoReset": false,
"id": "sensor-daglicht",
"name": "Daglicht",
"class": "DummyPresenceSensor"
}
Then create rules based on the presence sensor device. No need to do or its before sunrise/sunset
as the event only triggers once in 24 hours.
{
"id": "avondstand",
"name": "Avondstand aan",
"rule": "when it is sunset and if Daglicht is present then set presence of Daglicht absent",
"active": true,
"logging": true
},
{
"id": "dagstand",
"name": "Dagstand aan",
"rule": "when it is sunrise and if Daglicht is absent then set presence of Daglicht present",
"active": true,
"logging": true
}