I'm almost getting this solved by muddling my way through lots of searches, but not quite.
I want to get the current time (probably from an Inject) then check how many minutes it is until 15:00.
eg. 15:00 - timestamp = xx minutes
As usual there seem to be almost infinite ways of doing this and I suspect I've got myself confused.
One of my problems is I don't quite understand how to specify "15:00" in Epoch time. It seems like I have to set an epoch time to some specific date & time, then extract the hours:minutes?
I'd prefer to not to use a Function node. A Change node and JSONATA would be fine because I'm trying to learn JSONATA at present.
Also happy to use some other set of nodes if there's a simpler way to do it.
To give context, I know the approximate rate at which my hot water heats on boost. I want to check the temperature of the water, then calculate when to turn on boost so it reaches (approximately) my set-point temperature by 15:00 each day. This will give the maximum time for solar to heat the water during the day, but if the day is cloudy it will ensure the water is hot before we go to peak electricity rate at 15:00.
I'm sure this has been answered before, but I just can't find the right topic that I can follow and tweak to my usage, obviously searching the wrong terms.
In a change node
to value of J:$moment("15:00", "HH:mm").diff($moment(),"minutes")
Which should output the minutes between now and 15:00.
Using Just JSONata time functions ($toMillis($substringBefore($now(),"T") & "T" & "15:00:00") - $millis()) / 60000