Hi.
I think I can only do this by using homeyscript.
I want to set the sunrise and sunset times in decimal value.
I have found this script online, which should calculate a time into a decimal value.
From my very little scripting knowledge, I can read what it does.
Basically it rips apart the time and puts the hours into an hours variable and minutes into a minutes variable then combines them again, but divides the minutes variable by 60.
Great, this looks like something I need.
So if the sunrise is 6:45 the returned value is 6.75.
Now to get the sunrise tag and my own logic tag in there?
Or should I use a completely different script?
function timeStringToFloat(time) {
var hoursMinutes = time.split(/[.:]/);
var hours = parseInt(hoursMinutes[0], 10);
var minutes = hoursMinutes[1] ? parseInt(hoursMinutes[1], 10) : 0;
return hours + minutes / 60;
}