Node-red 'time-range' node wrong time

From what I can tell the time node thinks it's 13:40 (1:40PM), but it really 09:40 (9:40AM). Thoughts on why? I have triple checked the lat/long.

I think the z at the end means Zulu time.

2 Likes

The question is: Does it fire at the right time? Could it be checking it against somewhere else and just not converting?

1 Like

No, it fires like it is 1:40pm not 9:40 am

Yap .. that woudl be a problem then. :grin:
Which node is it, specifically? I can load it and see what I get.

1 Like

time-range-switch

Is there I better node to use?

1 Like

Confirmed it is Zulu time (it is 3:02 in Zulu time right now in case you were wondering) :rofl:

node-red-contrib-time-range-switch
I think this is the same. I have it

image

2 Likes

what is your use case, cuz there is another one I use if I'm turning something on a t a specific time

image
node-red-contrib-bigtimer

1 Like

The landscape lighting should go off at midnight, but it is on in am (think it turns back on when lux hovers around 1, but have not debugged)

I did an exact flow for that case for my kitchen cabinets. I use the time range one to turn them back on becuase they turn off certain lights when we go to bed, but want them to turn back on if the house starts wakign up and the time is between sunset and sunrise

I'll get it so you can see

1 Like

[{"id":"75a4b26c.9f7a4c","type":"switch","z":"f7530f78.fbd6e","name":"on(1) or off(0)","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":440,"y":860,"wires":[["64bf6828.27aa98"],["612fc1dc.896c1"]]},{"id":"41fef806.79ebf8","type":"switch","z":"f7530f78.fbd6e","name":"Illiminance <= 0","property":"payload.value","propertyType":"msg","rules":[{"t":"lte","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":440,"y":800,"wires":[[]]},{"id":"ac408912.55d688","type":"switch","z":"f7530f78.fbd6e","name":"Mode is NOT Night","property":"payload.value","propertyType":"msg","rules":[{"t":"neq","v":"Night","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":770,"y":820,"wires":[["8638729e.09b78"]]},{"id":"9f4ae61b.0c0388","type":"switch","z":"f7530f78.fbd6e","name":"Mode is Night","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"Night","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1100,"y":900,"wires":[["ac94f028.a1b8a"]]},{"id":"f81ad17c.a75c5","type":"switch","z":"f7530f78.fbd6e","name":"Mode is NOT Night","property":"payload.value","propertyType":"msg","rules":[{"t":"neq","v":"Night","vt":"str"},{"t":"eq","v":"Night","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":950,"y":980,"wires":[["9416b2c1.f372c","911e79ca.a08a98"],["f6bba5f.6d6d658"]]},{"id":"e2b927a8.f13328","type":"switch","z":"f7530f78.fbd6e","name":"Is Active","property":"payload.currentValue","propertyType":"msg","rules":[{"t":"eq","v":"active","vt":"str"},{"t":"eq","v":"inactive","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":320,"y":1000,"wires":[["209deac0.e00f36"],[]]},{"id":"8638729e.09b78","type":"hubitat command","z":"f7530f78.fbd6e","name":"RGBW E On","server":"6b5d6374.da729c","deviceId":"2330","command":"setColorTemperature","commandArgs":"4444","x":950,"y":820,"wires":[["13902c41.88b744"]]},{"id":"ac94f028.a1b8a","type":"hubitat command","z":"f7530f78.fbd6e","name":"RGBW E Off","server":"6b5d6374.da729c","deviceId":"2330","command":"off","commandArgs":"","x":1270,"y":900,"wires":[[]]},{"id":"13902c41.88b744","type":"hubitat command","z":"f7530f78.fbd6e","name":"RGBW N On","server":"6b5d6374.da729c","deviceId":"2331","command":"setColorTemperature","commandArgs":"4444","x":1110,"y":820,"wires":[[]]},{"id":"612fc1dc.896c1","type":"hubitat command","z":"f7530f78.fbd6e","name":"RGBW E Off","server":"6b5d6374.da729c","deviceId":"2330","command":"off","commandArgs":"","x":630,"y":900,"wires":[["b2eb7580.f65738"]]},{"id":"b2eb7580.f65738","type":"hubitat command","z":"f7530f78.fbd6e","name":"RGBW N Off","server":"6b5d6374.da729c","deviceId":"2331","command":"off","commandArgs":"","x":790,"y":900,"wires":[[]]},{"id":"9416b2c1.f372c","type":"hubitat command","z":"f7530f78.fbd6e","name":"RGBW E 100%","server":"6b5d6374.da729c","deviceId":"2330","command":"setLevel","commandArgs":"100","x":1140,"y":960,"wires":[[]]},{"id":"f6bba5f.6d6d658","type":"hubitat command","z":"f7530f78.fbd6e","name":"RGBW N 50%","server":"6b5d6374.da729c","deviceId":"2331","command":"setLevel","commandArgs":"50","x":1140,"y":1000,"wires":[[]]},{"id":"a9e556bd.7ea6e8","type":"hubitat command","z":"f7530f78.fbd6e","name":"RGBW E Off","server":"6b5d6374.da729c","deviceId":"2330","command":"off","commandArgs":"","x":810,"y":1020,"wires":[["9f359c73.d7125"]]},{"id":"9f359c73.d7125","type":"hubitat command","z":"f7530f78.fbd6e","name":"RGBW N Off","server":"6b5d6374.da729c","deviceId":"2331","command":"off","commandArgs":"","x":970,"y":1020,"wires":[[]]},{"id":"36879e8f.5ea562","type":"hubitat device","z":"f7530f78.fbd6e","name":"Illuminance","server":"6b5d6374.da729c","deviceId":"2228","attribute":"illuminance","sendEvent":true,"x":270,"y":800,"wires":[["41fef806.79ebf8"]]},{"id":"d448e6d9.bd9a78","type":"hubitat device","z":"f7530f78.fbd6e","name":"Railing Motion","server":"6b5d6374.da729c","deviceId":"1430","attribute":"motion","sendEvent":true,"x":140,"y":1000,"wires":[["e2b927a8.f13328"]]},{"id":"64bf6828.27aa98","type":"hubitat mode","z":"f7530f78.fbd6e","name":"Mode","server":"6b5d6374.da729c","sendEvent":false,"x":610,"y":820,"wires":[["ac408912.55d688"]]},{"id":"3e8bf82a.a7a178","type":"hubitat mode","z":"f7530f78.fbd6e","name":"Mode","server":"6b5d6374.da729c","sendEvent":true,"x":950,"y":900,"wires":[["9f4ae61b.0c0388"]]},{"id":"d84f17a4.afad08","type":"hubitat mode","z":"f7530f78.fbd6e","name":"Mode","server":"6b5d6374.da729c","sendEvent":false,"x":790,"y":980,"wires":[["f81ad17c.a75c5"]]},{"id":"469829e.4b323d8","type":"bigtimer","z":"f7530f78.fbd6e","outtopic":"","outpayload1":"","outpayload2":"","name":"Sunset-60 (on) / Sunrise+60 (off)","comment":"","lat":"43.4561268","lon":"-96.4379696","starttime":"5004","endtime":"5003","starttime2":0,"endtime2":0,"startoff":"-60","endoff":"60","startoff2":0,"endoff2":0,"offs":0,"outtext1":"","outtext2":"","timeout":1440,"sun":true,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"jan":true,"feb":true,"mar":true,"apr":true,"may":true,"jun":true,"jul":true,"aug":true,"sep":true,"oct":true,"nov":true,"dec":true,"day1":0,"month1":0,"day2":0,"month2":0,"day3":0,"month3":0,"day4":0,"month4":0,"day5":0,"month5":0,"day6":0,"month6":0,"day7":"","month7":"","day8":"","month8":"","day9":"","month9":"","day10":"","month10":"","day11":"","month11":"","day12":"","month12":"","d1":0,"w1":0,"d2":0,"w2":0,"d3":0,"w3":0,"d4":0,"w4":0,"d5":0,"w5":0,"d6":0,"w6":0,"xday1":0,"xmonth1":0,"xday2":0,"xmonth2":0,"xday3":0,"xmonth3":0,"xday4":0,"xmonth4":0,"xday5":0,"xmonth5":0,"xday6":0,"xmonth6":0,"xd1":0,"xw1":0,"xd2":0,"xw2":0,"xd3":0,"xw3":0,"xd4":0,"xw4":0,"xd5":0,"xw5":0,"xd6":0,"xw6":0,"suspend":false,"random":false,"repeat":false,"atstart":false,"odd":false,"even":false,"x":180,"y":860,"wires":[[],["75a4b26c.9f7a4c"],[]]},{"id":"209deac0.e00f36","type":"time-range-switch","z":"f7530f78.fbd6e","name":"sunset to sunrise = output 1","lat":"43.4561268","lon":"-96.4379696","startTime":"sunset","endTime":"sunrise","startOffset":"-59","endOffset":"+59","x":540,"y":1000,"wires":[["d84f17a4.afad08"],["a9e556bd.7ea6e8"]]},{"id":"911e79ca.a08a98","type":"hubitat command","z":"f7530f78.fbd6e","name":"RGBW N 100%","server":"6b5d6374.da729c","deviceId":"2331","command":"setLevel","commandArgs":"100","x":1360,"y":960,"wires":[[]]},{"id":"6b5d6374.da729c","type":"hubitat config","z":"","name":"Hubitat","usetls":false,"host":"192.168.86.32","port":"80","appId":"3451","nodeRedServer":"http://192.168.86.49:1880","webhookPath":"/hubitat/webhook","autoRefresh":true,"useWebsocket":true}]

Use case:

sunset - 60 bigtimer turns on the light as long as mode is not night the cabinets turn on.
Then
When motionis active and the time is between sunset and sunrise and mode is not night then they ramp up to 100%. But if they're still on outside of tht, the outside (bottom port) turns them off. So they'll turn back on if the sun is not up but we're getting up in the morning.

Ignore the illuminance node there. I think I put it there when I was working on the lights turning on during the day when illiminance was low. But I didn't pursue it, but knowing what illiminance is was kind've nice. So I left it.

For Big timer how do you know what time "night", "night end" and so on are?

I haven't messed with the specific days, but here is a shot of my config to turn on 60 minutes before sunset and off 60 minutes after

1 Like

image

There's not a time listed, but the node does a count down

1 Like

If it's any consolation, it just works. It's hit every time for me. I've had these going for a couple months now.

yeahbut I don't want them on all night. 0:00/23:45 says it is 8 hours away. It's not, It's only noon it should be almost 12 hours from now. Something is off clock wise. Using night is 11 hours away (close) and night end is 16 hours away (ugh this should be easy, guess I'll move to Zulu! :laughing: )

image

Try restarting node red. I've run into issues like this when node red has had a lot of changes. Did you stick a debug node on it to see what you get on that?
Although it's not reading right, it's the node you want to use for your automation. It's just odd that the time is pulling wrong.
What is nodered on? a pi? Is the time correct in that environment?
(Sorry I'm like !!bleh100questions!!) :grin: