Ankündigung

Einklappen
Keine Ankündigung bisher.

Gardena Smart System

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    Gardena Smart System

    Hallo

    Heute bekommen wir Familienzuwachs. Der Neue hört auf den Namen Sileno und seine Lieblingsbeschäftigung ist Rasen rasieren. ;-)

    Da wir den Smart Sileno bekommen, hat mich die Gardena Smart System Analyse aufhorchen lassen. Mittlerweile gibt es eine PHP Class sowie ein OpenHab Binding. Außerdem habe ich eine private Gardena API gefunden.

    Ursprung des Ganzen ist hier: Roboter Forum

    Hat sich da schon jemand für Edomi rangetraut?

    Grüße
    Martin
    Habe mich mit der Gardena Smart Sytem IOS App ein wenig beschäftigt und herausgefunden, wie die Kommunikation grundsätzlich funktioniert. Der Datenaustausch erfolgt mittels JSON. Die root URL ist: https://sg-api.dss.husqvarnagroup.net/sg-1 Man kann auch unter OSX mit Safari die Applikation aufrufen: https://sg-api.dss.husqvarnagroup.net/sg-1/index/ios/ In den Beispielen habe ich meine ID's zur Sicherheit verändert. 1.) Login Man muss user/passwort and eine URL schicken und bekommt
    ---
    Martin

    #2
    Was ich gesehen habe, gibt es mittlerweile Erweiterungen für openHab und ipSymcon. Kann man da vielleicht was für edomi modifizieren? Ich steig bei der LBS Programmierung leider noch nicht ganz durch. Leider habe ich für edomi und so derzeit wenig bis gar keine Zeit. :-(
    ---
    Martin

    Kommentar


      #3
      So, habe mir etwas in Node-Red zusammengebastelt. Ist noch nicht ganz fertig, aber ein Anfang.
      Aktuell funktioniert das Senden der Befehlt und Abruf von der Battery Info sowie dem aktuellen Mäher-Status. Werde das ganze aber noch weiter ausbauen.

      Im Code müssen die rot markierten Felder (Login-Daten) entsprechend getauscht werden. In Node-red ist die erste Funktion entsprechend anzupassen.



      Code:
      [
          {
              "id": "d882c1f6.0c179",
              "type": "tab",
              "label": "Gardena Smart"
          },
          {
              "id": "cd09b13c.cfd9",
              "type": "inject",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "",
              "payload": "",
              "payloadType": "date",
              "repeat": "",
              "crontab": "",
              "once": false,
              "x": 158,
              "y": 64.00001335144043,
              "wires": [
                  [
                      "c2a27cf8.a0f02"
                  ]
              ]
          },
          {
              "id": "c2a27cf8.a0f02",
              "type": "function",
              "z": "d882c1f6.0c179",
              "name": "",
              "func": "msg.payload = {\n    \"sessions\": {\n        \"email\": \"[COLOR=#FF0000][B]john.doe@gmail.com[/B][/COLOR]\",\n        \"password\": \"[COLOR=#FF0000][B]password[/B][/COLOR]\"\n    }\n};\n\nmsg.headers = {\n    Accept: \"application/json\"\n}\n\nreturn msg;",
              "outputs": 1,
              "noerr": 0,
              "x": 303,
              "y": 82.00001335144043,
              "wires": [
                  [
                      "eaca8b70.c6e0f8"
                  ]
              ]
          },
          {
              "id": "eaca8b70.c6e0f8",
              "type": "http request",
              "z": "d882c1f6.0c179",
              "name": "",
              "method": "POST",
              "ret": "obj",
              "url": "https://sg-api.dss.husqvarnagroup.net/sg-1/sessions",
              "tls": "",
              "x": 479,
              "y": 63.00001335144043,
              "wires": [
                  [
                      "43b5a848.81f308",
                      "4e439fb3.2bef8"
                  ]
              ]
          },
          {
              "id": "43b5a848.81f308",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "",
              "active": true,
              "console": "false",
              "complete": "false",
              "x": 784,
              "y": 85.00001335144043,
              "wires": []
          },
          {
              "id": "4e439fb3.2bef8",
              "type": "function",
              "z": "d882c1f6.0c179",
              "name": "",
              "func": "global.set(\"token\", msg.payload[\"sessions\"][\"token\"]);\nglobal.set(\"user_id\", msg.payload[\"sessions\"][\"user_id\"]);\n\nvar mytoken = global.get(\"token\"); \nvar myuserid = global.get(\"user_id\"); \n\nmsg.headers = {\n    \"Content-Type\": \"application/json\",\n    \"X-Session\": mytoken\n};\n\nvar url= \"https://sg-api.dss.husqvarnagroup.net/sg-1/locations/?user_id=\" + myuserid;\n\nmsg.url = url;\n\nreturn msg;",
              "outputs": 1,
              "noerr": 0,
              "x": 290,
              "y": 161.00001335144043,
              "wires": [
                  [
                      "ec7680e2.529bf"
                  ]
              ]
          },
          {
              "id": "ec7680e2.529bf",
              "type": "http request",
              "z": "d882c1f6.0c179",
              "name": "",
              "method": "GET",
              "ret": "obj",
              "url": "",
              "tls": "",
              "x": 477,
              "y": 172.00001335144043,
              "wires": [
                  [
                      "f0a344dd.7610a8",
                      "200422a.d86afde"
                  ]
              ]
          },
          {
              "id": "f0a344dd.7610a8",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "",
              "active": true,
              "console": "false",
              "complete": "false",
              "x": 783,
              "y": 172.00001335144043,
              "wires": []
          },
          {
              "id": "200422a.d86afde",
              "type": "function",
              "z": "d882c1f6.0c179",
              "name": "",
              "func": "global.set(\"location\", msg.payload[\"locations\"][0][\"id\"]);\n\nvar mylocation = global.get(\"location\");\nvar mytoken = global.get(\"token\"); \n\nmsg.headers = {\n    \"Content-Type\": \"application/json\",\n    \"X-Session\": mytoken\n}\n\nvar url= \"https://sg-api.dss.husqvarnagroup.net/sg-1/devices?locationId=\" + msg.payload[\"locations\"][0][\"id\"]\n\nmsg.url = url;\n\nreturn msg;",
              "outputs": 1,
              "noerr": 0,
              "x": 291,
              "y": 274.00001335144043,
              "wires": [
                  [
                      "ed5cd044.89771"
                  ]
              ]
          },
          {
              "id": "ed5cd044.89771",
              "type": "http request",
              "z": "d882c1f6.0c179",
              "name": "",
              "method": "GET",
              "ret": "obj",
              "url": "",
              "tls": "",
              "x": 482,
              "y": 287.00001335144043,
              "wires": [
                  [
                      "91c2016e.85a36",
                      "d438498c.8ec638",
                      "378f6aac.35cdf6"
                  ]
              ]
          },
          {
              "id": "91c2016e.85a36",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "",
              "active": true,
              "console": "false",
              "complete": "false",
              "x": 788,
              "y": 287.00001335144043,
              "wires": []
          },
          {
              "id": "19764180.712f0f",
              "type": "inject",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "",
              "payload": "",
              "payloadType": "date",
              "repeat": "",
              "crontab": "",
              "once": false,
              "x": 132,
              "y": 456.00001335144043,
              "wires": [
                  [
                      "6be06b84.cbb1a4"
                  ]
              ]
          },
          {
              "id": "6be06b84.cbb1a4",
              "type": "function",
              "z": "d882c1f6.0c179",
              "name": "Parken bis zum nächsten Zeitplan",
              "func": "var mower = global.get(\"mower\");\nvar mytoken = global.get(\"token\"); \nvar mylocation = global.get(\"location\"); \n\nmsg.payload = {\n    \"name\":\"park_until_next_timer\"\n};\n\nmsg.headers = {\n    \"Content-Type\": \"application/json\",\n    \"X-Session\": mytoken\n};\n\nvar url= \"https://sg-api.dss.husqvarnagroup.net/sg-1/devices/\" + mower + \"/abilities/mower/command?locationId=\" + mylocation;\n\nmsg.url = url;\n\nreturn msg;",
              "outputs": 1,
              "noerr": 0,
              "x": 366,
              "y": 455.00001335144043,
              "wires": [
                  [
                      "14a82e8a.3231f1",
                      "fb445f84.6f182"
                  ]
              ]
          },
          {
              "id": "14a82e8a.3231f1",
              "type": "http request",
              "z": "d882c1f6.0c179",
              "name": "",
              "method": "POST",
              "ret": "txt",
              "url": "",
              "tls": "",
              "x": 605,
              "y": 455.00001335144043,
              "wires": [
                  [
                      "2ddefefb.8e1ce2"
                  ]
              ]
          },
          {
              "id": "2ddefefb.8e1ce2",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "",
              "active": true,
              "console": "false",
              "complete": "false",
              "x": 776,
              "y": 456.00001335144043,
              "wires": []
          },
          {
              "id": "d438498c.8ec638",
              "type": "function",
              "z": "d882c1f6.0c179",
              "name": "",
              "func": "global.set(\"mower\", msg.payload[\"devices\"][1][\"id\"]);\n\nreturn msg;",
              "outputs": 1,
              "noerr": 0,
              "x": 639,
              "y": 326.00001335144043,
              "wires": [
                  []
              ]
          },
          {
              "id": "fb445f84.6f182",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "",
              "active": true,
              "console": "false",
              "complete": "true",
              "x": 558,
              "y": 506,
              "wires": []
          },
          {
              "id": "a47b1221.b9276",
              "type": "inject",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "",
              "payload": "",
              "payloadType": "date",
              "repeat": "",
              "crontab": "",
              "once": false,
              "x": 130,
              "y": 548.0000133514404,
              "wires": [
                  [
                      "ce7fb924.a4af28"
                  ]
              ]
          },
          {
              "id": "ce7fb924.a4af28",
              "type": "function",
              "z": "d882c1f6.0c179",
              "name": "Parken und Zeitplan pausieren",
              "func": "var mower = global.get(\"mower\");\nvar mytoken = global.get(\"token\"); \nvar mylocation = global.get(\"location\"); \n\nmsg.payload = {\n    \"name\": \"park_until_further_notice\"\n};\n\nmsg.headers = {\n    \"Content-Type\": \"application/json\",\n    \"X-Session\": mytoken\n};\n\nvar url= \"https://sg-api.dss.husqvarnagroup.net/sg-1/devices/\" + mower + \"/abilities/mower/command?locationId=\" + mylocation;\n\nmsg.url = url;\n\nreturn msg;",
              "outputs": 1,
              "noerr": 0,
              "x": 354,
              "y": 547.0000133514404,
              "wires": [
                  [
                      "45b85d44.1ad364",
                      "faa08ba3.0fcb58"
                  ]
              ]
          },
          {
              "id": "45b85d44.1ad364",
              "type": "http request",
              "z": "d882c1f6.0c179",
              "name": "",
              "method": "POST",
              "ret": "txt",
              "url": "",
              "tls": "",
              "x": 570,
              "y": 548.0000133514404,
              "wires": [
                  [
                      "b41bd16f.8fe16"
                  ]
              ]
          },
          {
              "id": "b41bd16f.8fe16",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "",
              "active": true,
              "console": "false",
              "complete": "false",
              "x": 774,
              "y": 548.0000133514404,
              "wires": []
          },
          {
              "id": "faa08ba3.0fcb58",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "",
              "active": true,
              "console": "false",
              "complete": "true",
              "x": 552,
              "y": 583.0000133514404,
              "wires": []
          },
          {
              "id": "e3b1a29.eac436",
              "type": "inject",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "",
              "payload": "",
              "payloadType": "date",
              "repeat": "",
              "crontab": "",
              "once": false,
              "x": 126,
              "y": 636.0000133514404,
              "wires": [
                  [
                      "e0cb3cb8.e2374"
                  ]
              ]
          },
          {
              "id": "e0cb3cb8.e2374",
              "type": "function",
              "z": "d882c1f6.0c179",
              "name": "Starten und Zeitpläne fortsetzen",
              "func": "var mower = global.get(\"mower\");\nvar mytoken = global.get(\"token\"); \nvar mylocation = global.get(\"location\"); \n\nmsg.payload = {\n    \"name\": \"start_resume_schedule\"\n};\n\nmsg.headers = {\n    \"Content-Type\": \"application/json\",\n    \"X-Session\": mytoken\n};\n\nvar url= \"https://sg-api.dss.husqvarnagroup.net/sg-1/devices/\" + mower + \"/abilities/mower/command?locationId=\" + mylocation;\n\nmsg.url = url;\n\nreturn msg;",
              "outputs": 1,
              "noerr": 0,
              "x": 360,
              "y": 635.0000133514404,
              "wires": [
                  [
                      "69e57a58.aecf54",
                      "4454f5c3.e9739c"
                  ]
              ]
          },
          {
              "id": "69e57a58.aecf54",
              "type": "http request",
              "z": "d882c1f6.0c179",
              "name": "",
              "method": "POST",
              "ret": "txt",
              "url": "",
              "tls": "",
              "x": 597,
              "y": 635.0000133514404,
              "wires": [
                  [
                      "d0e71ed6.c0d11"
                  ]
              ]
          },
          {
              "id": "d0e71ed6.c0d11",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "",
              "active": true,
              "console": "false",
              "complete": "false",
              "x": 770,
              "y": 636.0000133514404,
              "wires": []
          },
          {
              "id": "4454f5c3.e9739c",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "",
              "active": true,
              "console": "false",
              "complete": "true",
              "x": 548,
              "y": 671.0000133514404,
              "wires": []
          },
          {
              "id": "e44988a4.a8c2e8",
              "type": "inject",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "",
              "payload": "",
              "payloadType": "date",
              "repeat": "",
              "crontab": "",
              "once": false,
              "x": 125,
              "y": 721.0000133514404,
              "wires": [
                  [
                      "404af1bf.bc3f8"
                  ]
              ]
          },
          {
              "id": "404af1bf.bc3f8",
              "type": "function",
              "z": "d882c1f6.0c179",
              "name": "24 Stunden lang mähen",
              "func": "var mower = global.get(\"mower\");\nvar mytoken = global.get(\"token\"); \nvar mylocation = global.get(\"location\"); \n\nmsg.payload = {\n    \"name\": \"start_override_timer\",\n    \"parameters\": { \"duration\": 1440 }\n};\n\nmsg.headers = {\n    \"Content-Type\": \"application/json\",\n    \"X-Session\": mytoken\n};\n\nvar url= \"https://sg-api.dss.husqvarnagroup.net/sg-1/devices/\" + mower + \"/abilities/mower/command?locationId=\" + mylocation;\n\nmsg.url = url;\n\nreturn msg;",
              "outputs": 1,
              "noerr": 0,
              "x": 329,
              "y": 720.0000133514404,
              "wires": [
                  [
                      "ac8d3c58.0ead7",
                      "fb975689.f226c8"
                  ]
              ]
          },
          {
              "id": "ac8d3c58.0ead7",
              "type": "http request",
              "z": "d882c1f6.0c179",
              "name": "",
              "method": "POST",
              "ret": "txt",
              "url": "",
              "tls": "",
              "x": 565,
              "y": 721.0000133514404,
              "wires": [
                  [
                      "e73748ff.d6a078"
                  ]
              ]
          },
          {
              "id": "e73748ff.d6a078",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "",
              "active": true,
              "console": "false",
              "complete": "false",
              "x": 769,
              "y": 721.0000133514404,
              "wires": []
          },
          {
              "id": "fb975689.f226c8",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "",
              "active": true,
              "console": "false",
              "complete": "true",
              "x": 547,
              "y": 756.0000133514404,
              "wires": []
          },
          {
              "id": "1f9dd11d.f54aaf",
              "type": "inject",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "",
              "payload": "",
              "payloadType": "date",
              "repeat": "",
              "crontab": "",
              "once": false,
              "x": 119,
              "y": 803.0000133514404,
              "wires": [
                  [
                      "64ac8ef6.20096"
                  ]
              ]
          },
          {
              "id": "64ac8ef6.20096",
              "type": "function",
              "z": "d882c1f6.0c179",
              "name": "3 Tage mähen",
              "func": "var mower = global.get(\"mower\");\nvar mytoken = global.get(\"token\"); \nvar mylocation = global.get(\"location\"); \n\nmsg.payload = {\n    \"name\": \"start_override_timer\",\n    \"parameters\": { \"duration\": 4320 }\n};\n\nmsg.headers = {\n    \"Content-Type\": \"application/json\",\n    \"X-Session\": mytoken\n};\n\nvar url= \"https://sg-api.dss.husqvarnagroup.net/sg-1/devices/\" + mower + \"/abilities/mower/command?locationId=\" + mylocation;\n\nmsg.url = url;\n\nreturn msg;",
              "outputs": 1,
              "noerr": 0,
              "x": 293,
              "y": 802.0000133514404,
              "wires": [
                  [
                      "86032365.f8851",
                      "a2bd9cde.4ac25"
                  ]
              ]
          },
          {
              "id": "86032365.f8851",
              "type": "http request",
              "z": "d882c1f6.0c179",
              "name": "",
              "method": "POST",
              "ret": "txt",
              "url": "",
              "tls": "",
              "x": 559,
              "y": 803.0000133514404,
              "wires": [
                  [
                      "8f61ef53.ad86d"
                  ]
              ]
          },
          {
              "id": "8f61ef53.ad86d",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "",
              "active": true,
              "console": "false",
              "complete": "false",
              "x": 763,
              "y": 803.0000133514404,
              "wires": []
          },
          {
              "id": "a2bd9cde.4ac25",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "",
              "active": true,
              "console": "false",
              "complete": "true",
              "x": 541,
              "y": 838.0000133514404,
              "wires": []
          },
          {
              "id": "378f6aac.35cdf6",
              "type": "function",
              "z": "d882c1f6.0c179",
              "name": "",
              "func": "global.set(\"mower\", msg.payload[\"devices\"][1][\"id\"]);\n\nvar battery_level = { payload:msg.payload[\"devices\"][1][\"abilities\"][1][\"properties\"][0].value };\nvar battery_rechargestatus = { payload:msg.payload[\"devices\"][1][\"abilities\"][1][\"properties\"][1].value };\nvar battery_charging = { payload:msg.payload[\"devices\"][1][\"abilities\"][1][\"properties\"][2].value };\n\nvar mower_status = { payload:msg.payload[\"devices\"][1][\"abilities\"][4][\"properties\"][1].value };\n\nvar msg2 = { payload:\"second out of output 1\" };\nvar msg3 = { payload:\"third out of output 1\" };\nvar msg4 = { payload:\"only message from output 2\" };\n\nreturn [ [battery_level], [battery_rechargestatus], [battery_charging], [mower_status] ];",
              "outputs": "4",
              "noerr": 0,
              "x": 960,
              "y": 355,
              "wires": [
                  [
                      "39b0c0ac.505b2"
                  ],
                  [
                      "109af075.e71ba8"
                  ],
                  [
                      "1a15d720.6cac11"
                  ],
                  [
                      "163679ed.2577ce"
                  ]
              ]
          },
          {
              "id": "39b0c0ac.505b2",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "Battery Level",
              "active": true,
              "console": "false",
              "complete": "payload",
              "x": 1216,
              "y": 250,
              "wires": []
          },
          {
              "id": "1a15d720.6cac11",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "Battery Charging",
              "active": true,
              "console": "false",
              "complete": "payload",
              "x": 1245,
              "y": 339,
              "wires": []
          },
          {
              "id": "109af075.e71ba8",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "Battery Status",
              "active": true,
              "console": "false",
              "complete": "payload",
              "x": 1230,
              "y": 293,
              "wires": []
          },
          {
              "id": "163679ed.2577ce",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "Mower Status",
              "active": true,
              "console": "false",
              "complete": "payload",
              "x": 1234,
              "y": 386,
              "wires": []
          }
      ]
      ---
      Martin

      Kommentar


        #4
        Der vollständigkeithalber gebe ich mal ein kurzes Update, da sich an der json Ausgabe aus der Cloud was geändert hat. So wie ich das sehe, gibt es jetzt keine Temperatur mehr vom Roboter.

        Code:
        [
           {
              "id": "d882c1f6.0c179",
              "type": "tab",
              "label": "Gardena Smart"
           },
           {
              "id": "cd09b13c.cfd9",
              "type": "inject",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "",
              "payload": "",
              "payloadType": "date",
              "repeat": "900",
              "crontab": "",
              "once": true,
              "x": 110,
              "y": 80,
              "wires": [
                 [
                    "c2a27cf8.a0f02"
                 ]
              ]
           },
           {
              "id": "c2a27cf8.a0f02",
              "type": "function",
              "z": "d882c1f6.0c179",
              "name": "",
              "func": "msg.payload = {\n    \"sessions\": {\n        \"email\": \"johndoe@gmail.com\",\n        \"password\": \"PASSWORD\"\n    }\n};\n\nmsg.headers = {\n    Accept: \"application/json\"\n};\n\nreturn msg;",
              "outputs": 1,
              "noerr": 0,
              "x": 290,
              "y": 80,
              "wires": [
                 [
                    "eaca8b70.c6e0f8"
                 ]
              ]
           },
           {
              "id": "eaca8b70.c6e0f8",
              "type": "http request",
              "z": "d882c1f6.0c179",
              "name": "",
              "method": "POST",
              "ret": "obj",
              "url": "https://sg-api.dss.husqvarnagroup.net/sg-1/sessions",
              "tls": "",
              "x": 470,
              "y": 80,
              "wires": [
                 [
                    "4e439fb3.2bef8"
                 ]
              ]
           },
           {
              "id": "4e439fb3.2bef8",
              "type": "function",
              "z": "d882c1f6.0c179",
              "name": "",
              "func": "global.set(\"token\", msg.payload.sessions.token);\nglobal.set(\"user_id\", msg.payload.sessions.user_id);\n\nvar mytoken = global.get(\"token\"); \nvar myuserid = global.get(\"user_id\"); \n\nmsg.headers = {\n    \"Content-Type\": \"application/json\",\n    \"X-Session\": mytoken\n};\n\nvar url= \"https://sg-api.dss.husqvarnagroup.net/sg-1/locations/?user_id=\" + myuserid;\n\nmsg.url = url;\n\nreturn msg;",
              "outputs": 1,
              "noerr": 0,
              "x": 310,
              "y": 180,
              "wires": [
                 [
                    "ec7680e2.529bf"
                 ]
              ]
           },
           {
              "id": "ec7680e2.529bf",
              "type": "http request",
              "z": "d882c1f6.0c179",
              "name": "",
              "method": "GET",
              "ret": "obj",
              "url": "",
              "tls": "",
              "x": 490,
              "y": 180,
              "wires": [
                 [
                    "200422a.d86afde"
                 ]
              ]
           },
           {
              "id": "200422a.d86afde",
              "type": "function",
              "z": "d882c1f6.0c179",
              "name": "",
              "func": "global.set(\"location\", msg.payload[\"locations\"][0][\"id\"]);\n\nvar mylocation = global.get(\"location\");\nvar mytoken = global.get(\"token\"); \n\nmsg.headers = {\n    \"Content-Type\": \"application/json\",\n    \"X-Session\": mytoken\n}\n\nvar url= \"https://sg-api.dss.husqvarnagroup.net/sg-1/devices?locationId=\" + msg.payload[\"locations\"][0][\"id\"]\n\nmsg.url = url;\n\nreturn msg;",
              "outputs": 1,
              "noerr": 0,
              "x": 310,
              "y": 280,
              "wires": [
                 [
                    "ed5cd044.89771"
                 ]
              ]
           },
           {
              "id": "ed5cd044.89771",
              "type": "http request",
              "z": "d882c1f6.0c179",
              "name": "",
              "method": "GET",
              "ret": "obj",
              "url": "",
              "tls": "",
              "x": 490,
              "y": 280,
              "wires": [
                 [
                    "378f6aac.35cdf6",
                    "448d61ae.ff5bc"
                 ]
              ]
           },
           {
              "id": "19764180.712f0f",
              "type": "inject",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "",
              "payload": "",
              "payloadType": "date",
              "repeat": "",
              "crontab": "",
              "once": false,
              "x": 100,
              "y": 660,
              "wires": [
                 [
                    "6be06b84.cbb1a4"
                 ]
              ]
           },
           {
              "id": "6be06b84.cbb1a4",
              "type": "function",
              "z": "d882c1f6.0c179",
              "name": "Parken bis zum nächsten Zeitplan",
              "func": "var mower = global.get(\"mower\");\nvar mytoken = global.get(\"token\"); \nvar mylocation = global.get(\"location\"); \n\nmsg.payload = {\n    \"name\":\"park_until_next_timer\"\n};\n\nmsg.headers = {\n    \"Content-Type\": \"application/json\",\n    \"X-Session\": mytoken\n};\n\nvar url= \"https://sg-api.dss.husqvarnagroup.net/sg-1/devices/\" + mower + \"/abilities/mower/command?locationId=\" + mylocation;\n\nmsg.url = url;\n\nreturn msg;",
              "outputs": 1,
              "noerr": 0,
              "x": 394,
              "y": 641,
              "wires": [
                 [
                    "14a82e8a.3231f1"
                 ]
              ]
           },
           {
              "id": "14a82e8a.3231f1",
              "type": "http request",
              "z": "d882c1f6.0c179",
              "name": "",
              "method": "POST",
              "ret": "txt",
              "url": "",
              "tls": "",
              "x": 650,
              "y": 640,
              "wires": [
                 [
                    "26e4e72e.2228d8"
                 ]
              ]
           },
           {
              "id": "a47b1221.b9276",
              "type": "inject",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "",
              "payload": "",
              "payloadType": "date",
              "repeat": "",
              "crontab": "",
              "once": false,
              "x": 100,
              "y": 820,
              "wires": [
                 [
                    "ce7fb924.a4af28"
                 ]
              ]
           },
           {
              "id": "ce7fb924.a4af28",
              "type": "function",
              "z": "d882c1f6.0c179",
              "name": "Parken und Zeitplan pausieren",
              "func": "var mower = global.get(\"mower\");\nvar mytoken = global.get(\"token\"); \nvar mylocation = global.get(\"location\"); \n\nmsg.payload = {\n    \"name\": \"park_until_further_notice\"\n};\n\nmsg.headers = {\n    \"Content-Type\": \"application/json\",\n    \"X-Session\": mytoken\n};\n\nvar url= \"https://sg-api.dss.husqvarnagroup.net/sg-1/devices/\" + mower + \"/abilities/mower/command?locationId=\" + mylocation;\n\nmsg.url = url;\n\nreturn msg;",
              "outputs": 1,
              "noerr": 0,
              "x": 370,
              "y": 800,
              "wires": [
                 [
                    "cf99bc4c.4d0a8"
                 ]
              ]
           },
           {
              "id": "e3b1a29.eac436",
              "type": "inject",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "",
              "payload": "",
              "payloadType": "date",
              "repeat": "",
              "crontab": "",
              "once": false,
              "x": 100,
              "y": 960,
              "wires": [
                 [
                    "e0cb3cb8.e2374"
                 ]
              ]
           },
           {
              "id": "e0cb3cb8.e2374",
              "type": "function",
              "z": "d882c1f6.0c179",
              "name": "Starten und Zeitpläne fortsetzen",
              "func": "var mower = global.get(\"mower\");\nvar mytoken = global.get(\"token\"); \nvar mylocation = global.get(\"location\"); \n\nmsg.payload = {\n    \"name\": \"start_resume_schedule\"\n};\n\nmsg.headers = {\n    \"Content-Type\": \"application/json\",\n    \"X-Session\": mytoken\n};\n\nvar url= \"https://sg-api.dss.husqvarnagroup.net/sg-1/devices/\" + mower + \"/abilities/mower/command?locationId=\" + mylocation;\n\nmsg.url = url;\n\nreturn msg;",
              "outputs": 1,
              "noerr": 0,
              "x": 377,
              "y": 940,
              "wires": [
                 [
                    "69e57a58.aecf54"
                 ]
              ]
           },
           {
              "id": "69e57a58.aecf54",
              "type": "http request",
              "z": "d882c1f6.0c179",
              "name": "",
              "method": "POST",
              "ret": "txt",
              "url": "",
              "tls": "",
              "x": 630,
              "y": 940,
              "wires": [
                 [
                    "3386dba8.f61d44"
                 ]
              ]
           },
           {
              "id": "e44988a4.a8c2e8",
              "type": "inject",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "",
              "payload": "",
              "payloadType": "date",
              "repeat": "",
              "crontab": "",
              "once": false,
              "x": 100,
              "y": 1080,
              "wires": [
                 [
                    "404af1bf.bc3f8"
                 ]
              ]
           },
           {
              "id": "404af1bf.bc3f8",
              "type": "function",
              "z": "d882c1f6.0c179",
              "name": "24 Stunden lang mähen",
              "func": "var mower = global.get(\"mower\");\nvar mytoken = global.get(\"token\"); \nvar mylocation = global.get(\"location\"); \n\nmsg.payload = {\n    \"name\": \"start_override_timer\",\n    \"parameters\": { \"duration\": 1440 }\n};\n\nmsg.headers = {\n    \"Content-Type\": \"application/json\",\n    \"X-Session\": mytoken\n};\n\nvar url= \"https://sg-api.dss.husqvarnagroup.net/sg-1/devices/\" + mower + \"/abilities/mower/command?locationId=\" + mylocation;\n\nmsg.url = url;\n\nreturn msg;",
              "outputs": 1,
              "noerr": 0,
              "x": 345,
              "y": 1061,
              "wires": [
                 [
                    "ac8d3c58.0ead7"
                 ]
              ]
           },
           {
              "id": "ac8d3c58.0ead7",
              "type": "http request",
              "z": "d882c1f6.0c179",
              "name": "",
              "method": "POST",
              "ret": "txt",
              "url": "",
              "tls": "",
              "x": 630,
              "y": 1060,
              "wires": [
                 [
                    "fad01b26.3edd58"
                 ]
              ]
           },
           {
              "id": "1f9dd11d.f54aaf",
              "type": "inject",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "",
              "payload": "",
              "payloadType": "date",
              "repeat": "",
              "crontab": "",
              "once": false,
              "x": 100,
              "y": 1220,
              "wires": [
                 [
                    "64ac8ef6.20096"
                 ]
              ]
           },
           {
              "id": "64ac8ef6.20096",
              "type": "function",
              "z": "d882c1f6.0c179",
              "name": "3 Tage mähen",
              "func": "var mower = global.get(\"mower\");\nvar mytoken = global.get(\"token\"); \nvar mylocation = global.get(\"location\"); \n\nmsg.payload = {\n    \"name\": \"start_override_timer\",\n    \"parameters\": { \"duration\": 4320 }\n};\n\nmsg.headers = {\n    \"Content-Type\": \"application/json\",\n    \"X-Session\": mytoken\n};\n\nvar url= \"https://sg-api.dss.husqvarnagroup.net/sg-1/devices/\" + mower + \"/abilities/mower/command?locationId=\" + mylocation;\n\nmsg.url = url;\n\nreturn msg;",
              "outputs": 1,
              "noerr": 0,
              "x": 320,
              "y": 1200,
              "wires": [
                 [
                    "86032365.f8851"
                 ]
              ]
           },
           {
              "id": "86032365.f8851",
              "type": "http request",
              "z": "d882c1f6.0c179",
              "name": "",
              "method": "POST",
              "ret": "txt",
              "url": "",
              "tls": "",
              "x": 630,
              "y": 1200,
              "wires": [
                 [
                    "c4e16b78.9a3af8"
                 ]
              ]
           },
           {
              "id": "378f6aac.35cdf6",
              "type": "function",
              "z": "d882c1f6.0c179",
              "name": "",
              "func": "global.set(\"mower\", msg.payload.devices[1].id);\n\nvar battery_level = { payload:msg.payload.devices[1].abilities[1].properties[0].value };\nvar battery_rechargestatus = { payload:msg.payload.devices[1].abilities[1].properties[1].value };\nvar battery_charging = { payload:msg.payload.devices[1].abilities[1].properties[2].value };\n\nvar int_temp = { payload:msg.payload.devices[1].abilities[3].properties[0].value };\n\nvar mower_status = { payload:msg.payload.devices[1].abilities[3].properties[1].value };\nvar mower_error = { payload:msg.payload.devices[1].abilities[3].properties[2].value };\nvar mower_source_nxt_start = { payload:msg.payload.devices[1].abilities[3].properties[3].value };\nvar mower_nxt_start = { payload:msg.payload.devices[1].abilities[3].properties[4].value };\nvar mower_end_time = { payload:msg.payload.devices[1].abilities[3].properties[2].value };\n\n\nreturn  [ [battery_level], [battery_rechargestatus], [battery_charging], [int_temp], [mower_status], \n          [mower_error], [mower_source_nxt_start], [mower_nxt_start], [mower_end_time] ];",
              "outputs": "9",
              "noerr": 0,
              "x": 710,
              "y": 280,
              "wires": [
                 [
                    "39b0c0ac.505b2",
                    "d0e16c17.580bd"
                 ],
                 [
                    "109af075.e71ba8",
                    "20388791.288ca8"
                 ],
                 [
                    "1a15d720.6cac11",
                    "f70ddc46.24051"
                 ],
                 [],
                 [
                    "163679ed.2577ce",
                    "c54fd698.b6b538"
                 ],
                 [
                    "da29a02a.15b45"
                 ],
                 [
                    "84e65989.9b2e38"
                 ],
                 [
                    "5f43bf72.3d7b2",
                    "59f2202.b508ae"
                 ],
                 [
                    "7989d926.e08608",
                    "b6ed21b3.ebabf"
                 ]
              ]
           },
           {
              "id": "39b0c0ac.505b2",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "Battery Level",
              "active": false,
              "tosidebar": true,
              "console": false,
              "complete": "payload",
              "x": 970,
              "y": 60,
              "wires": []
           },
           {
              "id": "1a15d720.6cac11",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "Battery Charging",
              "active": false,
              "console": "false",
              "complete": "payload",
              "x": 950,
              "y": 180,
              "wires": []
           },
           {
              "id": "109af075.e71ba8",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "Battery Status",
              "active": false,
              "console": "false",
              "complete": "payload",
              "x": 960,
              "y": 120,
              "wires": []
           },
           {
              "id": "163679ed.2577ce",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "Mower Status",
              "active": true,
              "console": "false",
              "complete": "payload",
              "x": 960,
              "y": 300,
              "wires": []
           },
           {
              "id": "d0e16c17.580bd",
              "type": "mqtt out",
              "z": "d882c1f6.0c179",
              "name": "Battery Level (1368)",
              "topic": "edomi/set/internal/1368",
              "qos": "1",
              "retain": "true",
              "broker": "b6123d11.200b9",
              "x": 1180,
              "y": 60,
              "wires": []
           },
           {
              "id": "20388791.288ca8",
              "type": "mqtt out",
              "z": "d882c1f6.0c179",
              "name": "Battery Status (1369)",
              "topic": "edomi/set/internal/1369",
              "qos": "1",
              "retain": "true",
              "broker": "b6123d11.200b9",
              "x": 1180,
              "y": 120,
              "wires": []
           },
           {
              "id": "f70ddc46.24051",
              "type": "mqtt out",
              "z": "d882c1f6.0c179",
              "name": "Battery Charging (1370)",
              "topic": "edomi/set/internal/1370",
              "qos": "1",
              "retain": "true",
              "broker": "b6123d11.200b9",
              "x": 1190,
              "y": 180,
              "wires": []
           },
           {
              "id": "aaf9e166.6a2bc",
              "type": "mqtt out",
              "z": "d882c1f6.0c179",
              "name": "Interne Temperatur (1372)",
              "topic": "edomi/set/internal/1372",
              "qos": "1",
              "retain": "true",
              "broker": "b6123d11.200b9",
              "x": 1190,
              "y": 240,
              "wires": []
           },
           {
              "id": "c54fd698.b6b538",
              "type": "mqtt out",
              "z": "d882c1f6.0c179",
              "name": "Mäher Status (1371)",
              "topic": "edomi/set/internal/1371",
              "qos": "1",
              "retain": "true",
              "broker": "b6123d11.200b9",
              "x": 1180,
              "y": 300,
              "wires": []
           },
           {
              "id": "da29a02a.15b45",
              "type": "mqtt out",
              "z": "d882c1f6.0c179",
              "name": "Mäher Fehler (1373)",
              "topic": "edomi/set/internal/1373",
              "qos": "1",
              "retain": "true",
              "broker": "b6123d11.200b9",
              "x": 1180,
              "y": 360,
              "wires": []
           },
           {
              "id": "84e65989.9b2e38",
              "type": "mqtt out",
              "z": "d882c1f6.0c179",
              "name": "Mäher Quelle nxt Start (1374)",
              "topic": "edomi/set/internal/1374",
              "qos": "1",
              "retain": "true",
              "broker": "b6123d11.200b9",
              "x": 1210,
              "y": 420,
              "wires": []
           },
           {
              "id": "5f43bf72.3d7b2",
              "type": "mqtt out",
              "z": "d882c1f6.0c179",
              "name": "Mäher nxt Start (1375)",
              "topic": "edomi/set/internal/1375",
              "qos": "1",
              "retain": "true",
              "broker": "b6123d11.200b9",
              "x": 1180,
              "y": 480,
              "wires": []
           },
           {
              "id": "7989d926.e08608",
              "type": "mqtt out",
              "z": "d882c1f6.0c179",
              "name": "Mäher End Time (1371)",
              "topic": "edomi/set/internal/1376",
              "qos": "1",
              "retain": "true",
              "broker": "b6123d11.200b9",
              "x": 1190,
              "y": 540,
              "wires": []
           },
           {
              "id": "bd0f0e3f.4854d",
              "type": "mqtt in",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "edomi/get/internal/1377",
              "qos": "1",
              "broker": "b6123d11.200b9",
              "x": 100,
              "y": 600,
              "wires": [
                 [
                    "6be06b84.cbb1a4"
                 ]
              ]
           },
           {
              "id": "2138d94e.b82d36",
              "type": "mqtt in",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "edomi/get/internal/1378",
              "qos": "1",
              "broker": "b6123d11.200b9",
              "x": 100,
              "y": 760,
              "wires": [
                 [
                    "ce7fb924.a4af28"
                 ]
              ]
           },
           {
              "id": "d7882d8a.650ce",
              "type": "mqtt in",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "edomi/get/internal/1379",
              "qos": "1",
              "broker": "b6123d11.200b9",
              "x": 100,
              "y": 900,
              "wires": [
                 [
                    "e0cb3cb8.e2374"
                 ]
              ]
           },
           {
              "id": "2de196e5.2e036a",
              "type": "mqtt in",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "edomi/get/internal/1380",
              "qos": "1",
              "broker": "b6123d11.200b9",
              "x": 100,
              "y": 1020,
              "wires": [
                 [
                    "404af1bf.bc3f8"
                 ]
              ]
           },
           {
              "id": "cbe49095.ca9d4",
              "type": "mqtt in",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "edomi/get/internal/1381",
              "qos": "1",
              "broker": "b6123d11.200b9",
              "x": 100,
              "y": 1160,
              "wires": [
                 [
                    "64ac8ef6.20096"
                 ]
              ]
           },
           {
              "id": "65345e04.4a205",
              "type": "mqtt out",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "edomi/set/internal/1382",
              "qos": "1",
              "retain": "true",
              "broker": "b6123d11.200b9",
              "x": 1273.7144,
              "y": 661.4285,
              "wires": []
           },
           {
              "id": "f7d0b1b3.be89e",
              "type": "mqtt out",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "edomi/set/internal/1383",
              "qos": "1",
              "retain": "true",
              "broker": "b6123d11.200b9",
              "x": 1294,
              "y": 797,
              "wires": []
           },
           {
              "id": "23da049e.6dbdbc",
              "type": "mqtt out",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "edomi/set/internal/1384",
              "qos": "1",
              "retain": "true",
              "broker": "b6123d11.200b9",
              "x": 1294.5714,
              "y": 943,
              "wires": []
           },
           {
              "id": "c0bdbed1.f679",
              "type": "mqtt out",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "edomi/set/internal/1385",
              "qos": "1",
              "retain": "true",
              "broker": "b6123d11.200b9",
              "x": 1290,
              "y": 1060,
              "wires": []
           },
           {
              "id": "88892465.c99568",
              "type": "mqtt out",
              "z": "d882c1f6.0c179",
              "name": "",
              "topic": "edomi/set/internal/1386",
              "qos": "1",
              "retain": "true",
              "broker": "b6123d11.200b9",
              "x": 1290,
              "y": 1200,
              "wires": []
           },
           {
              "id": "48a770fb.dc508",
              "type": "switch",
              "z": "d882c1f6.0c179",
              "name": "",
              "property": "payload",
              "propertyType": "msg",
              "rules": [
                 {
                    "t": "eq",
                    "v": "",
                    "vt": "str"
                 },
                 {
                    "t": "neq",
                    "v": "",
                    "vt": "str"
                 }
              ],
              "checkall": "true",
              "outputs": 2,
              "x": 830,
              "y": 800,
              "wires": [
                 [
                    "4b9881d9.57bce"
                 ],
                 [
                    "2d51e51b.b99d5a"
                 ]
              ]
           },
           {
              "id": "4b9881d9.57bce",
              "type": "change",
              "z": "d882c1f6.0c179",
              "name": "NULL == true",
              "rules": [
                 {
                    "t": "set",
                    "p": "payload",
                    "pt": "msg",
                    "to": "1",
                    "tot": "num"
                 }
              ],
              "action": "",
              "property": "",
              "from": "",
              "to": "",
              "reg": false,
              "x": 1020,
              "y": 780,
              "wires": [
                 [
                    "f7d0b1b3.be89e"
                 ]
              ]
           },
           {
              "id": "2d51e51b.b99d5a",
              "type": "change",
              "z": "d882c1f6.0c179",
              "name": "NOT NULL == false",
              "rules": [
                 {
                    "t": "set",
                    "p": "payload",
                    "pt": "msg",
                    "to": "0",
                    "tot": "num"
                 }
              ],
              "action": "",
              "property": "",
              "from": "",
              "to": "",
              "reg": false,
              "x": 1030,
              "y": 820,
              "wires": [
                 [
                    "f7d0b1b3.be89e"
                 ]
              ]
           },
           {
              "id": "26e4e72e.2228d8",
              "type": "switch",
              "z": "d882c1f6.0c179",
              "name": "",
              "property": "payload",
              "propertyType": "msg",
              "rules": [
                 {
                    "t": "eq",
                    "v": "",
                    "vt": "str"
                 },
                 {
                    "t": "neq",
                    "v": "",
                    "vt": "str"
                 }
              ],
              "checkall": "true",
              "outputs": 2,
              "x": 822.1429,
              "y": 671.5715,
              "wires": [
                 [
                    "bb41eb19.87dbf8"
                 ],
                 [
                    "4fa5de1b.87124"
                 ]
              ]
           },
           {
              "id": "4fa5de1b.87124",
              "type": "change",
              "z": "d882c1f6.0c179",
              "name": "NOT NULL == false",
              "rules": [
                 {
                    "t": "set",
                    "p": "payload",
                    "pt": "msg",
                    "to": "0",
                    "tot": "num"
                 }
              ],
              "action": "",
              "property": "",
              "from": "",
              "to": "",
              "reg": false,
              "x": 999.1429,
              "y": 683.5715,
              "wires": [
                 [
                    "65345e04.4a205"
                 ]
              ]
           },
           {
              "id": "bb41eb19.87dbf8",
              "type": "change",
              "z": "d882c1f6.0c179",
              "name": "NULL == true",
              "rules": [
                 {
                    "t": "set",
                    "p": "payload",
                    "pt": "msg",
                    "to": "1",
                    "tot": "num"
                 }
              ],
              "action": "",
              "property": "",
              "from": "",
              "to": "",
              "reg": false,
              "x": 1024.143,
              "y": 652.5715,
              "wires": [
                 [
                    "65345e04.4a205"
                 ]
              ]
           },
           {
              "id": "3386dba8.f61d44",
              "type": "switch",
              "z": "d882c1f6.0c179",
              "name": "",
              "property": "payload",
              "propertyType": "msg",
              "rules": [
                 {
                    "t": "eq",
                    "v": "",
                    "vt": "str"
                 },
                 {
                    "t": "neq",
                    "v": "",
                    "vt": "str"
                 }
              ],
              "checkall": "true",
              "outputs": 2,
              "x": 830,
              "y": 940,
              "wires": [
                 [
                    "222b132.883d3ec"
                 ],
                 [
                    "c061d59c.ae0818"
                 ]
              ]
           },
           {
              "id": "c061d59c.ae0818",
              "type": "change",
              "z": "d882c1f6.0c179",
              "name": "NOT NULL == false",
              "rules": [
                 {
                    "t": "set",
                    "p": "payload",
                    "pt": "msg",
                    "to": "0",
                    "tot": "num"
                 }
              ],
              "action": "",
              "property": "",
              "from": "",
              "to": "",
              "reg": false,
              "x": 1030,
              "y": 960,
              "wires": [
                 [
                    "23da049e.6dbdbc"
                 ]
              ]
           },
           {
              "id": "222b132.883d3ec",
              "type": "change",
              "z": "d882c1f6.0c179",
              "name": "NULL == true",
              "rules": [
                 {
                    "t": "set",
                    "p": "payload",
                    "pt": "msg",
                    "to": "1",
                    "tot": "num"
                 }
              ],
              "action": "",
              "property": "",
              "from": "",
              "to": "",
              "reg": false,
              "x": 1020,
              "y": 920,
              "wires": [
                 [
                    "23da049e.6dbdbc"
                 ]
              ]
           },
           {
              "id": "fad01b26.3edd58",
              "type": "switch",
              "z": "d882c1f6.0c179",
              "name": "",
              "property": "payload",
              "propertyType": "msg",
              "rules": [
                 {
                    "t": "eq",
                    "v": "",
                    "vt": "str"
                 },
                 {
                    "t": "neq",
                    "v": "",
                    "vt": "str"
                 }
              ],
              "checkall": "true",
              "outputs": 2,
              "x": 835.2857,
              "y": 1060.7144,
              "wires": [
                 [
                    "ae4380f9.62d89"
                 ],
                 [
                    "2081f304.d34e2c"
                 ]
              ]
           },
           {
              "id": "2081f304.d34e2c",
              "type": "change",
              "z": "d882c1f6.0c179",
              "name": "NOT NULL == false",
              "rules": [
                 {
                    "t": "set",
                    "p": "payload",
                    "pt": "msg",
                    "to": "0",
                    "tot": "num"
                 }
              ],
              "action": "",
              "property": "",
              "from": "",
              "to": "",
              "reg": false,
              "x": 1030,
              "y": 1080,
              "wires": [
                 [
                    "c0bdbed1.f679"
                 ]
              ]
           },
           {
              "id": "ae4380f9.62d89",
              "type": "change",
              "z": "d882c1f6.0c179",
              "name": "NULL == true",
              "rules": [
                 {
                    "t": "set",
                    "p": "payload",
                    "pt": "msg",
                    "to": "1",
                    "tot": "num"
                 }
              ],
              "action": "",
              "property": "",
              "from": "",
              "to": "",
              "reg": false,
              "x": 1020,
              "y": 1040,
              "wires": [
                 [
                    "c0bdbed1.f679"
                 ]
              ]
           },
           {
              "id": "c4e16b78.9a3af8",
              "type": "switch",
              "z": "d882c1f6.0c179",
              "name": "",
              "property": "payload",
              "propertyType": "msg",
              "rules": [
                 {
                    "t": "eq",
                    "v": "",
                    "vt": "str"
                 },
                 {
                    "t": "neq",
                    "v": "",
                    "vt": "str"
                 }
              ],
              "checkall": "true",
              "outputs": 2,
              "x": 830,
              "y": 1200,
              "wires": [
                 [
                    "bd8d294d.384908"
                 ],
                 [
                    "d871697f.61b028"
                 ]
              ]
           },
           {
              "id": "d871697f.61b028",
              "type": "change",
              "z": "d882c1f6.0c179",
              "name": "NOT NULL == false",
              "rules": [
                 {
                    "t": "set",
                    "p": "payload",
                    "pt": "msg",
                    "to": "0",
                    "tot": "num"
                 }
              ],
              "action": "",
              "property": "",
              "from": "",
              "to": "",
              "reg": false,
              "x": 1030,
              "y": 1220,
              "wires": [
                 [
                    "88892465.c99568"
                 ]
              ]
           },
           {
              "id": "bd8d294d.384908",
              "type": "change",
              "z": "d882c1f6.0c179",
              "name": "NULL == true",
              "rules": [
                 {
                    "t": "set",
                    "p": "payload",
                    "pt": "msg",
                    "to": "1",
                    "tot": "num"
                 }
              ],
              "action": "",
              "property": "",
              "from": "",
              "to": "",
              "reg": false,
              "x": 1020,
              "y": 1180,
              "wires": [
                 [
                    "88892465.c99568"
                 ]
              ]
           },
           {
              "id": "b6ed21b3.ebabf",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "End Time",
              "active": true,
              "console": "false",
              "complete": "payload",
              "x": 980,
              "y": 540,
              "wires": []
           },
           {
              "id": "59f2202.b508ae",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "Next Start",
              "active": true,
              "console": "false",
              "complete": "payload",
              "x": 980,
              "y": 480,
              "wires": []
           },
           {
              "id": "cf99bc4c.4d0a8",
              "type": "http request",
              "z": "d882c1f6.0c179",
              "name": "",
              "method": "POST",
              "ret": "txt",
              "url": "",
              "tls": "",
              "x": 630,
              "y": 800,
              "wires": [
                 [
                    "48a770fb.dc508"
                 ]
              ]
           },
           {
              "id": "448d61ae.ff5bc",
              "type": "debug",
              "z": "d882c1f6.0c179",
              "name": "",
              "active": false,
              "tosidebar": true,
              "console": false,
              "tostatus": false,
              "complete": "false",
              "x": 720,
              "y": 140,
              "wires": []
           },
           {
              "id": "b6123d11.200b9",
              "type": "mqtt-broker",
              "z": "",
              "broker": "localhost",
              "port": "1883",
              "clientid": "",
              "usetls": false,
              "compatmode": true,
              "keepalive": "60",
              "cleansession": true,
              "willTopic": "",
              "willQos": "2",
              "willRetain": "false",
              "willPayload": "",
              "birthTopic": "",
              "birthQos": "2",
              "birthRetain": "false",
              "birthPayload": ""
           }
        ]]
        ---
        Martin

        Kommentar


          #5
          Bin der LBS Programmierung leider nicht mächtig und finde keinen Einstieg, aber vielleicht kann mir ja mal jemand unter die Arme greifen.
          ---
          Martin

          Kommentar


            #6
            Würde Dir gerne helfen, leider mangelt es mir in dem Bereich auch an Skills. Aber trotzdem möchte ich Danke für die bisher investierte Mühe sagen und hoffe, dass hier jemand unterstützen kann denn ein Gardena LBS wäre top!!

            Kommentar


              #7
              Ich glaube mich zu erinnern, dass es bereits einen LBS der eine JSON ausliest gibt. Diesen könnte man - wenn notwendig - auch auf das hier benötigte Spezifika abändern ...
              Danke und LG, Dariusz
              GIRA | ENERTEX | MDT | MEANWELL | 24VDC LED | iBEMI | EDOMI | ETS5 | DS214+ | KNX/RS232-GW-ROTEL

              Kommentar


                #8
                Hallo Martin,

                nachdem ich Gestern meinen Gardena Controller mit Bodensensor und WaterControl bekommen habe, habe ich deinen Flow mal importiert.

                Und siehe da es kommen gleich Werte , als Objekt mit 3 Devices als Array.

                Deine Auswertung mit dem Mover passt hier leider nicht.

                Da ich von Java keine Spur habe, muss ich mich da wohl noch etwas einarbeiten.

                Sollte jemand hier "Starthilfe" geben können, wäre ich dankbar. Im Debug Fenster von node red kann ich jedenfalls alle Werte sehen, insofern sollte das kein großes Problem mehr sein, diese Werte per MQTT an Edomi zu geben
                object
                devices: array[3]
                0: object
                id: "5dc66a89-568f-4db9-ba40-651d73385dd0"
                name: "Gateway"
                description: "Gateway device"
                category: "gateway"
                configuration_synchronized: true
                abilities: array[2]
                configuration_synchronized_v2: object
                constraints: array[0]
                device_state: "ok"
                property_constraints: array[0]
                scheduled_events: array[0]
                scheduling_wizard_mowing: null
                settings: array[0]
                status_report_history: array[0]
                zones: array[0]
                1: object
                id: "55a63237-70d8-4aa7-bfa3-449869cbd87d"
                name: "Oben Terrasse"
                category: "sensor"
                configuration_synchronized: true
                abilities: array[9]
                configuration_synchronized_v2: object
                constraints: array[1]
                device_state: "ok"
                property_constraints: array[0]
                scheduled_events: array[0]
                scheduling_wizard_mowing: null
                settings: array[0]
                status_report_history: array[30]
                zones: array[0]
                2: object
                id: "8501c5da-3e66-424b-a6af-7111bb004fbb"
                name: "Water Control"
                category: "watering_computer"
                configuration_synchronized: true
                abilities: array[8]
                configuration_synchronized_v2: object
                constraints: array[2]
                device_state: "ok"
                property_constraints: array[1]
                scheduled_events: array[0]
                scheduling_wizard_mowing: null
                settings: array[1]
                status_report_history: array[30]
                zones: array[0]

                Angehängte Dateien
                Gruß Hartwig

                Kommentar


                  #9
                  So, mein Node Red läuft wieder und habe meine "Funktion" an die neue Firmware und die neue Ausgabe angepasst.
                  Meine "Funktion" zur Auswertung des Daten schaut ja wie folgt aus:
                  Code:
                  var battery_level = { payload:msg.payload.devices[1].abilities[1].properties[0].value };
                  var battery_charging = { payload:msg.payload.devices[1].abilities[1].properties[1].value };
                  
                  var mower_manual_op = { payload:msg.payload.devices[1].abilities[3].properties[0].value };
                  var mower_status = { payload:msg.payload.devices[1].abilities[3].properties[1].value };
                  var mower_error = { payload:msg.payload.devices[1].abilities[3].properties[2].value };
                  var mower_source_nxt_start = { payload:msg.payload.devices[1].abilities[4].properties[3].value };
                  var mower_nxt_start = { payload:msg.payload.devices[1].abilities[3].properties[5].value };
                  
                  var mower_cut_time = { payload:msg.payload.devices[1].abilities[4].properties[0].value };
                  var mower_charg_cycle = { payload:msg.payload.devices[1].abilities[4].properties[1].value };
                  var mower_collisions = { payload:msg.payload.devices[1].abilities[4].properties[2].value };
                  var mower_run_time = { payload:msg.payload.devices[1].abilities[4].properties[3].value };
                  
                  
                  return  [ [battery_level], [battery_charging], 
                          [mower_status], [mower_error], [mower_source_nxt_start], [mower_nxt_start], 
                          [mower_cut_time], [mower_charg_cycle], [mower_collisions], [mower_run_time] ];
                  Ich erstelle mir Variablen aus den einzelnen Zweigen des des JSON Outputs. "payload:msg.payload." steht immer da. "devices[x]" verzweigt auf dein entsprechendes Gerät/Produkt. 0 ist das Gateway, 1 ist bei mir der Mäher, bei dir der Sensor. Siehst du recht schon an "1: object" unter den devices. Mit den "abilities" und "properties" machst du dann genauso weiter. Die Nummerierung beginnt immer bei 0. Im Node-Red Debug Fenster siehst du die Nummerierung aber recht schön. Am Ende dann das ".value" nicht vergessen.

                  "return [ ];" gibt dann die Daten auf den entsprechenden Ausgängen der Funktion aus. Die Anzahl musst du noch manuell festlegen.

                  Ich hoffe das war verständlich.
                  ---
                  Martin

                  Kommentar


                    #10
                    Hallo Martin,

                    vielen Dank für deinen Flow.

                    Auf der Basis habe ich mal als mein erster Java Programm versucht diese zu erweitern bzw. Flexibler zu gestalten.

                    Ein Java Spezialist wird sich vermutlich eine Lachkrampf bekommen, aber das Ding funktioniert nun mit Sensoren und Water Control an den Ausgang 4 kannst Du deine Mover Ersetzungen anhängen. Mangels Mover habe ich das nicht gemacht.

                    Die Anbindung an mqtt geschieht nun über eine Ausgang.

                    Code:
                    [{"id":"37d6c4ba.8c7e0c","type":"inject","z":"3cb3339d.b0b40c","name":"","topic":"","payload":"","payloadType":"date","repeat":"300","crontab":"","once":true,"onceDelay":"","x":110,"y":80,"wires":[["b7a53ed5.29387"]]},{"id":"b7a53ed5.29387","type":"function","z":"3cb3339d.b0b40c","name":"Auth","func":"msg.payload = {\n    \"sessions\": {\n        \"email\": \"h.mattes@4-m.biz\",\n        \"password\": \"Gardena9383\"\n    }\n};\n\nmsg.headers = {\n    Accept: \"application/json\"\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":310,"y":80,"wires":[["b4a74069.b5f6c"]]},{"id":"b4a74069.b5f6c","type":"http request","z":"3cb3339d.b0b40c","name":"","method":"POST","ret":"obj","url":"https://sg-api.dss.husqvarnagroup.net/sg-1/sessions","tls":"","x":490,"y":80,"wires":[["1c48f4bd.aa4b8b"]]},{"id":"1c48f4bd.aa4b8b","type":"function","z":"3cb3339d.b0b40c","name":"token","func":"global.set(\"token\", msg.payload.sessions.token);\nglobal.set(\"user_id\", msg.payload.sessions.user_id);\n\nvar mytoken = global.get(\"token\"); \nvar myuserid = global.get(\"user_id\"); \n\nmsg.headers = {\n    \"Content-Type\": \"application/json\",\n    \"X-Session\": mytoken\n};\n\nvar url= \"https://sg-api.dss.husqvarnagroup.net/sg-1/locations/?user_id=\" + myuserid;\n\nmsg.url = url;\n\nreturn msg;","outputs":1,"noerr":0,"x":310,"y":180,"wires":[["c95172be.2b70c"]]},{"id":"c95172be.2b70c","type":"http request","z":"3cb3339d.b0b40c","name":"","method":"GET","ret":"obj","url":"","tls":"","x":490,"y":180,"wires":[["76896046.4bd8e"]]},{"id":"76896046.4bd8e","type":"function","z":"3cb3339d.b0b40c","name":"token","func":"global.set(\"location\", msg.payload[\"locations\"][0][\"id\"]);\n\nvar mylocation = global.get(\"location\");\nvar mytoken = global.get(\"token\"); \n\nmsg.headers = {\n    \"Content-Type\": \"application/json\",\n    \"X-Session\": mytoken\n}\n\nvar url= \"https://sg-api.dss.husqvarnagroup.net/sg-1/devices?locationId=\" + msg.payload[\"locations\"][0][\"id\"]\n\nmsg.url = url;\n\nreturn msg;","outputs":1,"noerr":0,"x":310,"y":280,"wires":[["2f8de2eb.ec2b2e"]]},{"id":"2f8de2eb.ec2b2e","type":"http request","z":"3cb3339d.b0b40c","name":"","method":"GET","ret":"obj","url":"","tls":"","x":570,"y":280,"wires":[["3f17187d.a2b9e8","950278d0.932cc8"]]},{"id":"3f17187d.a2b9e8","type":"debug","z":"3cb3339d.b0b40c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":810,"y":160,"wires":[]},{"id":"950278d0.932cc8","type":"function","z":"3cb3339d.b0b40c","name":"splitting","func":"//Zerlegen des Objects auf 3 Auslänge\n//Ausgang 1 = gateway\n//Ausgang 2 = sensor\n//Ausgang 3 = watering_computer\n//Ausgang 4 = mover\n\nvar msg1,msg2,msg3,msg4;\nvar anzahl=msg.payload.devices.length;\n\nfor (i=0;i<anzahl;i++){\n    category=msg.payload.devices[i].category;\n    if (category==\"gateway\"){\n        var msg1={payload: msg.payload.devices[i]};\n    }\n    if (category==\"sensor\"){\n        var msg2={payload: msg.payload.devices[i]};\n    }\n    if (category==\"watering_computer\"){\n        var msg3={payload: msg.payload.devices[i]};\n    }\n    if (category==\"mover\"){\n        var msg4={payload: msg.payload.devices[i]};\n    }\n}\nreturn [msg1,msg2,msg3,msg4];\n\n","outputs":4,"noerr":0,"x":800,"y":280,"wires":[["44eb116d.c6e79"],["75f5971.3e1b068"],["a5eae083.d53ed"],["be844a80.d5a128"]],"outputLabels":["gateway","sensor","water","mover"]},{"id":"be844a80.d5a128","type":"debug","z":"3cb3339d.b0b40c","name":"6","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":790,"y":440,"wires":[]},{"id":"75f5971.3e1b068","type":"function","z":"3cb3339d.b0b40c","name":"Sensor","func":"key=\"sensor\";\n\nnode.send({topic: \"/AS43/gardena/\"+key+\"/name\", payload: msg.payload.name});\n\nnode.send({topic: \"/AS43/gardena/\"+key+\"/battery_level\", payload: msg.payload.abilities[1].properties[0].value});   \n\nnode.send({topic: \"/AS43/gardena/\"+key+\"/temperature_air\",   payload: msg.payload.abilities[3].properties[0].value});\nnode.send({topic: \"/AS43/gardena/\"+key+\"/frost\",   payload: msg.payload.abilities[3].properties[1].value});\n\nnode.send({topic: \"/AS43/gardena/\"+key+\"/temperature_soil\",   payload: msg.payload.abilities[4].properties[0].value}); \n\nnode.send({topic: \"/AS43/gardena/\"+key+\"/soil_humidity_sensor\",   payload: msg.payload.abilities[5].properties[0].value}); \n\nnode.send({topic: \"/AS43/gardena/\"+key+\"/light_sensor\",   payload: msg.payload.abilities[6].properties[0].value}); \n\nreturn;\n\n","outputs":1,"noerr":0,"x":1220,"y":300,"wires":[["447bbab0.e69fc4"]]},{"id":"a5eae083.d53ed","type":"function","z":"3cb3339d.b0b40c","name":"watering_computer","func":"key=\"watering\";\n\nnode.send({topic: \"/AS43/gardena/\"+key+\"/name\", payload: msg.payload.name});\n\nnode.send({topic: \"/AS43/gardena\"+key+\"/battery_level\", payload: msg.payload.abilities[1].properties[0].value}); \n\n\nnode.send({topic: \"/AS43/gardena/\"+key+\"/valve_open\",   payload: msg.payload.abilities[3].properties[0].value});\nnode.send({topic: \"/AS43/gardena/\"+key+\"/manual_override\",   payload: msg.payload.abilities[3].properties[1].value});\n\nnode.send({topic: \"/AS43/gardena/\"+key+\"/button_manual_override_time\",   payload: msg.payload.abilities[3].properties[2].value}); \nnode.send({topic: \"/AS43/gardena/\"+key+\"/temperature\",   payload: msg.payload.abilities[4].properties[0].value}); \n\nnode.send({topic: \"/AS43/gardena/\"+key+\"/frost_warning\",   payload: msg.payload.abilities[6].properties[1].value}); \n\nreturn;","outputs":1,"noerr":0,"x":1250,"y":340,"wires":[["447bbab0.e69fc4"]]},{"id":"44eb116d.c6e79","type":"function","z":"3cb3339d.b0b40c","name":"Gateway","func":"key=\"gateway\";\n\nnode.send({topic: \"/AS43/gardena/\"+key+\"/name\",             payload: msg.payload.name});\nnode.send({topic: \"/AS43/gardena/\"+key+\"/device_state\",     payload: msg.payload.device_state}); \n\nnode.send({topic: \"/AS43/gardena/\"+key+\"/ip\", payload: msg.payload.abilities[1].properties[0].value});   \n\nnode.send({topic: \"/AS43/gardena/\"+key+\"/time_zone\",   payload: msg.payload.abilities[1].properties[1].value});\n\nreturn;","outputs":1,"noerr":0,"x":1220,"y":260,"wires":[["447bbab0.e69fc4"]]},{"id":"447bbab0.e69fc4","type":"mqtt out","z":"3cb3339d.b0b40c","name":"","topic":"","qos":"","retain":"","broker":"3b4b45f1.d506aa","x":1590,"y":300,"wires":[]},{"id":"3b4b45f1.d506aa","type":"mqtt-broker","z":"","name":"Broker Local","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""}]
                    Gruß Hartwig

                    Kommentar

                    Lädt...
                    X