Since a few time my scenes are going crazy, and I wondered why?
I finaly found why: Yahoo weather sunset is at 1:00 every days. So my scene that are using it are running at night and not the evening.
I’ve restarted the service but it’s all the same.
Does any one of you got this problem?
I found the issue.
Yahoo changed the format of their time.
“9:01 pm” became “9:1 pm”
This means php cannot read it anymore as time.
A temporary fix for sunrise, but very bad as it will break it as soon as the minutes go into 2 digit minutes (eg: 10) is following line of code:
$device->values[getValueIndex($device, $sunset->id)]->value = date(“H:i”, strtotime(str_replace(“:”, “:0”,$phpObj->query->results->channel->astronomy->sunset)));
We are currently working on a permanent smart solution for this weird change in the yahoo api.
Regarding this issue, I don’t know php, but in shell there are padding functions , eg: 1 padded to 2 digits with “0” will become “01” and if the number is 10, it will not change. mabe a pad filter for hours and minutes of sunset/sunrise before treatment should do the thing, and if Yahoo come back to the old api, there is nothing to do.