[Support request] Yahoo weather sunset is false

Free domotica! Forums Report a bug Yahoo weather sunset is false

This topic contains 3 replies, has 2 voices, and was last updated by  K.Rens 1 year, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3317

    macgreg0r
    Participant

    Hello,

    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?

    #3319

    K.Rens
    Keymaster

    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)));
    inside:
    /volume1/web/PulseStation/services/yweather/service-implementation.php

    We are currently working on a permanent smart solution for this weird change in the yahoo api.

    Kind regards,
    K.Rens

    #3341

    macgreg0r
    Participant

    Thanks for your andswer,

    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.

    #3489

    K.Rens
    Keymaster

    I’ve fixed the code for yahoo weather for this.
    Once I know how to put it inside the PulseStation Add-ons store, I will launch it for everyone.

    Kind regards,
    K.Rens

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.