ich komme hier nicht weiter:
ich habe mehrere item im Format DateTime
z.B
DateTime LocalWeatherForecastHours03TimeStamp "Vorhersage zeit" {channel="openweathermap:weather-and-forecast:api:local:forecastHours03#time-stamp"}
nun möchte ich in einer Regel vergleichen ob die Stunde des Items zwischen 20 und 6 Uhr liegt.
hier mein Versuch, der offensichtlich nicht klappt
Code: Alles auswählen
rule "update hourly forcastconditioID"
when
Time cron "*/10 * * * * ?"
then
val Hours03 = (LocalWeatherForecastHours03TimeStamp.state as Number).intValue
val mySTD03 = (Hours03 / (60*60)) % 24
if (mySTD03 > 20 || mySTD03 < 6
) {
owmConditionFormatedH3.postUpdate(transform("MAP", "openweathermap_night.map", LocalWeatherForecastHours03ConditionId.state.toString()))
} else {
owmConditionFormatedH3.postUpdate(transform("MAP", "openweathermap_day.map", LocalWeatherForecastHours03ConditionId.state.toString()))
}
end
Danke im Voraus