ist eingefügt, aber auch da bleibt der button unangetastet.
--[[
%% properties
3 ConditionCode
%% globals
--]]
local weather_code = fibaro:getValue(3, 'ConditionCode')
local previous_weather_code = fibaro:getValue(3, 'PreviousConditionCode')
local AM_Status = fibaro:getGlobal('AM_Status')
local id = 94
if (weather_code == previous_weather_code) then
--fibaro:debug('weather_code hat sich nicht geändert.')
else
fibaro:debug('Wettervorhersage v0.01 gestartet.')
fibaro:debug('ConditionCode: ' ..weather_code.. ' / Prüfe Wetterbedingung')
if (weather_code == '6' or weather_code == '9' or weather_code == '11' or weather_code == '12' or weather_code == '40') then
fibaro:debug('Wettervorhersage: Regen')
elseif (weather_code == '31' or weather_code == '32' or weather_code == '33' or weather_code == '34') then
fibaro:debug('Wettervorhersage: klar')
elseif (weather_code == '17' or weather_code == '29' or weather_code == '30' or weather_code == '44') then
fibaro:debug('Wettervorhersage: leicht bewölkt')
elseif (weather_code == '26' or weather_code == '35') then
fibaro:debug('Wettervorhersage: bewölkt')
elseif (weather_code == '27' or weather_code == '28') then
fibaro:debug('Wettervorhersage: stark bewölkt')
elseif (weather_code == '19' or weather_code == '20' or weather_code == '21' or weather_code == '22') then
fibaro:debug('Wettervorhersage: Nebel')
elseif (weather_code == '3' or weather_code == '4' or weather_code == '37' or weather_code == '38' or weather_code == '39' or weather_code == '45' or weather_code == '46') then
fibaro:debug('ACHTUNG: Gewitter')
elseif (weather_code == '5' or weather_code == '7' or weather_code == '14' or weather_code == '19' or weather_code == '42' or weather_code == '46') then
fibaro:debug('Wettervorhersage: Möglicherweise Schnee/Schneeregen')
elseif (weather_code == '13' or weather_code == '15' or weather_code == '16' or weather_code == '41' or weather_code == '42' or weather_code == '43') then
fibaro:debug('Wettervorhersage: Schnee')
elseif (weather_code == '17' or weather_code == '35') then
fibaro:debug('ACHTUNG: Hagel')
elseif (weather_code == '8' or weather_code == '10') then
fibaro:debug('Wettervorhersage: Überfrierende Nässe')
elseif (weather_code == '0' or weather_code == '1' or weather_code == '2' or weather_code == '23' or weather_code == '23') then
fibaro:debug('Wettervorhersage: Stürmisch')
elseif (weather_code == '25') then
fibaro:debug('Wettervorhersage: Kalt (Was immer das heißt...)')
elseif (weather_code == '36') then
fibaro:debug('Wettervorhersage: Heiß (Was immer das heißt...)')
elseif (weather_code == '3200') then
fibaro:debug('Code 3200. Nicht bekannt.')
end
if
(weather_code == '6' or weather_code == '9' or weather_code == '11' or weather_code == '12' or weather_code == '40' or
weather_code == '19' or weather_code == '20' or weather_code == '21' or weather_code == '22' or
weather_code == '3' or weather_code == '4' or weather_code == '37' or weather_code == '38' or weather_code == '39' or weather_code == '45' or weather_code == '46' or
weather_code == '5' or weather_code == '7' or weather_code == '14' or weather_code == '19' or weather_code == '42' or weather_code == '46' or
weather_code == '13' or weather_code == '15' or weather_code == '16' or weather_code == '41' or weather_code == '42' or weather_code == '43' or
weather_code == '17' or weather_code == '35' or
weather_code == '8' or weather_code == '10' or
weather_code == '0' or weather_code == '1' or weather_code == '2' or weather_code == '23' or weather_code == '23' or
weather_code == '3200')
and
AM_Status == 2
then
fibaro:call(94, "pressButton", "4");
fibaro:debug('Automower Modus: HOME gesetzt')
elseif
(weather_code == '31' or weather_code == '32' or weather_code == '33' or weather_code == '34' or
weather_code == '17' or weather_code == '29' or weather_code == '30' or weather_code == '44' or
weather_code == '26' or weather_code == '35' or
weather_code == '36')
and
AM_Status == 0 or AM_Status == 1 or AM_Status == 3
then
fibaro:call(94, "pressButton", "2");
fibaro:debug('Automower Modus: AUTO gesetzt')
else
fibaro:debug('weather_code : '..weather_code)
fibaro:debug('AM_Status : '..AM_Status)
end
end
die id ist die richtige, da die status-refresh-scene auch mit dieser id minütlich läuft
kann ich noch irgendwas ändern eurer Meinung nach?
also der AM_Status wird richtig gesetzt, das hab ich nun nochmal kontrolliert. der Wettercode wird auch im Debug ausgegeben …
mir scheint es aber das die Zeilen 66,67 und 79,80 einfach übersprungen werden, da auch in diesem debug nix angezeigt wird. was denkt ihr ?
ja.
Deine If und Deine elseif-Bedingungen treffen nicht zu.
Daher geht er da nicht rein.
Er macht nur das else.
Deswegen die Abfrage des AM_Status in der else-Abfrage.
Ich kann es mir zwar nicht vorstellen aber versuche mal in Zeile 9:
local AM_Status = tonumber(fibaro:getGlobalValue('AM_Status'))
Kann auch sein, dass er die "or"s und Dein “and” nicht so umsetzt.
An den Button dürfte es ja nicht hängen, weil er auch den Debug nicht angibt.
Mach mal in Zeile 51 am Anfang eine “(” und am Ende von 62 eine “)”.
Dito Zeile 71 und 76.
kannst Du mir bitte behilflich sein bei meinem Problem? Ich benutze das oben aufgeführte LUA Skript, als Wetterstation benutze ich das VD aus dem Forum verbunden mit meinem Netatmo. Nun wollte ich das Skript für die Regenwarnung wieder zum laufen bringen. Aus irgendwelchen Gründen wird dieses aber nicht angesprochen wenn die Wetterbedingung “regen” anzeigt/ vorhersagt. Sobald ich das Skript manuell starte, klapt alles. Ich erhalte keine Meldung im debug!
Muss ich an dem Regenwarn Skript etwas ändern?
Anbei das Skript “Regenwarnung”
--[[
%% properties
3 WeatherConditionConverted
%% globals
--]]
local phoneID = {fibaro:getGlobal("var_mareen_handy"), fibaro:getGlobal("var_daniel_handy")} -- Handy-IDs
local maxID = 1000
Debug = function ( color, message )
fibaro:debug(string.format('< %s style="color:%s;">%s', "span", color, message, "span"))
end
local startSource = fibaro:getSourceTrigger();
if (fibaro:getValue(3, "WeatherConditionConverted") == "rain" or startSource['type'] == 'other') then
--if (fibaro:getValue(3, "WeatherConditionConverted") == "9" or startSource['type'] == 'other') then
if (startSource['type'] == 'other') then
Debug('white', "SZENE MANUELL GESTARTET")
else
Debug('green', "SZENE DURCH REGEN-VORHERSAGE GESTARTET")
end
Debug('red', "ACHTUNG! Es könnte regnen")
Debug('white', "Prüfe offene Fenster")
for id = 1, maxID do
local deviceType = fibaro:getType(id)
if (deviceType == 'com.fibaro.windowSensor' or deviceType == 'com.fibaro.doorSensor') then
if (tonumber(fibaro:getValue(id, 'value')) == 1) then
local name = fibaro:getName(id)
local room = fibaro:getRoomNameByDeviceID(id)
Debug('red', "ACHTUNG! Regen vorhergesagt. " ..name.. " im Raum " ..room.. " ist offen!")
for k=1, maxID do
if phoneID[k] ~= nil then
fibaro:call(phoneID[k], 'sendPush', 'ACHTUNG: Regen vorhergesagt! ' ..name.. ' im Raum ' ..room.. ' ist offen!')
end
end
end
end
end
end