Aller au contenu

Delacoste

Membres confirmés
  • Compteur de contenus

    54
  • Inscription

  • Dernière visite

Tout ce qui a été posté par Delacoste

  1. Delacoste

    HC2 & HCL - 4.530 - Stable - 07/01/2019

    Bonjour et bonne année! J'ai crashé mon Mac Book Pro et j'ai donc voulu donc faire la mise à jour de la version 4.53 via l'application Ipad mais dès que je clique sur mise à jour, il me met instantanément l'erreur: Error: Update Error Que dois-je faire? Merci
  2. Delacoste

    Fibaro FGT-001 - Vanne Thermostatique

    Merci pour toutes vos propositions et désolé pour ma réponse tardive! j'ai finalement fait un reset "usine" de la vanne et reconnecté une nouvelle sonde et tout est ok maintenant. Autre question: l'expérience de la première vanne étant concluante, j'ai acheté deux autres vannes sans sonde de température. je veux les installer dans le même local. j'ai crû lire à quelque part q'une sonde peut piloter jusqu'à maximum 3 vannes. Ma question est dois-je faire reconnaître la sonde par les deux autre nouvelles vannes? Quelle est la procédure? Merci pour vos réponses.
  3. Delacoste

    Fibaro FGT-001 - Vanne Thermostatique

    Bonjour à tous, J'ai installé la vanne thermostatique de Fibaro et le capteur de température (Radiator Thermostat Starter Pack) sans problème. Ensuite mon crétin de chat a pris le capteur comme jouet et l'a détruit!!! J'en ai commandé un autre mais j'arrive pas a le supprimer de ma HC2 puisque il ne répond plus. Savez-vous comment procéder? Ce qui me semble bizarre c'est que sur l'application Fibaro de mon Iphone il semble fonctionner: Mais sur mon HC2 depuis mon PC: non Merci d'éclairer mes lanternes!
  4. Bonjour à tous! je suis encore et toujours novice en la matière. J'aimerai domotiser ma "turbinette". j'ai l'intention de le faire de la manière suivante:avec un capteur d'humidité. Lequel me conseillerez-vous pour qu'il soit compatible avec ma HC2? Ensuite l'intégrer et que se soit le plus facile possible de lui donner comme consigne par exemple : si > 70% humidité relative alors enclenche-toi jusqu'à atteindre une valeur plus petite. Merci pour votre aide
  5. Delacoste

    Domotisation d'un ventilateur type "turbinette"

    Re-bonjour, Est-ce possible de commander la turbinette sans interrupteur et si avec quel module? Merci
  6. Delacoste

    Domotisation d'un ventilateur type "turbinette"

    Merci pour vos réponses question: j'ai un Z-Wave FGS-212 qui traîne. Ca peut fonctionner avec?
  7. Delacoste

    Piloter box Swisscom TV

    salut pocket998, as-tu avancé avec tons installation Swisscom/Logitech/HC2? si oui tu peux décrire ce que tu peux faire avec? Merci
  8. Salut pepite barlow communique avec moi sur le site https://forum.fibaro.com/topic/25852-vd-scripts-gardena-smart-system/?tab=comments&_fromLogin=1 c’est un peu la galère! la sonde fonctionne et deux des vannes fonctionnent aussi mais les deux autres autres vannes non J’y comprend pas grand chose car tout ce matériel a été acheté en même temps et quand à l’installation dans FIBARO je peux difficilement me tromper je suis donc pas au bout de mes peines car tout ce qu’on fait maintenant c’est juste pour piloter les vannes depuis FIBARO. A court terme j’aimerais faire des scénarios style : si il a plu ou si il a pleuvoir dans la journée alors pas d’arrosage... mais ça c’est une autre histoire
  9. Bonjour à tous, Je suis novice dans ce forum ... alors soyez indulgent J'ai un système d'arrosage Gardena Smart system comprenant: - 4 smart water Control Gardena - 4 turbines escamotables Gardena - 1 sonde smart control Gardena. Tout marche très bien et j'aimerai savoir si il est possible d'intégrer ce système sur une HC2 Merci
  10. Salut l'ami! La gateway est en wifi et la sonde et les vannes j'en ai aucune idée, mais je vois à nulle part une adresse IP. je vois seulement un numéro identifier: 6e9487da-a290-43af-9576-6349670c2f55 je vais essayer de lui poser ces questions mais mon anglais est plus que limité oui tous les es 4 vannes et la sonde ce qui est bizarre c'est que pour la sonde et pour une vanne (voiture) un Fibaro virtual device (en rouge en bas) leur a été attribué et pas pour les autres?? [DEBUG] 19:02:12: Found the following GARDENA gateway: [DEBUG] 19:02:12: Name: Gateway [DEBUG] 19:02:12: Identifier: aa660928-8e02-47c1-bb49-69f2ea446d34 [DEBUG] 19:02:12: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * [DEBUG] 19:02:12: Found the following GARDENA sensor: [DEBUG] 19:02:12: Name: Sonde [DEBUG] 19:02:12: Identifier: 62f42561-495b-4609-b3c4-9d1fad2231d6 [DEBUG] 19:02:12: Corresponding Fibaro virtual device is 18 [DEBUG] 19:02:12: Last on-line: 25-03-2018 at 16:51 [DEBUG] 19:02:12: Battery level is 6 % [DEBUG] 19:02:12: Battery health is Low [DEBUG] 19:02:12: Signal quality is 40 % [DEBUG] 19:02:12: Connection status is unknown [DEBUG] 19:02:12: Radio link is poor [DEBUG] 19:02:12: Ambient temperature is 12 °C [DEBUG] 19:02:12: No frost warning [DEBUG] 19:02:12: Soil temperature is 11 °C [DEBUG] 19:02:12: Soil humidity is 91 % [DEBUG] 19:02:12: Light intensity is 4678 lx [DEBUG] 19:02:12: Firmware is up to date [DEBUG] 19:02:12: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * [DEBUG] 19:02:12: Found the following GARDENA watering_computer: [DEBUG] 19:02:12: Name: Voiture [DEBUG] 19:02:12: Identifier: 6e9487da-a290-43af-9576-6349670c2f55 [DEBUG] 19:02:12: Corresponding Fibaro virtual device is 19 [DEBUG] 19:02:12: Last on-line on 25-03-2018 at 16:48 [DEBUG] 19:02:12: Battery level is 82 % [DEBUG] 19:02:12: Battery health is OK [DEBUG] 19:02:12: Signal quality is 70% [DEBUG] 19:02:12: Connection status is unknown [DEBUG] 19:02:12: Radio link is good [DEBUG] 19:02:12: Water valve is closed [DEBUG] 19:02:12: Manual override is inactive [DEBUG] 19:02:12: Manual override time is 1 minutes [DEBUG] 19:02:12: Last manual override lasted 1 minutes [DEBUG] 19:02:12: Ambient temperature is 21 °C [DEBUG] 19:02:12: no frost warning [DEBUG] 19:02:12: Watering is scheduled to start on 25-03-2018 at 17:01 [DEBUG] 19:02:12: Watering is scheduled to end on 25-03-2018 at 17:01 [DEBUG] 19:02:12: Adaptive scheduling last decision skipped by adaptive scheduling [DEBUG] 19:02:12: Firmware is up to date [DEBUG] 19:02:12: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * [DEBUG] 19:02:12: Found the following GARDENA watering_computer: [DEBUG] 19:02:12: Name: Cabanon [DEBUG] 19:02:12: Identifier: f74fd322-172e-47e1-acf2-42a2db335dde [DEBUG] 19:02:12: Last on-line on 25-03-2018 at 16:34 [DEBUG] 19:02:12: Battery level is 85 % [DEBUG] 19:02:12: Battery health is OK [DEBUG] 19:02:12: Signal quality is 70% [DEBUG] 19:02:12: Connection status is unknown [DEBUG] 19:02:12: Radio link is good [DEBUG] 19:02:12: Water valve is closed [DEBUG] 19:02:12: Manual override is inactive [DEBUG] 19:02:12: Manual override time is 1 minutes [DEBUG] 19:02:12: Last manual override lasted 1 minutes [DEBUG] 19:02:12: Ambient temperature is 13 °C [DEBUG] 19:02:12: no frost warning [DEBUG] 19:02:12: Watering is scheduled to start on 25-03-2018 at 17:01 [DEBUG] 19:02:12: Watering is scheduled to end on 25-03-2018 at 17:01 [DEBUG] 19:02:12: Adaptive scheduling last decision is undefined [DEBUG] 19:02:12: Firmware is up to date [DEBUG] 19:02:12: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * [DEBUG] 19:02:12: Found the following GARDENA watering_computer: [DEBUG] 19:02:12: Name: Cuisine [DEBUG] 19:02:12: Identifier: 86163a12-f375-48e8-bba0-f0f52e13cdaf [DEBUG] 19:02:12: Last on-line on 25-03-2018 at 16:32 [DEBUG] 19:02:12: Battery level is 89 % [DEBUG] 19:02:12: Battery health is OK [DEBUG] 19:02:12: Signal quality is 60% [DEBUG] 19:02:12: Connection status is unknown [DEBUG] 19:02:12: Radio link is good [DEBUG] 19:02:12: Water valve is closed [DEBUG] 19:02:12: Manual override is inactive [DEBUG] 19:02:12: Manual override time is 1 minutes [DEBUG] 19:02:12: Last manual override lasted 1 minutes [DEBUG] 19:02:12: Ambient temperature is 13 °C [DEBUG] 19:02:12: no frost warning [DEBUG] 19:02:12: Watering is scheduled to start on 25-03-2018 at 17:01 [DEBUG] 19:02:12: Watering is scheduled to end on 25-03-2018 at 17:01 [DEBUG] 19:02:12: Adaptive scheduling last decision is undefined [DEBUG] 19:02:12: Firmware is up to date [DEBUG] 19:02:12: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * [DEBUG] 19:02:12: Found the following GARDENA watering_computer: [DEBUG] 19:02:12: Name: Balcon [DEBUG] 19:02:12: Identifier: 67f6658e-31ae-414a-a976-c89067d923e8 [DEBUG] 19:02:12: Last on-line on 25-03-2018 at 16:33 [DEBUG] 19:02:12: Battery level is 86 % [DEBUG] 19:02:12: Battery health is OK [DEBUG] 19:02:12: Signal quality is 60% [DEBUG] 19:02:12: Connection status is unknown [DEBUG] 19:02:12: Radio link is good [DEBUG] 19:02:12: Water valve is closed [DEBUG] 19:02:12: Manual override is inactive [DEBUG] 19:02:12: Manual override time is 1 minutes [DEBUG] 19:02:12: Last manual override lasted 1 minutes [DEBUG] 19:02:12: Ambient temperature is 12 °C [DEBUG] 19:02:12: no frost warning [DEBUG] 19:02:12: Watering is scheduled to start on 25-03-2018 at 17:01 [DEBUG] 19:02:12: Watering is scheduled to end on 25-03-2018 at 17:01 [DEBUG] 19:02:12: Adaptive scheduling last decision is undefined en plus a nulle part je leur ai donné une adresse ou autre chose mais si j'appuie sur un des boutons rien ne se passe!! et si je récré un autre VD pour une autre vanne dans les mêmes conditions que l'autre (donc sans rien mettre à nulle part) alors j'ai un VD qui est incomplet et qui ne marche pas (comme l'autre, lui est complet mais ne marche pas) Bref j'en si marre merci pour tes lumières
  11. Salut Je sais mais tu as l'air de connaître en code...et tu es mon seul espoir!!! Oui je l'ai faite mais elle me m'inscrit cette erreur: Dans le panneau des variables j'ai ceci: Ce qui est bizarre c'est que j'ai quelque fois des valeurs pour gardena command et gardena parameters et des fois non si je te comprends dans la scène status sous l'onglet avancé : arrêter démarrer alors oui plein de fois tu dis qu'il faut la mettre ici: mais je la trouve ou? encore un grand merci pour ta dispo
  12. Salut petite, J'ai envoyé un message hier soir à Figaro Market et il a corrigé le script: @Lionel. The issue is in the inconsistent formatting of the date stamps received from the various Gardena devices and the way that my code is able (in this case unable) to handle it. Ultimately I have got to add some code to normalise the date stamp. For now a quick fix is to apply the following small change to the smartstatus scene. Navigate to line 570, where you will find the following code: --Find GARDENA Watering Computers if v.category == "watering_computer" then for a, b in pairs(v.abilities) do for c, d in pairs(b.properties) do if (d.name == 'last_time_online') then local watering_computer_online = (MakeTimeStamp3(d.value)) In this last line, change MakeTimeStamp into MakeTimeStamp3 This cause the script to change to another function to decode the timestamp and should resolve the issue. Cheers, Barlow Maintenant le script tourne. Première question: Faut-il toujours laisser tourner le script? Ja'i crée un VD pour la sonde et ça fonctionne. Ce qui est bizarre c'est que j'ai rien dû ajouter (IP...) Maintenant j'ai crée un VD pour smart water Control Gardena mais là rien ne bouge Il faut renseigner quelque chose à quelque part? Il faudra créer 4 VD (1 pour chaque)? J'ai aussi Merci encore pour ta patience!!
  13. --[[ %% properties %% autostart %% globals --]] ------------------------------------------------------ -- Customize the following data (GARDENA smartsystem) ------------------------------------------------------ local username = 'delacoste@hotmail.com' local password = 'mot de passe' ------------------------------------------------------ local max_counter = 6 local refresh = 60 local debug = 1 ------------------------------------------------------ -- Do not change anything from this point onwards ------------------------------------------------------ local sourceTrigger = fibaro:getSourceTrigger() Debug = function ( color, message ) fibaro:debug(string.format('<%s style="color:%s;">%s', "span", color, message, "span")) end DebugError = function ( color, message ) fibaro:debug(string.format('<%s style="color:%s;">%s', "span", color, message, "span")) end Debug('orange', 'GARDENA smartsystem - Autostart') Debug('white', 'This scene runs every: ' ..(refresh/60).. ' minutes') function addGlobal(vName, vValue) local http = net.HTTPClient({timeout=5000}) requestData = json.encode({ name = vName, value = vValue }) http:request("http://127.0.0.1:11111/api/globalVariables", { options = { method = 'POST', headers = { ['Content-Type'] = 'application/json' }, data = requestData, timeout = 5000 }, success = function(resp) if tonumber(resp.status) == 201 then if (debug == 1) then Debug("green", "status: "..tostring(resp.status)..", variable: "..vName.." added, value: "..vValue) else Debug("purple", "status: "..tostring(resp.status)..", variable: "..vName) end end end, error = function(err) DebugError("red", "error: "..tostring(err)..", variable: "..vName.." adding FAILED") end }) end function matchDevices(Identifier) devices = {} local httpClient = net.HTTPClient(); httpClient:request('http://127.0.0.1:11111/api/virtualDevices', { success = function(resp) local devices = json.decode(resp.data) for i, v in pairs(devices) do if (v.properties.ip == Identifier) then local vName = string.gsub(Identifier,'[%d%-%d]',"") local vValue = tostring(v.id) if (fibaro:getGlobalValue(vName) == nil) then addGlobal(vName, vValue) -- nu fibaro:setGlobal(vName, vValue) end end end end, error = function(err) print('error = ' .. err) end, options = { method = 'GET' } }) end --end function makeLink(id) return string.format( '<a href="../devices/configuration.html?id=%u" target="_blank"'.. 'style="display:inline;color:Cyan">%u</a>', id, id) end function MakeTimeStamp1(dateString) local pattern = "(%d+)/(%d+)/(%d+),%s(%d+):(%d+)" local xday, xmonth, xyear, xhour, xminute, xseconds = dateString:match(pattern) local converted_timestamp = os.time({year = xyear, month = xmonth, day = xday, hour = xhour, min = xminute, sec = xseconds}) local converted_time = os.date("%d-%m-%Y at %H:%M",converted_timestamp); return converted_time end function MakeTimeStamp2(dateString) local pattern = "(%d+)%-(%d+)%-(%d+)T(%d+):(%d+)(%u)" local xyear, xmonth, xday, xhour, xminute, xseconds, xoffset = dateString:match(pattern) local converted_timestamp = os.time({year = xyear, month = xmonth, day = xday, hour = xhour, min = xminute, sec = xseconds}) local converted_time = os.date("%d-%m-%Y at %R",converted_timestamp); return converted_time end function MakeTimeStamp3(dateString) local pattern = "^(%d%d%d%d)-(%d%d)-(%d%d)T(%d%d):(%d%d):(%d%d)(.-)$" local xyear, xmonth, xday, xhour, xminute, xseconds, xoffset = dateString:match(pattern) local converted_timestamp = os.time({year = xyear, month = xmonth, day = xday, hour = xhour, min = xminute, sec = xseconds}) local converted_time = os.date("%d-%m-%Y at %R",converted_timestamp); return converted_time end function gAuth(nextFunction) local request_body = '{"sessions":{"email":"' .. username .. '","password":"' .. password ..'"}}' getSessionData('https://sg-api.dss.husqvarnagroup.net/sg-1/sessions', request_body, function(data) if (data.sessions ~= nil) then local token = data.sessions.token local user_id = data.sessions.user_id addGlobal('gardena_parameters', "") addGlobal('gardena_command', "") addGlobal('gardena_userid', "") addGlobal('gardena_token', "") addGlobal('gardena_location', "") fibaro:setGlobal('gardena_token', token) fibaro:setGlobal('gardena_userid', user_id) if (debug == 1) then Debug('white', 'Authentication was succesful') end gLocation() else DebugError( 'red', 'Authentication failed. Please check username and password') end end ) setTimeout(gAuth, refresh*1000); end function getSessionData(url, body, func) local http = net.HTTPClient() http:request(url, { options = { method = 'POST', headers = { ['Content-Type'] = 'application/json' }, data = body }, success = function(response) if response.status == 200 or response.status == 201 then func(json.decode(response.data)) else end end }) end function gLocation() local token = fibaro:getGlobal('gardena_token') local user_id = fibaro:getGlobal('gardena_userid') local url = 'https://sg-api.dss.husqvarnagroup.net/sg-1/locations/?user_id=' .. user_id local http = net.HTTPClient() http:request(url, { options={ headers = {['Content-Type'] = 'application/json',['X-Session'] = token}, method = 'GET', timeout = 5000 }, success = function(status) local response = json.decode(status.data) local name = response.locations[1].name local location = response.locations[1].id fibaro:setGlobal('gardena_location', location) gDevices() if (debug == 1) then Debug('white', "Locating GARDENA smartsystem devices in " ..name) Debug('yellow', "* * * * * * * * * * * * * * * * * * * * * * * * * * * * *") end end, }) end function gDevices() local token = fibaro:getGlobal('gardena_token') local user_id = fibaro:getGlobal('gardena_userid') local location = fibaro:getGlobal('gardena_location') local url = 'https://sg-api.dss.husqvarnagroup.net/sg-1/devices?locationId=' .. location local http = net.HTTPClient() http:request(url, { options={ headers = {['Content-Type'] = 'application/json',['X-Session'] = token}, method = 'GET', timeout = 5000 }, success = function(status) if status.status ~= 200 and status.status ~= 201 then print("failed"); end if status.status == 200 then local response = json.decode(status.data) local name = response.devices[1].name local device = response.devices[1].id for k,v in pairs(response.devices) do local vName = string.gsub(v.id,'[%d%-%d]',"") local vValue = tostring(v.id) local VirtualDevice = fibaro:getGlobalValue(vName) local deviceid = matchDevices(v.id) if (debug == 1) then Debug('yellow', "* * * * * * * * * * * * * * * * * * * * * * * * * * * * *") Debug('white', "Found the following GARDENA "..v.category.. ":") Debug('yellow', "Name: "..v.name) Debug('yellow', "Identifier: "..v.id) if (VirtualDevice ~= nil) then Debug("white", "Corresponding Fibaro virtual device is " ..makeLink(VirtualDevice)) end if v.category == "gateway" then end --Find GARDENA Mowers if v.category == "mower" then for a, b in pairs(v.abilities) do for c, d in pairs(b.properties) do if (d.name == 'last_time_online') then stamp_last_time_online = string.len(tostring(d.value)) if (stamp_last_time_online == 17) then local mower_online = (MakeTimeStamp2(d.value)) elseif (stamp_last_time_online == 20) then local mower_online = (MakeTimeStamp3(d.value)) if (debug == 1) then Debug("white", "Last on-line on " ..mower_online) end if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.moweronline.value", mower_online) end end elseif (d.name == 'level') then local mower_battery_level = (d.value .. " %") if (debug == 1) then Debug("white", "Battery level is " ..mower_battery_level) end if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerbatterylevel.value", mower_battery_level) end elseif (d.name == 'rechargeable_battery_status') and (d.value == 'ok') then local mower_battery_status = "OK" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerbatterystatus.value", mower_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..mower_battery_status) end elseif (d.name == 'rechargeable_battery_status') and (d.value == 'weak') then local mower_battery_status = "weak" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerbatterystatus.value", mower_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..mower_battery_status) end elseif (d.name == 'rechargeable_battery_status') and (d.value == 'undefined') then local mower_battery_status = "undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerbatterystatus.value", mower_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..mower_battery_status) end elseif (d.name == 'charging') and (d.value == false) then local mower_charging = "no" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowercharging.value", mower_charging) end if (debug == 1) then Debug("white", "Charging: " ..mower_charging) end elseif (d.name == 'charging') and (d.value == true) then local mower_charging = "yes" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowercharging.value", mower_charging) end if (debug == 1) then Debug("white", "Charging: " ..mower_charging) end elseif (d.name == 'quality') then local mower_quality = (d.value .. " %" ) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerquality.value", mower_quality) end if (debug == 1) then Debug("white", "Signal quality is " ..mower_quality) end elseif (d.name == 'connection_status') and (d.value == "unknown") then local mower_connection_status = "unknown" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerconnectionstatus.value", mower_connection_status) end if (debug == 1) then Debug("white", "Connection status is " ..mower_connection_status) end elseif (d.name == 'connection_status') and (d.value == "status_device_unreachable") then local mower_connection_status = "lost" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerconnectionstatus.value", mower_connection_status) end if (debug == 1) then Debug("white", "Connection is " ..mower_connection_status) end elseif (d.name == 'connection_status') and (d.value == "status_device_alive") then local mower_connection_status = "alive" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerconnectionstatus.value", mower_connection_status) end if (debug == 1) then Debug("white", "Connection is " ..mower_connection_status) end elseif (d.name == 'state') and d.value == "bad" then local mower_state = "bad" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstate.value", mower_state) end if (debug == 1) then Debug("white", "Radio link is " ..mower_state) end elseif (d.name == 'state') and d.value == "poor" then local mower_state = "poor" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstate.value", mower_state) end if (debug == 1) then Debug("white", "Radio link is " ..mower_state) end elseif (d.name == 'state') and d.value == "good" then local mower_state = "good" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstate.value", mower_state) end if (debug == 1) then Debug("white", "Radio link is " ..mower_state) end elseif (d.name == 'state') and d.value == "excellent" then local mower_state = "excellent" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstate.value", mower_state) end if (debug == 1) then Debug("white", "Radio link is " ..mower_state) end elseif (d.name == 'state') and d.value == "undefined" then local mower_state = "Undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstate.value", mower_state) end if (debug == 1) then Debug("white", "Radio link is " ..mower_state) end elseif (d.name == 'temperature') and (d.unit == 'C') then local mower_temperature = (d.value.. " °C") if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowertemperature.value", mower_temperature) end if (debug == 1) then Debug("white", "Ambient termperature is " ..mower_temperature) end elseif (d.name == 'temperature') and (d.unit == 'F') then local mower_temperature = (d.value.. " °F") if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowertemperature.value", mower_temperature) end if (debug == 1) then Debug("white", "Ambient termperature is " ..mower_temperature) end elseif (d.name == 'status') and (d.value == "paused") then local mower_status = "operation paused" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "ok_cutting") then local mower_status = "OK - cutting away the grass!" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "ok_searching") then local mower_status = "OK - searching" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "ok_charging") then local mower_status = "OK - charging" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "ok_leaving") then local mower_status = "OK - leaving" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "wait_updating") then local mower_status = "waiting for update to be completed" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "wait_power_up") then local mower_status = "waiting for power up to complete" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "parked_timer") then local mower_status = "parked - on timer" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "parked_park_selected") then local mower_status = "parked - per selection" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "off_disabled") then local mower_status = "off - disabled" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "off_hatch_open") then local mower_status = "off - hatch open" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "unknown") then local mower_status = "unknown" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "error") then local mower_status = "an error occurred" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "error_at_power_up") then local mower_status = "error at power up" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "off_hatch_closed") then local mower_status = "off - hatch closed" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "ok_cutting_time_overridden") then local mower_status = "OK - cutting time overridden" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "Parked_autotimer") then local mower_status = "parked - per automatic timer" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "parked_daily_limit_reached") then local mower_status = "parked - daily limit reached" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "undefined") then local mower_status = "undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'manual_operation') and (d.value == true) then local mower_manual_operation = "yes" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowermanualoperation.value", mower_manual_operation) end if (debug == 1) then Debug("white", "Manual operation: " ..mower_manual_operation) end elseif (d.name == 'manual_operation') and (d.value == false) then local mower_manual_operation = "no" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowermanualoperation.value", mower_manual_operation) end if (debug == 1) then Debug("white", "Manual operation: " ..mower_manual_operation) end elseif (d.name == 'error') and (d.value == "no_message") then local mower_error = "all clear" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowererror.value", mower_error) end if (debug == 1) then Debug("white", "Error message: " ..mower_error) end elseif (d.name == 'error') and (d.value ~= "no_message") then local mower_error = d.value if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowererror.value", mower_error) end if (debug == 1) then Debug("white", "Error message: " ..mower_error) end elseif (d.name == 'source_for_next_start') and (d.value == "no_source") then local mower_source_for_next_start = "no source" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowersourcefornextstart.value", mower_source_for_next_start) end if (debug == 1) then Debug("white", "Source for next start is " ..mower_source_for_next_start) end elseif (d.name == 'source_for_next_start') and (d.value == "completed_cutting daily_limit") then local mower_source_for_next_start = "completed cutting - reached daily limit" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowersourcefornextstart.value", mower_source_for_next_start) end if (debug == 1) then Debug("white", "Source for next start is " ..mower_source_for_next_start) end elseif (d.name == 'source_for_next_start') and (d.value == "countdown_timer") then local mower_source_for_next_start = "will resume when timer countdown is complete" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowersourcefornextstart.value", mower_source_for_next_start) end if (debug == 1) then Debug("white", "Source for next start is " ..mower_source_for_next_start) end elseif (d.name == 'source_for_next_start') and (d.value == "mower-charging") then local mower_source_for_next_start = "will resume when finished charging " if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowersourcefornextstart.value", mower_source_for_next_start) end if (debug == 1) then Debug("white", "Source for next start is " ..mower_source_for_next_start) end elseif (d.name == 'source_for_next_start') and (d.value == "completed_cutting_autotimer") then local mower_source_for_next_start = "completed cutting - according to timer" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowersourcefornextstart.value", mower_source_for_next_start) end if (debug == 1) then Debug("white", "Source for next start is " ..mower_source_for_next_start) end elseif (d.name == 'source_for_next_start') and (d.value == "undefined") then local mower_source_for_next_start = "undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowersourcefornextstart.value", mower_source_for_next_start) end if (debug == 1) then Debug("white", "Source for next start is " ..mower_source_for_next_start) end elseif (d.name == 'timestamp_next_start') then stamp_timestamp_next_start = string.len(tostring(d.value)) if (stamp_timestamp_next_start == 17) then local mower_timestamp_next_start = (MakeTimeStamp2(d.value)) elseif (stamp_timestamp_next_start == 20) then local mower_timestamp_next_start = (MakeTimeStamp3(d.value)) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowertimestampnextstart.value", mower_timestamp_next_start) end if (debug == 1) then Debug("white", "Next start on " ..mower_timestamp_next_start) end end elseif (d.name == 'override_end_time') then stamp_override_end_time = string.len(tostring(d.value)) if (stamp_override_end_time == 17) then local mower_override_end_time = (MakeTimeStamp2(d.value)) elseif (stamp_override_end_time == 20) then local mower_override_end_time = (MakeTimeStamp3(d.value)) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.moweroverrideendtime.value", mower_override_end_time) end if (debug == 1) then Debug("white", "Override end time is on " ..mower_override_end_time) end end elseif (d.name == 'firmware_status') and (d.value == "up_to_date") then local mower_firmware_status = "up to date" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerfirmwarestatus.value", mower_firmware_status) end if (debug == 1) then Debug("white", "Firmware is " ..mower_firmware_status) end end end end end --Find GARDENA Sensors if v.category == "sensor" then if (VirtualDevice ~= nil) then end for a, b in pairs(v.abilities) do for c, d in pairs(b.properties) do if (d.name == 'last_time_online') then check = tostring(d.value) if (check == "") then print ("nil value") else local sensor_online = (MakeTimeStamp3(d.value)) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensoronline.value", sensor_online) end if (debug == 1) then Debug("white", "Last on-line: " ..sensor_online) end end elseif (d.name == 'level') then local sensor_battery_level = (d.value .. " %") if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorbatterylevel.value", sensor_battery_level) end if (debug == 1) then Debug("white", "Battery level is " ..sensor_battery_level) end elseif (d.name == 'disposable_battery_status') and (d.value == 'out_of_operation') then local sensor_battery_status = "Out of operation" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorbatterystatus.value", sensor_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..sensor_battery_status) end elseif (d.name == 'disposable_battery_status') and (d.value == 'replace_now') then local sensor_battery_status = "Replace now" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorbatterystatus.value", sensor_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..sensor_battery_status) end elseif (d.name == 'disposable_battery_status') and (d.value == 'low') then local sensor_battery_status = "Low" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorbatterystatus.value", sensor_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..sensor_battery_status) end elseif (d.name == 'disposable_battery_status') and (d.value == 'ok') then local sensor_battery_status = "OK" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorbatterystatus.value", sensor_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..sensor_battery_status) end elseif (d.name == 'disposable_battery_status') and (d.value == 'undefined') then local sensor_battery_status = "Undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorbatterystatus.value", sensor_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..sensor_battery_status) end elseif (d.name == 'quality') then local sensor_quality = (d.value .. " %" ) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorquality.value", sensor_quality) end if (debug == 1) then Debug("white", "Signal quality is " ..sensor_quality) end elseif (d.name == 'connection_status') and (d.value == "unknown") then local sensor_connection_status = "unknown" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorconnectionstatus.value", sensor_connection_status) end if (debug == 1) then Debug("white", "Connection status is " ..sensor_connection_status) end elseif (d.name == 'connection_status') and (d.value == "status_device_unreachable") then local sensor_connection_status = "lost" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorconnectionstatus.value", sensor_connection_status) end if (debug == 1) then Debug("white", "Connection status is " ..sensor_connection_status) end elseif (d.name == 'connection_status') and (d.value == "status_device_alive") then local sensor_connection_status = "alive" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorconnectionstatus.value", sensor_connection_status) end if (debug == 1) then Debug("white", "Connection status is " ..sensor_connection_status) end elseif (d.name == 'state') and d.value == "bad" then local sensor_state = "bad" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorconnectionstatus.value", sensor_connection_status) end if (debug == 1) then Debug("white", "Connection status is " ..sensor_state) end elseif (d.name == 'state') and d.value == "poor" then local sensor_state = "poor" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorstate.value", sensor_state) end if (debug == 1) then Debug("white", "Radio link is " ..sensor_state) end elseif (d.name == 'state') and d.value == "good" then local sensor_state = "good" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorstate.value", sensor_state) end if (debug == 1) then Debug("white", "Radio link is " ..sensor_state) end elseif (d.name == 'state') and d.value == "undefined" then local sensor_state = "undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorstate.value", sensor_state) end if (debug == 1) then Debug("white", "Radio link is " ..sensor_state) end elseif (b.type == 'soil_temperature_sensor') and (d.name == 'temperature') and (d.unit == 'C') then local sensor_soil_temperature = (d.value .. " °C") if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorsoiltemperature.value", sensor_soil_temperature) end if (debug == 1) then Debug("white", "Soil temperature is " ..sensor_soil_temperature) end elseif (b.type == 'soil_temperature_sensor') and (d.name == 'temperature') and (d.unit == 'F') then local sensor_soil_temperature = (d.value .. " °F") if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorsoiltemperature.value", sensor_soil_temperature) end if (debug == 1) then Debug("white", "Soil temperature is " ..sensor_soil_temperature) end elseif (b.type == 'ambient_temperature_sensor') and (d.name == 'temperature') then local sensor_ambient_temperature = (d.value .. " °C" ) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorambienttemperature.value", sensor_ambient_temperature) end if (debug == 1) then Debug("white", "Ambient temperature is " .. sensor_ambient_temperature) end elseif (b.type == 'ambient_temperature_sensor') and (d.name == 'temperature') and (d.uni == 'F') then local sensor_ambient_temperature = (d.value .. " °F" ) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorambienttemperature.value", sensor_ambient_temperature) end if (debug == 1) then Debug("white", "Ambient temperature is " .. sensor_ambient_temperature) end elseif (d.name == 'frost_warning') and (d.value == "no_frost") then local sensor_frost_warning = "No frost warning" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorfrostwarning.value", sensor_frost_warning) end if (debug == 1) then Debug("white", sensor_frost_warning) end elseif (d.name == 'frost_warning') and (d.value == "frost") then local sensor_frost_warning = "Frost warning!" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorfrostwarning.value", sensor_frost_warning) end if (debug == 1) then Debug("white", sensor_frost_warning) end elseif (d.name == 'frost_warning') and (d.value == "undefined") then local sensor_frost_warning = "Frost warning status undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorfrostwarning.value", sensor_frost_warning) end if (debug == 1) then Debug("white", sensor_frost_warning) end elseif (d.name == 'humidity') then local sensor_humidity = (d.value .. " %") if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorhumidity.value", sensor_humidity) end if (debug == 1) then Debug("white", "Soil humidity is " ..sensor_humidity) end elseif (d.name == 'light') then local sensor_light = (d.value.. " lx") if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorlight.value", sensor_light) end if (debug == 1) then Debug("white", "Light intensity is " ..sensor_light) end elseif (d.name == 'firmware_status') and (d.value == "up_to_date") then local sensor_firmware_status = "up to date" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorfirmwarestatus.value", sensor_firmware_status) end if (debug == 1) then Debug("white", "Firmware is " ..sensor_firmware_status) end end end end end end --Find GARDENA Watering Computers if v.category == "watering_computer" then for a, b in pairs(v.abilities) do for c, d in pairs(b.properties) do if (d.name == 'last_time_online') then local watering_computer_online = (MakeTimeStamp1(d.value)) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputeronline.value", watering_computer_online) end if (debug == 1) then Debug("white", "Last on-line on " ..watering_computer_online) end elseif (d.name == 'level') then local watering_computer_battery_level = (d.value .. " %") if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerbatterylevel.value", watering_computer_battery_level) end if (debug == 1) then Debug("white", "Battery level is " ..watering_computer_battery_level) end elseif (d.name == 'disposable_battery_status') and (d.value == 'out_of_operation') then local watering_computer_battery_status = "Out of operation" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerbatterystatus.value", watering_computer_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..watering_computer_battery_status) end elseif (d.name == 'disposable_battery_status') and (d.value == 'replace_now') then local watering_computer_battery_status = "Replace batteries now" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerbatterystatus.value", watering_computer_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..watering_computer_battery_status) end elseif (d.name == 'disposable_battery_status') and (d.value == 'low') then local watering_computer_battery_status = "Batteries are low" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerbatterystatus.value", watering_computer_battery_status) end if (debug == 1) then Debug("white", watering_computer_battery_status) end elseif (d.name == 'disposable_battery_status') and (d.value == 'ok') then local watering_computer_battery_status = "OK" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerbatterystatus.value", watering_computer_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..watering_computer_battery_status) end elseif (d.name == 'disposable_battery_status') and (d.value == 'undefined') then local watering_computer_battery_status = "Undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerbatterystatus.value", watering_computer_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..watering_computer_battery_status) end elseif (d.name == 'quality') then local watering_computer_quality = (d.value .. "%" ) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerquality.value", watering_computer_quality) end if (debug == 1) then Debug("white", "Signal quality is " ..watering_computer_quality) end elseif (d.name == 'connection_status') and (d.value == "unknown") then local watering_computer_connection_status = "unknown" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerconnectionstatus.value", watering_computer_connection_status) end if (debug == 1) then Debug("white", "Connection status is " ..watering_computer_connection_status) end elseif (d.name == 'connection_status') and (d.value == "status_device_unreachable") then local watering_computer_connection_status = "lost" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerconnectionstatus.value", watering_computer_connection_status) end if (debug == 1) then Debug("white", "Connection status is " ..watering_computer_connection_status) end elseif (d.name == 'connection_status') and (d.value == "status_device_alive") then local watering_computer_connection_status = "alive" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerconnectionstatus.value", watering_computer_connection_status) end if (debug == 1) then Debug("white", "Connection status is " ..watering_computer_connection_status) end elseif (d.name == 'state') and d.value == "bad" then local watering_computer_state = "bad" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerstate.value", watering_computer_state) end if (debug == 1) then Debug("white", "Radio link is " ..watering_computer_state) end elseif (d.name == 'state') and d.value == "poor" then local watering_computer_state = "poor" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerstate.value", watering_computer_state) end if (debug == 1) then Debug("white", "Radio link is " ..watering_computer_state) end elseif (d.name == 'state') and d.value == "good" then local watering_computer_state = "good" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerstate.value", watering_computer_state) end if (debug == 1) then Debug("white", "Radio link is " ..watering_computer_state) end elseif (d.name == 'state') and d.value == "undefined" then local watering_computer_state = "undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerstate.value", watering_computer_state) end if (debug == 1) then Debug("white", "Radio link is " ..watering_computer_state) end elseif (d.name == 'valve_open') and (d.value == false) then local watering_computer_valve_open = "closed" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputervalveopen.value", watering_computer_valve_open) end if (debug == 1) then Debug("white", "Water valve is " ..watering_computer_valve_open) end elseif (d.name == 'valve_open') and (d.value == true) then local watering_computer_valve_open = "open" if (debug == 1) then Debug("white", "Watervalve is " ..watering_computer_valve_open) end elseif (d.name == 'manual_override') and d.value == "inactive" then local watering_computer_manual_override = "inactive" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputermanualoverride.value", watering_computer_manual_override) end if (debug == 1) then Debug("white", "Manual override is " ..watering_computer_manual_override) end elseif (d.name == 'manual_override') and d.value == "open" then local watering_computer_manual_override = "open" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputermanualoverride.value", watering_computer_manual_override) end if (debug == 1) then Debug("white", "Manual override is " ..watering_computer_manual_override) end elseif (d.name == 'manual_override') and d.value == "undefined" then local watering_computer_manual_override = "undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputermanualoverride.value", watering_computer_manual_override) end if (debug == 1) then Debug("white", "Manual override is " ..watering_computer_manual_override) end elseif (d.name == 'button_manual_override_time') then local watering_computer_button_manual_override_time = d.value.. " minutes" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerbuttonmanualoverridetime.value", watering_computer_button_manual_override_time) end if (debug == 1) then Debug("white", "Manual override time is " ..watering_computer_button_manual_override_time) end elseif (d.name == 'last_manual_override_time') then local watering_computer_last_manual_override_time = d.value.. " minutes" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerlastmanualoverridetime.value", watering_computer_last_manual_override_time) end if (debug == 1) then Debug("white", "Last manual override lasted " ..watering_computer_last_manual_override_time) end elseif (d.name == 'temperature') and (d.unit == 'C') then local watering_computer_temperature = d.value.. " °C" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputertemperature.value", watering_computer_temperature) end if (debug == 1) then Debug("white", "Ambient temperature is " .. watering_computer_temperature) end elseif (d.name == 'temperature') and (d.unit == 'F') then local watering_computer_temperature = d.value.. " °F" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputertemperature.value", watering_computer_temperature) end if (debug == 1) then Debug("white", "Ambient temperature is " .. watering_computer_temperature) end elseif (d.name == 'frost_warning') and (d.value == "no_frost") then local watering_computer_frost_warning = "no frost warning" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerfrostwarning.value", watering_computer_frost_warning) end if (debug == 1) then Debug("white", watering_computer_frost_warning) end elseif (d.name == 'frost_warning') and (d.value == "frost") then local watering_computer_frost_warning = "frost warning!" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerfrostwarning.value", watering_computer_frost_warning) end if (debug == 1) then Debug("white", watering_computer_frost_warning) end elseif (d.name == 'frost_warning') and (d.value == "undefined") then local watering_computer_frost_warning = "frost warning status undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerfrostwarning.value", watering_computer_frost_warning) end if (debug == 1) then Debug("white", watering_computer_frost_warning) end elseif (d.name == 'adaptive_scheduling_last_decision') and (d.value == "undefined") then local watering_computer_adaptive_scheduling_last_decision = "undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputeradpativeschedulinglastdecision.value", watering_computer_adaptive_scheduling_last_decision) end if (debug == 1) then Debug("white", "Adaptive scheduling last decision is " ..watering_computer_adaptive_scheduling_last_decision) end elseif (d.name == 'adaptive_scheduling_last_decision') and (d.value == "watered_sensor_timeout") then local watering_computer_adaptive_scheduling_last_decision = "timed out by soil moisture sensor" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputeradpativeschedulinglastdecision.value", watering_computer_adaptive_scheduling_last_decision) end if (debug == 1) then Debug("white", "Adaptive scheduling last decision " ..watering_computer_adaptive_scheduling_last_decision) end elseif (d.name == 'adaptive_scheduling_last_decision') and (d.value == "skipped") then local watering_computer_adaptive_scheduling_last_decision = "skipped by adaptive scheduling" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputeradpativeschedulinglastdecision.value", watering_computer_adaptive_scheduling_last_decision) end if (debug == 1) then Debug("white", "Adaptive scheduling last decision " ..watering_computer_adaptive_scheduling_last_decision) end elseif (d.name == 'adaptive_scheduling_last_decision') and (d.value == "watered") then local watering_computer_adaptive_scheduling_last_decision = "to water" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputeradpativeschedulinglastdecision.value", watering_computer_adaptive_scheduling_last_decision) end if (debug == 1) then Debug("white", "Adaptive scheduling last decision is " ..watering_computer_adaptive_scheduling_last_decision) end elseif (d.name == 'scheduled_watering_end') then local watering_computer_scheduled_watering_end = MakeTimeStamp3(d.timestamp) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerscheduledwateringend.value", watering_computer_scheduled_watering_end) end if (debug == 1) then Debug("white", "Watering is scheduled to end on " ..watering_computer_scheduled_watering_end) end elseif (d.name == 'scheduled_watering_next_start') then local watering_computer_scheduled_watering_next_start = MakeTimeStamp3(d.timestamp) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerscheduledwateringnextstart.value", watering_computer_scheduled_watering_next_start) end if (debug == 1) then Debug("white", "Watering is scheduled to start on " ..watering_computer_scheduled_watering_next_start) end elseif (d.name == 'firmware_status') and (d.value == "up_to_date") then local watering_computer_firmware_status = "up to date" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerfirmwarestatus.value", watering_computer_firmware_status) end if (debug == 1) then Debug("white", "Firmware is " ..watering_computer_firmware_status) end end end end end end end end, }) end if ( sourceTrigger["type"] == "autostart" or "manual") then gAuth() end
  14. ce que je comprends pas c'est que la sonde "passe" est il a le même format de données
  15. M*rde! J'ai fait les motifs demandées, puis enregistré... Toujours la même erreur [DEBUG] 18:47:18: GARDENA smartsystem - Autostart[DEBUG] 18:47:18: This scene runs every: 1 minutes[DEBUG] 18:47:19: Authentication was succesful[DEBUG] 18:47:19: Locating GARDENA smartsystem devices in My Garden[DEBUG] 18:47:19: * * * * * * * * * * * * * * * * * * * * * * * * * * * * *[DEBUG] 18:47:20: * * * * * * * * * * * * * * * * * * * * * * * * * * * * *[DEBUG] 18:47:20: Found the following GARDENA gateway:[DEBUG] 18:47:20: Name: Gateway[DEBUG] 18:47:20: Identifier: aa660928-8e02-47c1-bb49-69f2ea446d34[DEBUG] 18:47:20: * * * * * * * * * * * * * * * * * * * * * * * * * * * * *[DEBUG] 18:47:20: Found the following GARDENA sensor:[DEBUG] 18:47:20: Name: Sonde[DEBUG] 18:47:20: Identifier: 62f42561-495b-4609-b3c4-9d1fad2231d6[DEBUG] 18:47:20: Last on-line: 22-03-2018 at 17:41[DEBUG] 18:47:20: Battery level is 6 %[DEBUG] 18:47:20: Battery health is Low[DEBUG] 18:47:20: Signal quality is 50 %[DEBUG] 18:47:20: Connection status is unknown[DEBUG] 18:47:20: Radio link is good[DEBUG] 18:47:20: Ambient temperature is 7 °C[DEBUG] 18:47:20: No frost warning[DEBUG] 18:47:20: Soil temperature is 7 °C[DEBUG] 18:47:20: Soil humidity is 100 %[DEBUG] 18:47:20: Light intensity is 148 lx[DEBUG] 18:47:20: Firmware is up to date[DEBUG] 18:47:20: * * * * * * * * * * * * * * * * * * * * * * * * * * * * *[DEBUG] 18:47:20: Found the following GARDENA watering_computer:[DEBUG] 18:47:20: Name: Voiture [DEBUG] 18:47:20: Identifier: 6e9487da-a290-43af-9576-6349670c2f55[DEBUG] 18:47:20: [1;31m2018-03-22 18:47:20.542074 [ fatal] LUA error: /opt/fibaro/scenes/10.lua:99: field 'day' missing in date table
  16. Merci pepite, j'essaye ce soi et te redis. Mais un grand merci de t'être penché dessus.
  17. Salut pepite et merci pour ta réponse J'ai envoyé hier soir une commande test d'arrosage. Elle a été activées par l’application mobile dont tu vois une copie d'écran ci-dessous. Je vais, ce soir, essayer de restarter mon Gateway et relancer un cycle d'arrosage.Et si ça ne fonctionne toujours pas j'écrirai au Marketplace. Merci je te tiens au courant.
  18. Alors pepite, as-tu une idée??
  19. J'ai dû inscrire, comme tu me l'as demandé, les variables: gardena_token et gardena_userid c'est variables on été complétées par:
  20. On avance... mais... On voit: Gartena Gateway, c'est bon On voit la sonde, c'est bon et on voit le début d'un water Control qui se nomme voiture mais j'en ai 4 au total et il les voit pas as-tu une idée [DEBUG] 19:33:59: GARDENA smartsystem - Autostart[DEBUG] 19:33:59: This scene runs every: 1 minutes[DEBUG] 19:33:59: Authentication was succesful[DEBUG] 19:34:00: Locating GARDENA smartsystem devices in My Garden[DEBUG] 19:34:00: * * * * * * * * * * * * * * * * * * * * * * * * * * * * *[DEBUG] 19:34:01: * * * * * * * * * * * * * * * * * * * * * * * * * * * * *[DEBUG] 19:34:01: Found the following GARDENA gateway:[DEBUG] 19:34:01: Name: Gateway[DEBUG] 19:34:01: Identifier: aa660928-8e02-47c1-bb49-69f2ea446d34[DEBUG] 19:34:01: * * * * * * * * * * * * * * * * * * * * * * * * * * * * *[DEBUG] 19:34:01: Found the following GARDENA sensor:[DEBUG] 19:34:01: Name: Sonde[DEBUG] 19:34:01: Identifier: 62f42561-495b-4609-b3c4-9d1fad2231d6[DEBUG] 19:34:01: Last on-line: 21-03-2018 at 17:41[DEBUG] 19:34:01: Battery level is 7 %[DEBUG] 19:34:01: Battery health is Low[DEBUG] 19:34:01: Signal quality is 50 %[DEBUG] 19:34:01: Connection status is unknown[DEBUG] 19:34:01: Radio link is good[DEBUG] 19:34:01: Ambient temperature is 5 °C[DEBUG] 19:34:01: No frost warning[DEBUG] 19:34:01: Soil temperature is 7 °C[DEBUG] 19:34:01: Soil humidity is 100 %[DEBUG] 19:34:01: Light intensity is 140 lx[DEBUG] 19:34:01: Firmware is up to date[DEBUG] 19:34:01: * * * * * * * * * * * * * * * * * * * * * * * * * * * * *[DEBUG] 19:34:01: Found the following GARDENA watering_computer:[DEBUG] 19:34:01: Name: Voiture [DEBUG] 19:34:01: Identifier: 6e9487da-a290-43af-9576-6349670c2f55[DEBUG] 19:34:01: [1;31m2018-03-21 19:34:01.226013 [ fatal] LUA error: /opt/fibaro/scenes/10.lua:99: field 'day' missing in date table
  21. Salut pepite, Pas trop je suis un peu perdu. Tu entends quoi par recréer les variables? c'est remettre mon même username et mon password , enregistrer et relancer??? ou autre chose Mon Gateway Gardena est en wifi, tu penses que si il était en LAN ça résoudrait le problème?
  22. tu entends quoi par ça? MERCI --[[ %% properties %% autostart %% globals --]] ------------------------------------------------------ -- Customize the following data (GARDENA smartsystem) ------------------------------------------------------ local username = 'nom@hotmail.com' local password = 'mot de passe' ------------------------------------------------------ local max_counter = 6 local refresh = 60 local debug = 1 ------------------------------------------------------ -- Do not change anything from this point onwards ------------------------------------------------------ local sourceTrigger = fibaro:getSourceTrigger() Debug = function ( color, message ) fibaro:debug(string.format('<%s style="color:%s;">%s', "span", color, message, "span")) end DebugError = function ( color, message ) fibaro:debug(string.format('<%s style="color:%s;">%s', "span", color, message, "span")) end Debug('orange', 'GARDENA smartsystem - Autostart') Debug('white', 'This scene runs every: ' ..(refresh/60).. ' minutes') function addGlobal(vName, vValue) local http = net.HTTPClient({timeout=5000}) requestData = json.encode({ name = vName, value = vValue }) http:request("http://127.0.0.1:11111/api/globalVariables", { options = { method = 'POST', headers = { ['Content-Type'] = 'application/json' }, data = requestData, timeout = 5000 }, success = function(resp) if tonumber(resp.status) == 201 then if (debug == 1) then Debug("green", "status: "..tostring(resp.status)..", variable: "..vName.." added, value: "..vValue) else Debug("purple", "status: "..tostring(resp.status)..", variable: "..vName) end end end, error = function(err) DebugError("red", "error: "..tostring(err)..", variable: "..vName.." adding FAILED") end }) end function matchDevices(Identifier) devices = {} local httpClient = net.HTTPClient(); httpClient:request('http://127.0.0.1:11111/api/virtualDevices', { success = function(resp) local devices = json.decode(resp.data) for i, v in pairs(devices) do if (v.properties.ip == Identifier) then local vName = string.gsub(Identifier,'[%d%-%d]',"") local vValue = tostring(v.id) if (fibaro:getGlobalValue(vName) == nil) then addGlobal(vName, vValue) -- nu fibaro:setGlobal(vName, vValue) end end end end, error = function(err) print('error = ' .. err) end, options = { method = 'GET' } }) end --end function makeLink(id) return string.format( '<a href="../devices/configuration.html?id=%u" target="_blank"'.. 'style="display:inline;color:Cyan">%u</a>', id, id) end function MakeTimeStamp(dateString) local pattern = "(%d+)%-(%d+)%-(%d+)T(%d+):(%d+):(%d+)(%u)" local xyear, xmonth, xday, xhour, xminute, xseconds, xoffset = dateString:match(pattern) local converted_timestamp = os.time({year = xyear, month = xmonth, day = xday, hour = xhour, min = xminute, sec = xseconds}) local converted_time = os.date("%d-%m-%Y at %H:%M",converted_timestamp); return converted_time end function MakeTimeStamp2(dateString) local pattern = "(%d+)%-(%d+)%-(%d+)T(%d+):(%d+)(%u)" local xyear, xmonth, xday, xhour, xminute, xseconds, xoffset = dateString:match(pattern) local converted_timestamp = os.time({year = xyear, month = xmonth, day = xday, hour = xhour, min = xminute, sec = xseconds}) local converted_time = os.date("%d-%m-%Y at %R",converted_timestamp); return converted_time end function MakeTimeStamp3(dateString) local pattern = "^(%d%d%d%d)-(%d%d)-(%d%d)T(%d%d):(%d%d):(%d%d)(.-)$" local xyear, xmonth, xday, xhour, xminute, xseconds, xoffset = dateString:match(pattern) local converted_timestamp = os.time({year = xyear, month = xmonth, day = xday, hour = xhour, min = xminute, sec = xseconds}) local converted_time = os.date("%d-%m-%Y at %R",converted_timestamp); return converted_time end function gAuth(nextFunction) local request_body = '{"sessions":{"email":"' .. username .. '","password":"' .. password ..'"}}' getSessionData('https://sg-api.dss.husqvarnagroup.net/sg-1/sessions', request_body, function(data) if (data.sessions ~= nil) then local token = data.sessions.token local user_id = data.sessions.user_id addGlobal('gardena_parameters', "") addGlobal('gardena_command', "") addGlobal('gardena_userid', "") addGlobal('gardena_token', "") addGlobal('gardena_location', "") fibaro:setGlobal('gardena_token', token) fibaro:setGlobal('gardena_userid', user_id) if (debug == 1) then Debug('white', 'Authentication was succesful') end gLocation() else DebugError( 'red', 'Authentication failed. Please check username and password') end end ) setTimeout(gAuth, refresh*1000); end function getSessionData(url, body, func) local http = net.HTTPClient() http:request(url, { options = { method = 'POST', headers = { ['Content-Type'] = 'application/json' }, data = body }, success = function(response) if response.status == 200 or response.status == 201 then func(json.decode(response.data)) else end end }) end function gLocation() local token = fibaro:getGlobal('gardena_token') local user_id = fibaro:getGlobal('gardena_userid') local url = 'https://sg-api.dss.husqvarnagroup.net/sg-1/locations/?user_id=' .. user_id local http = net.HTTPClient() http:request(url, { options={ headers = {['Content-Type'] = 'application/json',['X-Session'] = token}, method = 'GET', timeout = 5000 }, success = function(status) local response = json.decode(status.data) local name = response.locations[1].name local location = response.locations[1].id fibaro:setGlobal('gardena_location', location) gDevices() if (debug == 1) then Debug('white', "Locating GARDENA smartsystem devices in " ..name) Debug('yellow', "* * * * * * * * * * * * * * * * * * * * * * * * * * * * *") end end, }) end function gDevices() local token = fibaro:getGlobal('gardena_token') local user_id = fibaro:getGlobal('gardena_userid') local location = fibaro:getGlobal('gardena_location') local url = 'https://sg-api.dss.husqvarnagroup.net/sg-1/devices?locationId=' .. location local http = net.HTTPClient() http:request(url, { options={ headers = {['Content-Type'] = 'application/json',['X-Session'] = token}, method = 'GET', timeout = 5000 }, success = function(status) if status.status ~= 200 and status.status ~= 201 then print("failed"); end if status.status == 200 then local response = json.decode(status.data) local name = response.devices[1].name local device = response.devices[1].id for k,v in pairs(response.devices) do local vName = string.gsub(v.id,'[%d%-%d]',"") local vValue = tostring(v.id) local VirtualDevice = fibaro:getGlobalValue(vName) local deviceid = matchDevices(v.id) if (debug == 1) then Debug('yellow', "* * * * * * * * * * * * * * * * * * * * * * * * * * * * *") Debug('white', "Found the following GARDENA "..v.category.. ":") Debug('yellow', "Name: "..v.name) Debug('yellow', "Identifier: "..v.id) if (VirtualDevice ~= nil) then Debug("white", "Corresponding Fibaro virtual device is " ..makeLink(VirtualDevice)) end if v.category == "gateway" then end --Find GARDENA Mowers if v.category == "mower" then for a, b in pairs(v.abilities) do for c, d in pairs(b.properties) do if (d.name == 'last_time_online') then stamp_last_time_online = string.len(tostring(d.value)) if (stamp_last_time_online == 17) then local mower_online = (MakeTimeStamp2(d.value)) elseif (stamp_last_time_online == 20) then local mower_online = (MakeTimeStamp3(d.value)) if (debug == 1) then Debug("white", "Last on-line on " ..mower_online) end if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.moweronline.value", mower_online) end end elseif (d.name == 'level') then local mower_battery_level = (d.value .. " %") if (debug == 1) then Debug("white", "Battery level is " ..mower_battery_level) end if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerbatterylevel.value", mower_battery_level) end elseif (d.name == 'rechargeable_battery_status') and (d.value == 'ok') then local mower_battery_status = "OK" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerbatterystatus.value", mower_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..mower_battery_status) end elseif (d.name == 'rechargeable_battery_status') and (d.value == 'weak') then local mower_battery_status = "weak" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerbatterystatus.value", mower_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..mower_battery_status) end elseif (d.name == 'rechargeable_battery_status') and (d.value == 'undefined') then local mower_battery_status = "undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerbatterystatus.value", mower_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..mower_battery_status) end elseif (d.name == 'charging') and (d.value == false) then local mower_charging = "no" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowercharging.value", mower_charging) end if (debug == 1) then Debug("white", "Charging: " ..mower_charging) end elseif (d.name == 'charging') and (d.value == true) then local mower_charging = "yes" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowercharging.value", mower_charging) end if (debug == 1) then Debug("white", "Charging: " ..mower_charging) end elseif (d.name == 'quality') then local mower_quality = (d.value .. " %" ) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerquality.value", mower_quality) end if (debug == 1) then Debug("white", "Signal quality is " ..mower_quality) end elseif (d.name == 'connection_status') and (d.value == "unknown") then local mower_connection_status = "unknown" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerconnectionstatus.value", mower_connection_status) end if (debug == 1) then Debug("white", "Connection status is " ..mower_connection_status) end elseif (d.name == 'connection_status') and (d.value == "status_device_unreachable") then local mower_connection_status = "lost" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerconnectionstatus.value", mower_connection_status) end if (debug == 1) then Debug("white", "Connection is " ..mower_connection_status) end elseif (d.name == 'connection_status') and (d.value == "status_device_alive") then local mower_connection_status = "alive" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerconnectionstatus.value", mower_connection_status) end if (debug == 1) then Debug("white", "Connection is " ..mower_connection_status) end elseif (d.name == 'state') and d.value == "bad" then local mower_state = "bad" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstate.value", mower_state) end if (debug == 1) then Debug("white", "Radio link is " ..mower_state) end elseif (d.name == 'state') and d.value == "poor" then local mower_state = "poor" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstate.value", mower_state) end if (debug == 1) then Debug("white", "Radio link is " ..mower_state) end elseif (d.name == 'state') and d.value == "good" then local mower_state = "good" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstate.value", mower_state) end if (debug == 1) then Debug("white", "Radio link is " ..mower_state) end elseif (d.name == 'state') and d.value == "excellent" then local mower_state = "excellent" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstate.value", mower_state) end if (debug == 1) then Debug("white", "Radio link is " ..mower_state) end elseif (d.name == 'state') and d.value == "undefined" then local mower_state = "Undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstate.value", mower_state) end if (debug == 1) then Debug("white", "Radio link is " ..mower_state) end elseif (d.name == 'temperature') and (d.unit == 'C') then local mower_temperature = (d.value.. " °C") if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowertemperature.value", mower_temperature) end if (debug == 1) then Debug("white", "Ambient termperature is " ..mower_temperature) end elseif (d.name == 'temperature') and (d.unit == 'F') then local mower_temperature = (d.value.. " °F") if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowertemperature.value", mower_temperature) end if (debug == 1) then Debug("white", "Ambient termperature is " ..mower_temperature) end elseif (d.name == 'status') and (d.value == "paused") then local mower_status = "operation paused" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "ok_cutting") then local mower_status = "OK - cutting away the grass!" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "ok_searching") then local mower_status = "OK - searching" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "ok_charging") then local mower_status = "OK - charging" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "ok_leaving") then local mower_status = "OK - leaving" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "wait_updating") then local mower_status = "waiting for update to be completed" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "wait_power_up") then local mower_status = "waiting for power up to complete" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "parked_timer") then local mower_status = "parked - on timer" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "parked_park_selected") then local mower_status = "parked - per selection" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "off_disabled") then local mower_status = "off - disabled" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "off_hatch_open") then local mower_status = "off - hatch open" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "unknown") then local mower_status = "unknown" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "error") then local mower_status = "an error occurred" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "error_at_power_up") then local mower_status = "error at power up" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "off_hatch_closed") then local mower_status = "off - hatch closed" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "ok_cutting_time_overridden") then local mower_status = "OK - cutting time overridden" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "Parked_autotimer") then local mower_status = "parked - per automatic timer" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "parked_daily_limit_reached") then local mower_status = "parked - daily limit reached" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'status') and (d.value == "undefined") then local mower_status = "undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerstatus.value", mower_status) end if (debug == 1) then Debug("white", "Status is " ..mower_status) end elseif (d.name == 'manual_operation') and (d.value == true) then local mower_manual_operation = "yes" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowermanualoperation.value", mower_manual_operation) end if (debug == 1) then Debug("white", "Manual operation: " ..mower_manual_operation) end elseif (d.name == 'manual_operation') and (d.value == false) then local mower_manual_operation = "no" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowermanualoperation.value", mower_manual_operation) end if (debug == 1) then Debug("white", "Manual operation: " ..mower_manual_operation) end elseif (d.name == 'error') and (d.value == "no_message") then local mower_error = "all clear" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowererror.value", mower_error) end if (debug == 1) then Debug("white", "Error message: " ..mower_error) end elseif (d.name == 'error') and (d.value ~= "no_message") then local mower_error = d.value if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowererror.value", mower_error) end if (debug == 1) then Debug("white", "Error message: " ..mower_error) end elseif (d.name == 'source_for_next_start') and (d.value == "no_source") then local mower_source_for_next_start = "no source" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowersourcefornextstart.value", mower_source_for_next_start) end if (debug == 1) then Debug("white", "Source for next start is " ..mower_source_for_next_start) end elseif (d.name == 'source_for_next_start') and (d.value == "completed_cutting daily_limit") then local mower_source_for_next_start = "completed cutting - reached daily limit" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowersourcefornextstart.value", mower_source_for_next_start) end if (debug == 1) then Debug("white", "Source for next start is " ..mower_source_for_next_start) end elseif (d.name == 'source_for_next_start') and (d.value == "countdown_timer") then local mower_source_for_next_start = "will resume when timer countdown is complete" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowersourcefornextstart.value", mower_source_for_next_start) end if (debug == 1) then Debug("white", "Source for next start is " ..mower_source_for_next_start) end elseif (d.name == 'source_for_next_start') and (d.value == "mower-charging") then local mower_source_for_next_start = "will resume when finished charging " if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowersourcefornextstart.value", mower_source_for_next_start) end if (debug == 1) then Debug("white", "Source for next start is " ..mower_source_for_next_start) end elseif (d.name == 'source_for_next_start') and (d.value == "completed_cutting_autotimer") then local mower_source_for_next_start = "completed cutting - according to timer" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowersourcefornextstart.value", mower_source_for_next_start) end if (debug == 1) then Debug("white", "Source for next start is " ..mower_source_for_next_start) end elseif (d.name == 'source_for_next_start') and (d.value == "undefined") then local mower_source_for_next_start = "undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowersourcefornextstart.value", mower_source_for_next_start) end if (debug == 1) then Debug("white", "Source for next start is " ..mower_source_for_next_start) end elseif (d.name == 'timestamp_next_start') then stamp_timestamp_next_start = string.len(tostring(d.value)) if (stamp_timestamp_next_start == 17) then local mower_timestamp_next_start = (MakeTimeStamp2(d.value)) elseif (stamp_timestamp_next_start == 20) then local mower_timestamp_next_start = (MakeTimeStamp3(d.value)) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowertimestampnextstart.value", mower_timestamp_next_start) end if (debug == 1) then Debug("white", "Next start on " ..mower_timestamp_next_start) end end elseif (d.name == 'override_end_time') then stamp_override_end_time = string.len(tostring(d.value)) if (stamp_override_end_time == 17) then local mower_override_end_time = (MakeTimeStamp2(d.value)) elseif (stamp_override_end_time == 20) then local mower_override_end_time = (MakeTimeStamp3(d.value)) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.moweroverrideendtime.value", mower_override_end_time) end if (debug == 1) then Debug("white", "Override end time is on " ..mower_override_end_time) end end elseif (d.name == 'firmware_status') and (d.value == "up_to_date") then local mower_firmware_status = "up to date" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.mowerfirmwarestatus.value", mower_firmware_status) end if (debug == 1) then Debug("white", "Firmware is " ..mower_firmware_status) end end end end end --Find GARDENA Sensors if v.category == "sensor" then if (VirtualDevice ~= nil) then end for a, b in pairs(v.abilities) do for c, d in pairs(b.properties) do if (d.name == 'last_time_online') then check = tostring(d.value) if (check == "") then print ("nil value") else local sensor_online = (MakeTimeStamp3(d.value)) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensoronline.value", sensor_online) end if (debug == 1) then Debug("white", "Last on-line: " ..sensor_online) end end elseif (d.name == 'level') then local sensor_battery_level = (d.value .. " %") if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorbatterylevel.value", sensor_battery_level) end if (debug == 1) then Debug("white", "Battery level is " ..sensor_battery_level) end elseif (d.name == 'disposable_battery_status') and (d.value == 'out_of_operation') then local sensor_battery_status = "Out of operation" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorbatterystatus.value", sensor_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..sensor_battery_status) end elseif (d.name == 'disposable_battery_status') and (d.value == 'replace_now') then local sensor_battery_status = "Replace now" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorbatterystatus.value", sensor_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..sensor_battery_status) end elseif (d.name == 'disposable_battery_status') and (d.value == 'low') then local sensor_battery_status = "Low" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorbatterystatus.value", sensor_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..sensor_battery_status) end elseif (d.name == 'disposable_battery_status') and (d.value == 'ok') then local sensor_battery_status = "OK" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorbatterystatus.value", sensor_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..sensor_battery_status) end elseif (d.name == 'disposable_battery_status') and (d.value == 'undefined') then local sensor_battery_status = "Undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorbatterystatus.value", sensor_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..sensor_battery_status) end elseif (d.name == 'quality') then local sensor_quality = (d.value .. " %" ) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorquality.value", sensor_quality) end if (debug == 1) then Debug("white", "Signal quality is " ..sensor_quality) end elseif (d.name == 'connection_status') and (d.value == "unknown") then local sensor_connection_status = "unknown" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorconnectionstatus.value", sensor_connection_status) end if (debug == 1) then Debug("white", "Connection status is " ..sensor_connection_status) end elseif (d.name == 'connection_status') and (d.value == "status_device_unreachable") then local sensor_connection_status = "lost" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorconnectionstatus.value", sensor_connection_status) end if (debug == 1) then Debug("white", "Connection status is " ..sensor_connection_status) end elseif (d.name == 'connection_status') and (d.value == "status_device_alive") then local sensor_connection_status = "alive" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorconnectionstatus.value", sensor_connection_status) end if (debug == 1) then Debug("white", "Connection status is " ..sensor_connection_status) end elseif (d.name == 'state') and d.value == "bad" then local sensor_state = "bad" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorconnectionstatus.value", sensor_connection_status) end if (debug == 1) then Debug("white", "Connection status is " ..sensor_state) end elseif (d.name == 'state') and d.value == "poor" then local sensor_state = "poor" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorstate.value", sensor_state) end if (debug == 1) then Debug("white", "Radio link is " ..sensor_state) end elseif (d.name == 'state') and d.value == "good" then local sensor_state = "good" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorstate.value", sensor_state) end if (debug == 1) then Debug("white", "Radio link is " ..sensor_state) end elseif (d.name == 'state') and d.value == "undefined" then local sensor_state = "undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorstate.value", sensor_state) end if (debug == 1) then Debug("white", "Radio link is " ..sensor_state) end elseif (b.type == 'soil_temperature_sensor') and (d.name == 'temperature') and (d.unit == 'C') then local sensor_soil_temperature = (d.value .. " °C") if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorsoiltemperature.value", sensor_soil_temperature) end if (debug == 1) then Debug("white", "Soil temperature is " ..sensor_soil_temperature) end elseif (b.type == 'soil_temperature_sensor') and (d.name == 'temperature') and (d.unit == 'F') then local sensor_soil_temperature = (d.value .. " °F") if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorsoiltemperature.value", sensor_soil_temperature) end if (debug == 1) then Debug("white", "Soil temperature is " ..sensor_soil_temperature) end elseif (b.type == 'ambient_temperature_sensor') and (d.name == 'temperature') then local sensor_ambient_temperature = (d.value .. " °C" ) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorambienttemperature.value", sensor_ambient_temperature) end if (debug == 1) then Debug("white", "Ambient temperature is " .. sensor_ambient_temperature) end elseif (b.type == 'ambient_temperature_sensor') and (d.name == 'temperature') and (d.uni == 'F') then local sensor_ambient_temperature = (d.value .. " °F" ) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorambienttemperature.value", sensor_ambient_temperature) end if (debug == 1) then Debug("white", "Ambient temperature is " .. sensor_ambient_temperature) end elseif (d.name == 'frost_warning') and (d.value == "no_frost") then local sensor_frost_warning = "No frost warning" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorfrostwarning.value", sensor_frost_warning) end if (debug == 1) then Debug("white", sensor_frost_warning) end elseif (d.name == 'frost_warning') and (d.value == "frost") then local sensor_frost_warning = "Frost warning!" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorfrostwarning.value", sensor_frost_warning) end if (debug == 1) then Debug("white", sensor_frost_warning) end elseif (d.name == 'frost_warning') and (d.value == "undefined") then local sensor_frost_warning = "Frost warning status undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorfrostwarning.value", sensor_frost_warning) end if (debug == 1) then Debug("white", sensor_frost_warning) end elseif (d.name == 'humidity') then local sensor_humidity = (d.value .. " %") if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorhumidity.value", sensor_humidity) end if (debug == 1) then Debug("white", "Soil humidity is " ..sensor_humidity) end elseif (d.name == 'light') then local sensor_light = (d.value.. " lx") if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorlight.value", sensor_light) end if (debug == 1) then Debug("white", "Light intensity is " ..sensor_light) end elseif (d.name == 'firmware_status') and (d.value == "up_to_date") then local sensor_firmware_status = "up to date" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.sensorfirmwarestatus.value", sensor_firmware_status) end if (debug == 1) then Debug("white", "Firmware is " ..sensor_firmware_status) end end end end end end --Find GARDENA Watering Computers if v.category == "watering_computer" then for a, b in pairs(v.abilities) do for c, d in pairs(b.properties) do if (d.name == 'last_time_online') then local watering_computer_online = (MakeTimeStamp(d.value)) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputeronline.value", watering_computer_online) end if (debug == 1) then Debug("white", "Last on-line on " ..watering_computer_online) end elseif (d.name == 'level') then local watering_computer_battery_level = (d.value .. " %") if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerbatterylevel.value", watering_computer_battery_level) end if (debug == 1) then Debug("white", "Battery level is " ..watering_computer_battery_level) end elseif (d.name == 'disposable_battery_status') and (d.value == 'out_of_operation') then local watering_computer_battery_status = "Out of operation" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerbatterystatus.value", watering_computer_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..watering_computer_battery_status) end elseif (d.name == 'disposable_battery_status') and (d.value == 'replace_now') then local watering_computer_battery_status = "Replace batteries now" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerbatterystatus.value", watering_computer_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..watering_computer_battery_status) end elseif (d.name == 'disposable_battery_status') and (d.value == 'low') then local watering_computer_battery_status = "Batteries are low" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerbatterystatus.value", watering_computer_battery_status) end if (debug == 1) then Debug("white", watering_computer_battery_status) end elseif (d.name == 'disposable_battery_status') and (d.value == 'ok') then local watering_computer_battery_status = "OK" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerbatterystatus.value", watering_computer_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..watering_computer_battery_status) end elseif (d.name == 'disposable_battery_status') and (d.value == 'undefined') then local watering_computer_battery_status = "Undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerbatterystatus.value", watering_computer_battery_status) end if (debug == 1) then Debug("white", "Battery health is " ..watering_computer_battery_status) end elseif (d.name == 'quality') then local watering_computer_quality = (d.value .. "%" ) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerquality.value", watering_computer_quality) end if (debug == 1) then Debug("white", "Signal quality is " ..watering_computer_quality) end elseif (d.name == 'connection_status') and (d.value == "unknown") then local watering_computer_connection_status = "unknown" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerconnectionstatus.value", watering_computer_connection_status) end if (debug == 1) then Debug("white", "Connection status is " ..watering_computer_connection_status) end elseif (d.name == 'connection_status') and (d.value == "status_device_unreachable") then local watering_computer_connection_status = "lost" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerconnectionstatus.value", watering_computer_connection_status) end if (debug == 1) then Debug("white", "Connection status is " ..watering_computer_connection_status) end elseif (d.name == 'connection_status') and (d.value == "status_device_alive") then local watering_computer_connection_status = "alive" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerconnectionstatus.value", watering_computer_connection_status) end if (debug == 1) then Debug("white", "Connection status is " ..watering_computer_connection_status) end elseif (d.name == 'state') and d.value == "bad" then local watering_computer_state = "bad" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerstate.value", watering_computer_state) end if (debug == 1) then Debug("white", "Radio link is " ..watering_computer_state) end elseif (d.name == 'state') and d.value == "poor" then local watering_computer_state = "poor" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerstate.value", watering_computer_state) end if (debug == 1) then Debug("white", "Radio link is " ..watering_computer_state) end elseif (d.name == 'state') and d.value == "good" then local watering_computer_state = "good" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerstate.value", watering_computer_state) end if (debug == 1) then Debug("white", "Radio link is " ..watering_computer_state) end elseif (d.name == 'state') and d.value == "undefined" then local watering_computer_state = "undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerstate.value", watering_computer_state) end if (debug == 1) then Debug("white", "Radio link is " ..watering_computer_state) end elseif (d.name == 'valve_open') and (d.value == false) then local watering_computer_valve_open = "closed" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputervalveopen.value", watering_computer_valve_open) end if (debug == 1) then Debug("white", "Water valve is " ..watering_computer_valve_open) end elseif (d.name == 'valve_open') and (d.value == true) then local watering_computer_valve_open = "open" if (debug == 1) then Debug("white", "Watervalve is " ..watering_computer_valve_open) end elseif (d.name == 'manual_override') and d.value == "inactive" then local watering_computer_manual_override = "inactive" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputermanualoverride.value", watering_computer_manual_override) end if (debug == 1) then Debug("white", "Manual override is " ..watering_computer_manual_override) end elseif (d.name == 'manual_override') and d.value == "open" then local watering_computer_manual_override = "open" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputermanualoverride.value", watering_computer_manual_override) end if (debug == 1) then Debug("white", "Manual override is " ..watering_computer_manual_override) end elseif (d.name == 'manual_override') and d.value == "undefined" then local watering_computer_manual_override = "undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputermanualoverride.value", watering_computer_manual_override) end if (debug == 1) then Debug("white", "Manual override is " ..watering_computer_manual_override) end elseif (d.name == 'button_manual_override_time') then local watering_computer_button_manual_override_time = d.value.. " minutes" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerbuttonmanualoverridetime.value", watering_computer_button_manual_override_time) end if (debug == 1) then Debug("white", "Manual override time is " ..watering_computer_button_manual_override_time) end elseif (d.name == 'last_manual_override_time') then local watering_computer_last_manual_override_time = d.value.. " minutes" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerlastmanualoverridetime.value", watering_computer_last_manual_override_time) end if (debug == 1) then Debug("white", "Last manual override lasted " ..watering_computer_last_manual_override_time) end elseif (d.name == 'temperature') and (d.unit == 'C') then local watering_computer_temperature = d.value.. " °C" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputertemperature.value", watering_computer_temperature) end if (debug == 1) then Debug("white", "Ambient temperature is " .. watering_computer_temperature) end elseif (d.name == 'temperature') and (d.unit == 'F') then local watering_computer_temperature = d.value.. " °F" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputertemperature.value", watering_computer_temperature) end if (debug == 1) then Debug("white", "Ambient temperature is " .. watering_computer_temperature) end elseif (d.name == 'frost_warning') and (d.value == "no_frost") then local watering_computer_frost_warning = "no frost warning" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerfrostwarning.value", watering_computer_frost_warning) end if (debug == 1) then Debug("white", watering_computer_frost_warning) end elseif (d.name == 'frost_warning') and (d.value == "frost") then local watering_computer_frost_warning = "frost warning!" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerfrostwarning.value", watering_computer_frost_warning) end if (debug == 1) then Debug("white", watering_computer_frost_warning) end elseif (d.name == 'frost_warning') and (d.value == "undefined") then local watering_computer_frost_warning = "frost warning status undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerfrostwarning.value", watering_computer_frost_warning) end if (debug == 1) then Debug("white", watering_computer_frost_warning) end elseif (d.name == 'adaptive_scheduling_last_decision') and (d.value == "undefined") then local watering_computer_adaptive_scheduling_last_decision = "undefined" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputeradpativeschedulinglastdecision.value", watering_computer_adaptive_scheduling_last_decision) end if (debug == 1) then Debug("white", "Adaptive scheduling last decision is " ..watering_computer_adaptive_scheduling_last_decision) end elseif (d.name == 'adaptive_scheduling_last_decision') and (d.value == "watered_sensor_timeout") then local watering_computer_adaptive_scheduling_last_decision = "timed out by soil moisture sensor" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputeradpativeschedulinglastdecision.value", watering_computer_adaptive_scheduling_last_decision) end if (debug == 1) then Debug("white", "Adaptive scheduling last decision " ..watering_computer_adaptive_scheduling_last_decision) end elseif (d.name == 'adaptive_scheduling_last_decision') and (d.value == "skipped") then local watering_computer_adaptive_scheduling_last_decision = "skipped by adaptive scheduling" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputeradpativeschedulinglastdecision.value", watering_computer_adaptive_scheduling_last_decision) end if (debug == 1) then Debug("white", "Adaptive scheduling last decision " ..watering_computer_adaptive_scheduling_last_decision) end elseif (d.name == 'adaptive_scheduling_last_decision') and (d.value == "watered") then local watering_computer_adaptive_scheduling_last_decision = "to water" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputeradpativeschedulinglastdecision.value", watering_computer_adaptive_scheduling_last_decision) end if (debug == 1) then Debug("white", "Adaptive scheduling last decision is " ..watering_computer_adaptive_scheduling_last_decision) end elseif (d.name == 'scheduled_watering_end') then local watering_computer_scheduled_watering_end = MakeTimeStamp3(d.timestamp) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerscheduledwateringend.value", watering_computer_scheduled_watering_end) end if (debug == 1) then Debug("white", "Watering is scheduled to end on " ..watering_computer_scheduled_watering_end) end elseif (d.name == 'scheduled_watering_next_start') then local watering_computer_scheduled_watering_next_start = MakeTimeStamp3(d.timestamp) if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerscheduledwateringnextstart.value", watering_computer_scheduled_watering_next_start) end if (debug == 1) then Debug("white", "Watering is scheduled to start on " ..watering_computer_scheduled_watering_next_start) end elseif (d.name == 'firmware_status') and (d.value == "up_to_date") then local watering_computer_firmware_status = "up to date" if (VirtualDevice ~= nil) then fibaro:call(VirtualDevice, "setProperty", "ui.wateringcomputerfirmwarestatus.value", watering_computer_firmware_status) end if (debug == 1) then Debug("white", "Firmware is " ..watering_computer_firmware_status) end end end end end end end end, }) end if ( sourceTrigger["type"] == "autostart" or "manual") then gAuth() end
  23. il me donne ce message que signifie-t'il?
  24. pepite, excuse moi pour ma naïveté mais ou as-tu trouvé cela? quel script? et comment?
  25. pepite, GARDENA-SMART-SYSTEM-COMMAND-SCENE.LUA je le copie comme nouvelle scène et je récupère ceci : le deuxième: GARDENA-SMART-SYSTEM-STATUS-SCENE.LUA J'y comprends pas grand chose. Tu peux aider svp?
×