[Support request] Yahoo weather sunset is false

Gratis domotica Forums Meld een bug Yahoo weather sunset is false

Dit onderwerp bevat 3 reacties, heeft 2 stemmen, en is het laatst gewijzigd door  K.Rens 2 jaren, 4 maanden geleden.

4 berichten aan het bekijken - 1 tot 4 (van in totaal 4)
  • Auteur
    Berichten
  • #3317

    macgreg0r
    Bijdrager

    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
    Sleutelbeheerder

    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
    Bijdrager

    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
    Sleutelbeheerder

    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

4 berichten aan het bekijken - 1 tot 4 (van in totaal 4)

Je moet ingelogd zijn om een reactie op dit onderwerp te kunnen geven.