Page 1 of 1

lastupdate and sunset

Posted: Sunday 03 December 2017 16:27
by Kerel
I want to check if a device was updated before today's sunset, tried:

domoticz.devices('Motion sensor living room').lastUpdate.matchesRule('before sunset')

But to no avail..

another option I came up with is to compare the lastUpdate dateTime of the device with the dateTime of sunset, but how can I check today's sunset dateTime?
Tried:

domoticz.time.sunset.raw
domoticz.sunset.raw

But they all give errors.. any thoughts?

Re: lastupdate and sunset

Posted: Monday 04 December 2017 8:19
by dannybloe
Your rule is wrong. There is no rule 'before sunset'. It is 'xxx minutes before sunset' (where xxx is, of course, the amount of minutes). Thing is.. you cannot implement a 'before sunset' because every moment is effective a 'before sunset' moment. There is no defined moment for which this doesn't apply. So, you can use 'at daytime' which is after sunrise and before sunset. Perhaps that is what you mean?