Eztimer and Time Range nodes have sunrise for next day

Latest update to node rod 3.0.2 is causing all my time nodes that monitor sunrise to give sunrise for the following day. Been working fine for years and just started doing this. Any suggestions?

Welcome to the forum @vbtrek

Please post a very simple flow (just a few nodes) that exhibit the problem. If you have used any non-builtin nodes then tell us what they are.

I wasn't allowed to upload a file, but here's simple Flow with an Eztimer and TimeRange nodes:

Both are displaying tomorrows sunrise time:
image

[{
        "id": "b4c7f4785c215a3b",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "a4313c29e1ec5b8a",
        "type": "time-range-switch",
        "z": "b4c7f4785c215a3b",
        "name": "6AM till Sunrise+30min",
        "lat": "53.144114",
        "lon": "-3.000374",
        "startTime": "06:00",
        "endTime": "sunrise",
        "startOffset": "0",
        "endOffset": "30",
        "x": 435.25,
        "y": 250.24998474121094,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "1dcfd3ee64e06b8d",
        "type": "eztimer",
        "z": "b4c7f4785c215a3b",
        "name": "",
        "debug": false,
        "autoname": "06:00:00 - sunrise",
        "tag": "eztimer",
        "topic": "",
        "suspended": false,
        "sendEventsOnSuspend": false,
        "latLongSource": "haZone",
        "latLongHaZone": "zone.home",
        "lat": "53.14414002398526",
        "lon": "-3.000329732894898",
        "timerType": "1",
        "startupMessage": true,
        "ontype": "2",
        "ontimesun": "dawn",
        "ontimetod": "06:00:00",
        "onpropertytype": "msg",
        "onproperty": "payload",
        "onvaluetype": "num",
        "onvalue": 1,
        "onoffset": 0,
        "onrandomoffset": 0,
        "onsuppressrepeats": false,
        "offtype": "1",
        "offtimesun": "sunrise",
        "offtimetod": "dusk",
        "offduration": "00:01:00",
        "offpropertytype": "msg",
        "offproperty": "payload",
        "offvaluetype": "num",
        "offvalue": 0,
        "offoffset": "30",
        "offrandomoffset": 0,
        "offsuppressrepeats": false,
        "resend": false,
        "resendInterval": "0s",
        "mon": true,
        "tue": true,
        "wed": true,
        "thu": true,
        "fri": true,
        "sat": true,
        "sun": true,
        "x": 435.25,
        "y": 190.24998474121094,
        "wires": [
            []
        ]
    }
]

Nodes installed:

  • node-red-contrib-eztimer
  • node-red-contrib-time-range-switch

I also run node-red in a docker container hosted on a Synology DiskStation, I've checked the date/time on the server and that is correct.

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote ```)

``` 
   code goes here 
```

You can edit and correct your post by clicking the pencil :pencil2: icon.

See this post for more details - How to share code or flow json

[Edit] Also tell us which nodes you have installed to get those nodes (node-red-contrib-something possibly)

1 Like

I have initially looked at the eztimer node. You have specified the On event for 06:00 and the Off event for Sunrise. So if sunrise is before 06:00 then it will go On at 06:00 and Off at the next sunrise, which is tomorrow morning. Is that not what you expect for those settings?

For years this has always been sunrise on the current day, so in winter I have lights coming on between 6am and sunrise, and in summer they never come on because sunrise is before 6am.

Since the weekend when node red was updated the lights have been on all day.

Have you been using both those node's historically?

If you are convinced the behaviour has changed, then I suggest posting an issue on the node's github page to ask the author. But to me the current implementation seems correct.

I have tried your flow on node red 1.0.4 and see this
image

CronPlus?

I've created a clone of node-red-contrib-time-range-switch and published my own version the keeps the dates as today.

node-red-contrib-today-time-range-switch (node) - Node-RED (nodered.org)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.