I just installed node-red and I have exactly one production automation working in it right now. (Well, two, I have a test-light-on whatever-ya-callits groups of bubbles).
I want to essentially do a case statement - on light on event, check the time and set brightness as appropriate (~8pm, 10pm, midnight - 6am).
If anyone has the urge would you mind giving me an idea of how I would do this?
(so much easier to get into this stuff when you have a bit working)
You can get the hour of the day nodered way by using the moment node if you pass the timestamp as input. but you can also use function node and use use new Date()
so in code woould be
var d = new Date()
hour = d.toLocaleTimeString(undefined, { hour: 'numeric' })
Why is it that the sun-position node returns an error when itâs in one of the azimuth positions, and doesnât return an error when itâs not in one of the configured azimuth positions?
It maybe better to ask this on the nodes git page since it is very specific to the nodes behavior. You could use a catch node to catch and log the error in a way that you can trigger from it.
I miss read that, basically it doesnât work at all? Configured result in error and un configured does nothing?
Edit. I used the example flow from the nodes documentation and I get that error if the azimuth is within a configured range. It appears to be a bug.
It seems this issue has been around for a while. You could always use a change node after to sort the azimuth.