Ok, so my time settings in Hass.io is correct, my timestamps in the log is correct, but in my NodeRed it’s one hour wrong. I guess it could be a timeZone issue since I’m in Sweden. Do I need to change any config file for nodeRed or what?
As far as I remember I had a similar issue. I created a sensor in my Home Assistant configuration file. Based on this sensor I’m able to work with the correct local time in Node-RED. In my automation I use minutes only, therefore I transform the string time value within a function from “hh:mm” to minutes.
Configuration file:
sensor:
- platform: time_date
display_options:
- 'time'
# - 'date'
- 'date_time'
# - 'date_time_utc'
# - 'date_time_iso'
# - 'time_date'
# - 'time_utc'
# - 'beat'
Node-RED function:
function timeHHMM2Min(timeHHMM) {
timeHH = Number(timeHHMM.split(":")[0]);
timeMM = Number(timeHHMM.split(":")[1]);
return timeHH * 60 + timeMM;
}