lastupdate and sunset

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
Kerel
Posts: 28
Joined: Friday 02 December 2016 8:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

lastupdate and sunset

Post 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?
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: lastupdate and sunset

Post 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?
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest