Coś dziwnego, mam ten skrypt:
selfId = fibaro:getSelfId()
HC2 = Net.FHttp("monitor.pogodynka.pl")
dane, status = HC2:GET("/api/station/hydro/?id=150170070")
ajson=json.decode(dane)
stan=ajson.Status.CurrentValue
waring=ajson.Status.WarningValue
alert=ajson.Status.AlarmValue
trend=ajson.Status.Trend
fibaro:call(selfId,"setProperty","ui.Label1.value",stan)
if (tonumber(stan)<tonumber(alert))
then
if (tonumber(stan)<tonumber(waring))
then
fibaro:call(selfId,"setProperty","ui.Label2.value","stan optymalny ")
fibaro:log("stan optymalny"..stan)
else
fibaro:call(selfId,"setProperty","ui.Label2.value","stan ostrzegawczy przekroczony")
fibaro:log("stan ostrzegawczy przekroczony")
end
else
fibaro:call(selfId,"setProperty","ui.Label2.value","stan alarmowy przekroczony")
fibaro:log("stan alarmowy przekroczony")
end
if (tonumber(trend) == 3) then
fibaro:call(selfId,"setProperty","ui.Label3.value","bez zmian")
elseif (tonumber(trend) == 1) then
fibaro:call(selfId,"setProperty","ui.Label3.value","rosnący")
elseif (tonumber(trend) == 2) then
fibaro:call(selfId,"setProperty","ui.Label3.value","malejący")
end
HC3 = Net.FHttp("monitor.pogodynka.pl")
danem, statusm = HC3:GET("/api/station/meteo/?id=250170330")
ajsonm=json.decode(danem)
opadg=ajsonm.Status.Precip.Value
opadd=ajsonm.Status.PrecipDaily.Value
opad6=ajsonm.Status.Precip6HoursSum
fibaro:call(selfId,"setProperty","ui.Label4.value",string.format(" %g",opadg))
fibaro:call(selfId,"setProperty","ui.Label5.value",string.format(" %g",opad6))
fibaro:call(selfId,"setProperty","ui.Label6.value",string.format(" %g",opadd))
Wykłada się na SelfId:
[ERROR] 11:55:54: line getSelfId()..."]:5