8 min read

Xiaomi Aqara cube integration

Huh. I said 3 action button was too complicated for HA automation. No.

This is. But not as much as connecting it to Zigbee2MQTT. After an hour it finally worked so let's implement something.

This example is driving 3 light sources and occupy 2 sides per source (to get things easier I made them to be opposite of each other).

Learning new things

As I don't care about desk light no additional temperature / color will be maintained there (so still one unused side for me) but I would like to have this light in sync with my screens in office. To achieve this I need to set up multiple output function node.

This is where outputs are defined

Process of handling multiple outputs is simple enough. Instead of returning value simple return array of those.

Example:

if (msg.data.sync){
    if (msg.data.light.state == "off")
        var msg1 = msg;
    if (msg.data.light.state == "on")
        var msg2 = msg;
    return [msg1,msg2];
}

Return values will be accessible with order from top to bottom.

Side guide references to which side is facing up. Also sample of 'sideless' actions ( shake and fall ) but this is still in work

I have no use of temperature sensor right now.  

Code for importing. I hope that only colored groups needs editing

[
   {
      "id":"306a47525f702e89",
      "type":"tab",
      "label":"cube_desk",
      "disabled":false,
      "info":"",
      "env":[
         
      ]
   },
   {
      "id":"43a371d03b7865df",
      "type":"group",
      "z":"306a47525f702e89",
      "name":"Define entities",
      "style":{
         "label":true,
         "stroke":"#a4a4a4",
         "fill":"#7fb7df",
         "color":"#000000"
      },
      "nodes":[
         "8ea7819988dd3d67",
         "57da0269ca5259ab",
         "37764abf9fabb40d",
         "bf98815e5d8e4fd1",
         "5731eec56c8ca618",
         "6ca2f0ee681a6f16",
         "242ccfef004e6408",
         "3c6f0fcf7a59c205",
         "049a54588a6120a8",
         "6289946b1e0fb434"
      ],
      "x":354,
      "y":319,
      "w":472,
      "h":402
   },
   {
      "id":"46b51d3301fdd4d3",
      "type":"group",
      "z":"306a47525f702e89",
      "name":"Gather cube facts",
      "style":{
         "label":true,
         "stroke":"#a4a4a4",
         "fill":"#ffff7f",
         "color":"#000000"
      },
      "nodes":[
         "d51a48f3.382208",
         "d24e3fb2.afb36"
      ],
      "x":14,
      "y":59,
      "w":352,
      "h":82
   },
   {
      "id":"154887150fa57361",
      "type":"group",
      "z":"306a47525f702e89",
      "name":"Differentiate by action",
      "style":{
         "label":true,
         "color":"#000000"
      },
      "nodes":[
         "d75851cf7b187bcb",
         "0cb4b622f461c110"
      ],
      "x":1254,
      "y":364,
      "w":152,
      "h":312
   },
   {
      "id":"90a011a03d8e18ee",
      "type":"group",
      "z":"306a47525f702e89",
      "name":"Add additional data",
      "style":{
         "label":true,
         "color":"#000000"
      },
      "nodes":[
         "daf2160519d595db",
         "05063a5102ae3827"
      ],
      "x":1474,
      "y":559,
      "w":232,
      "h":162
   },
   {
      "id":"67667fa95c0e8ce0",
      "type":"group",
      "z":"306a47525f702e89",
      "name":"State and brightness",
      "style":{
         "label":true,
         "color":"#000000"
      },
      "nodes":[
         "8cd31846.580878",
         "970c58e7.cd8698",
         "f650506bb02e958a"
      ],
      "x":1474,
      "y":319,
      "w":212,
      "h":202
   },
   {
      "id":"5d2b4328a01c5e2e",
      "type":"group",
      "z":"306a47525f702e89",
      "name":"Change HSV or Color",
      "style":{
         "label":true
      },
      "nodes":[
         "0aa1e362d4df3ebc"
      ],
      "x":1794,
      "y":599,
      "w":272,
      "h":82
   },
   {
      "id":"849cdacc2a4e55fe",
      "type":"group",
      "z":"306a47525f702e89",
      "name":"Side Guide",
      "style":{
         "stroke":"#000000",
         "fill":"#ffffff",
         "label":true,
         "color":"#000000"
      },
      "nodes":[
         "a0d617c8814c5f44",
         "8cdcb997cac4c6e0",
         "44f3933daa241f76",
         "a2c990207a730136",
         "822c1be3834489c6",
         "bcf79b2151bfbb3c"
      ],
      "x":454,
      "y":79,
      "w":392,
      "h":202
   },
   {
      "id":"3d34411c2326b938",
      "type":"group",
      "z":"306a47525f702e89",
      "name":"Side Agnostic",
      "style":{
         "label":true
      },
      "nodes":[
         "986478f3446b8675",
         "a22337b0606c29b4"
      ],
      "x":34,
      "y":879,
      "w":372,
      "h":82
   },
   {
      "id":"5d231f779a74ebba",
      "type":"group",
      "z":"306a47525f702e89",
      "name":"Sync state",
      "style":{
         "fill":"#addb7b",
         "label":true,
         "color":"#000000"
      },
      "nodes":[
         "bbd312d5385c7525"
      ],
      "x":854,
      "y":319,
      "w":372,
      "h":82
   },
   {
      "id":"d51a48f3.382208",
      "type":"server-state-changed",
      "z":"306a47525f702e89",
      "g":"46b51d3301fdd4d3",
      "name":"cube_state",
      "server":"1b427ab1.8760e5",
      "version":4,
      "exposeToHomeAssistant":false,
      "haConfig":[
         {
            "property":"name",
            "value":""
         },
         {
            "property":"icon",
            "value":""
         }
      ],
      "entityidfilter":"sensor.kostka_biurko_action",
      "entityidfiltertype":"exact",
      "outputinitially":false,
      "state_type":"str",
      "haltifstate":"rotate_left,rotate_right,slide,tap",
      "halt_if_type":"str",
      "halt_if_compare":"includes",
      "outputs":2,
      "output_only_on_state_change":true,
      "for":"0",
      "forType":"num",
      "forUnits":"minutes",
      "ignorePrevStateNull":false,
      "ignorePrevStateUnknown":false,
      "ignorePrevStateUnavailable":false,
      "ignoreCurrentStateUnknown":false,
      "ignoreCurrentStateUnavailable":false,
      "outputProperties":[
         {
            "property":"payload",
            "propertyType":"msg",
            "value":"",
            "valueType":"entityState"
         },
         {
            "property":"topic",
            "propertyType":"msg",
            "value":"",
            "valueType":"triggerId"
         },
         {
            "property":"data.action",
            "propertyType":"msg",
            "value":"",
            "valueType":"entityState"
         }
      ],
      "x":100,
      "y":100,
      "wires":[
         [
            "d24e3fb2.afb36"
         ],
         [
            
         ]
      ]
   },
   {
      "id":"d24e3fb2.afb36",
      "type":"api-current-state",
      "z":"306a47525f702e89",
      "g":"46b51d3301fdd4d3",
      "name":"cube_side",
      "server":"1b427ab1.8760e5",
      "version":3,
      "outputs":1,
      "halt_if":"",
      "halt_if_type":"str",
      "halt_if_compare":"is",
      "entity_id":"sensor.kostka_biurko_side",
      "state_type":"str",
      "blockInputOverrides":false,
      "outputProperties":[
         {
            "property":"data.side",
            "propertyType":"msg",
            "value":"",
            "valueType":"entityState"
         }
      ],
      "for":0,
      "forType":"num",
      "forUnits":"minutes",
      "x":270,
      "y":100,
      "wires":[
         [
            "c26f3124e26eb04d"
         ]
      ]
   },
   {
      "id":"8cd31846.580878",
      "type":"api-call-service",
      "z":"306a47525f702e89",
      "g":"67667fa95c0e8ce0",
      "name":"light@-10%br",
      "server":"1b427ab1.8760e5",
      "version":5,
      "debugenabled":false,
      "domain":"light",
      "service":"turn_on",
      "areaId":[
         
      ],
      "deviceId":[
         
      ],
      "entityId":[
         "{{data.light.entity_id}}"
      ],
      "data":"{\"brightness_step_pct\":\"-10\"}",
      "dataType":"json",
      "mergeContext":"",
      "mustacheAltTags":false,
      "outputProperties":[
         
      ],
      "queue":"none",
      "output_location":"",
      "output_location_type":"none",
      "x":1580,
      "y":420,
      "wires":[
         [
            
         ]
      ]
   },
   {
      "id":"970c58e7.cd8698",
      "type":"api-call-service",
      "z":"306a47525f702e89",
      "g":"67667fa95c0e8ce0",
      "name":"light@+10%br",
      "server":"1b427ab1.8760e5",
      "version":5,
      "debugenabled":false,
      "domain":"light",
      "service":"turn_on",
      "areaId":[
         
      ],
      "deviceId":[
         
      ],
      "entityId":[
         "{{data.light.entity_id}}"
      ],
      "data":"{\"brightness_step_pct\":\"10\"}",
      "dataType":"json",
      "mergeContext":"",
      "mustacheAltTags":false,
      "outputProperties":[
         {
            "property":"sent",
            "propertyType":"msg",
            "value":"",
            "valueType":"data"
         }
      ],
      "queue":"none",
      "output_location":"",
      "output_location_type":"none",
      "x":1580,
      "y":360,
      "wires":[
         [
            
         ]
      ]
   },
   {
      "id":"c26f3124e26eb04d",
      "type":"switch",
      "z":"306a47525f702e89",
      "name":"What Side",
      "property":"data.side",
      "propertyType":"msg",
      "rules":[
         {
            "t":"eq",
            "v":"0",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"1",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"5",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"4",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"2",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"3",
            "vt":"str"
         }
      ],
      "checkall":"false",
      "repair":false,
      "outputs":6,
      "x":110,
      "y":500,
      "wires":[
         [
            "8ea7819988dd3d67"
         ],
         [
            "57da0269ca5259ab"
         ],
         [
            "37764abf9fabb40d"
         ],
         [
            "bf98815e5d8e4fd1"
         ],
         [
            "5731eec56c8ca618"
         ],
         [
            
         ]
      ]
   },
   {
      "id":"d75851cf7b187bcb",
      "type":"switch",
      "z":"306a47525f702e89",
      "g":"154887150fa57361",
      "name":"Action",
      "property":"payload",
      "propertyType":"msg",
      "rules":[
         {
            "t":"eq",
            "v":"rotate_right",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"rotate_left",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"slide",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"tap",
            "vt":"str"
         }
      ],
      "checkall":"false",
      "repair":false,
      "outputs":4,
      "x":1330,
      "y":420,
      "wires":[
         [
            "970c58e7.cd8698"
         ],
         [
            "8cd31846.580878"
         ],
         [
            
         ],
         [
            "f650506bb02e958a"
         ]
      ]
   },
   {
      "id":"0cb4b622f461c110",
      "type":"switch",
      "z":"306a47525f702e89",
      "g":"154887150fa57361",
      "name":"Action",
      "property":"payload",
      "propertyType":"msg",
      "rules":[
         {
            "t":"eq",
            "v":"rotate_right",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"rotate_left",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"slide",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"tap",
            "vt":"str"
         }
      ],
      "checkall":"false",
      "repair":false,
      "outputs":4,
      "x":1330,
      "y":620,
      "wires":[
         [
            "daf2160519d595db"
         ],
         [
            "daf2160519d595db"
         ],
         [
            
         ],
         [
            "05063a5102ae3827"
         ]
      ]
   },
   {
      "id":"f650506bb02e958a",
      "type":"api-call-service",
      "z":"306a47525f702e89",
      "g":"67667fa95c0e8ce0",
      "name":"light@toggle",
      "server":"1b427ab1.8760e5",
      "version":5,
      "debugenabled":false,
      "domain":"light",
      "service":"toggle",
      "areaId":[
         
      ],
      "deviceId":[
         
      ],
      "entityId":[
         "{{data.light.entity_id}}"
      ],
      "data":"",
      "dataType":"json",
      "mergeContext":"",
      "mustacheAltTags":false,
      "outputProperties":[
         
      ],
      "queue":"none",
      "output_location":"",
      "output_location_type":"none",
      "x":1570,
      "y":480,
      "wires":[
         [
            "07f7103719bb18e0"
         ]
      ]
   },
   {
      "id":"8ea7819988dd3d67",
      "type":"api-current-state",
      "z":"306a47525f702e89",
      "g":"43a371d03b7865df",
      "name":"",
      "server":"1b427ab1.8760e5",
      "version":3,
      "outputs":1,
      "halt_if":"",
      "halt_if_type":"str",
      "halt_if_compare":"is",
      "entity_id":"light.poddasze_biurko",
      "state_type":"str",
      "blockInputOverrides":false,
      "outputProperties":[
         {
            "property":"data.light",
            "propertyType":"msg",
            "value":"",
            "valueType":"entity"
         },
         {
            "property":"data.sync",
            "propertyType":"msg",
            "value":"true",
            "valueType":"bool"
         }
      ],
      "for":"0",
      "forType":"num",
      "forUnits":"minutes",
      "override_topic":false,
      "state_location":"payload",
      "override_payload":"msg",
      "entity_location":"data",
      "override_data":"msg",
      "x":650,
      "y":360,
      "wires":[
         [
            "bbd312d5385c7525"
         ]
      ]
   },
   {
      "id":"57da0269ca5259ab",
      "type":"api-current-state",
      "z":"306a47525f702e89",
      "g":"43a371d03b7865df",
      "name":"",
      "server":"1b427ab1.8760e5",
      "version":3,
      "outputs":1,
      "halt_if":"",
      "halt_if_type":"str",
      "halt_if_compare":"is",
      "entity_id":"light.poddasze_sufit",
      "state_type":"str",
      "blockInputOverrides":false,
      "outputProperties":[
         {
            "property":"data.light",
            "propertyType":"msg",
            "value":"",
            "valueType":"entity"
         }
      ],
      "for":"0",
      "forType":"num",
      "forUnits":"minutes",
      "override_topic":false,
      "state_location":"payload",
      "override_payload":"msg",
      "entity_location":"data",
      "override_data":"msg",
      "x":640,
      "y":440,
      "wires":[
         [
            "d75851cf7b187bcb"
         ]
      ]
   },
   {
      "id":"37764abf9fabb40d",
      "type":"api-current-state",
      "z":"306a47525f702e89",
      "g":"43a371d03b7865df",
      "name":"",
      "server":"1b427ab1.8760e5",
      "version":3,
      "outputs":1,
      "halt_if":"",
      "halt_if_type":"str",
      "halt_if_compare":"is",
      "entity_id":"light.poddasze_lozko",
      "state_type":"str",
      "blockInputOverrides":false,
      "outputProperties":[
         {
            "property":"data.light",
            "propertyType":"msg",
            "value":"",
            "valueType":"entity"
         }
      ],
      "for":"0",
      "forType":"num",
      "forUnits":"minutes",
      "override_topic":false,
      "state_location":"payload",
      "override_payload":"msg",
      "entity_location":"data",
      "override_data":"msg",
      "x":640,
      "y":500,
      "wires":[
         [
            "d75851cf7b187bcb"
         ]
      ]
   },
   {
      "id":"bf98815e5d8e4fd1",
      "type":"api-current-state",
      "z":"306a47525f702e89",
      "g":"43a371d03b7865df",
      "name":"",
      "server":"1b427ab1.8760e5",
      "version":3,
      "outputs":1,
      "halt_if":"",
      "halt_if_type":"str",
      "halt_if_compare":"is",
      "entity_id":"light.poddasze_sufit",
      "state_type":"str",
      "blockInputOverrides":false,
      "outputProperties":[
         {
            "property":"data.light",
            "propertyType":"msg",
            "value":"",
            "valueType":"entity"
         }
      ],
      "for":"0",
      "forType":"num",
      "forUnits":"minutes",
      "override_topic":false,
      "state_location":"payload",
      "override_payload":"msg",
      "entity_location":"data",
      "override_data":"msg",
      "x":640,
      "y":600,
      "wires":[
         [
            "0cb4b622f461c110"
         ]
      ]
   },
   {
      "id":"0aa1e362d4df3ebc",
      "type":"api-call-service",
      "z":"306a47525f702e89",
      "g":"5d2b4328a01c5e2e",
      "name":"change_attribute@light",
      "server":"1b427ab1.8760e5",
      "version":5,
      "debugenabled":false,
      "domain":"light",
      "service":"turn_on",
      "areaId":[
         
      ],
      "deviceId":[
         
      ],
      "entityId":[
         "{{data.light.entity_id}}"
      ],
      "data":"{data.attribute:data.attributeData}",
      "dataType":"jsonata",
      "mergeContext":"",
      "mustacheAltTags":false,
      "outputProperties":[
         {
            "property":"sent",
            "propertyType":"msg",
            "value":"",
            "valueType":"data"
         }
      ],
      "queue":"none",
      "output_location":"",
      "output_location_type":"none",
      "x":1930,
      "y":640,
      "wires":[
         [
            
         ]
      ]
   },
   {
      "id":"daf2160519d595db",
      "type":"function",
      "z":"306a47525f702e89",
      "g":"90a011a03d8e18ee",
      "name":"Add Attribute Data",
      "func":"if (msg.data.light.state == \"on\"){\n    if (msg.data.light.attributes.color_mode == \"color_temp\") {\n        msg.data.attribute = \"kelvin\"\n        msg.data.attributeData = msg.payload == \"rotate_right\" ? msg.data.light.attributes.color_temp_kelvin - 500 : msg.data.light.attributes.color_temp_kelvin + 500;\n    }\n    if (msg.data.light.attributes.color_mode == \"hs\") {\n        msg.data.attribute = \"hs_color\"\n        if (msg.payload == \"rotate_right\") {\n            var var_h = (msg.data.light.attributes.hs_color[0] + 10) % 360;\n        }\n        if (msg.payload == \"rotate_left\") {\n            var var_h = (360 + (msg.data.light.attributes.hs_color[0] - 10)) % 360;\n        }\n        \n        \n        var var_s = 100;\n        msg.data.attributeData = [var_h,var_s]; \n        }\n    return msg;\n}\n\n\n\n\n\n",
      "outputs":1,
      "noerr":0,
      "initialize":"",
      "finalize":"",
      "libs":[
         
      ],
      "x":1590,
      "y":600,
      "wires":[
         [
            "0aa1e362d4df3ebc"
         ]
      ]
   },
   {
      "id":"5731eec56c8ca618",
      "type":"api-current-state",
      "z":"306a47525f702e89",
      "g":"43a371d03b7865df",
      "name":"",
      "server":"1b427ab1.8760e5",
      "version":3,
      "outputs":1,
      "halt_if":"",
      "halt_if_type":"str",
      "halt_if_compare":"is",
      "entity_id":"light.poddasze_lozko",
      "state_type":"str",
      "blockInputOverrides":false,
      "outputProperties":[
         {
            "property":"data.light",
            "propertyType":"msg",
            "value":"",
            "valueType":"entity"
         }
      ],
      "for":"0",
      "forType":"num",
      "forUnits":"minutes",
      "override_topic":false,
      "state_location":"payload",
      "override_payload":"msg",
      "entity_location":"data",
      "override_data":"msg",
      "x":640,
      "y":680,
      "wires":[
         [
            "0cb4b622f461c110"
         ]
      ]
   },
   {
      "id":"05063a5102ae3827",
      "type":"function",
      "z":"306a47525f702e89",
      "g":"90a011a03d8e18ee",
      "name":"Add function Data",
      "func":"if (msg.data.light.state == \"on\") {\n    if (msg.data.light.attributes.color_mode == \"hs\") {\n        msg.data.attribute = \"kelvin\"\n        msg.data.attributeData = msg.data.light.attributes.min_color_temp_kelvin;\n    }\n    if (msg.data.light.attributes.color_mode == \"color_temp\") {\n        msg.data.attribute = \"hs_color\"\n        var var_h = msg.data.light.attributes.hs_color[0];       \n        var var_s = 100;\n        msg.data.attributeData = [var_h, var_s];\n    }\n    return msg;\n}\n\n",
      "outputs":1,
      "noerr":0,
      "initialize":"",
      "finalize":"",
      "libs":[
         
      ],
      "x":1590,
      "y":680,
      "wires":[
         [
            "0aa1e362d4df3ebc"
         ]
      ]
   },
   {
      "id":"986478f3446b8675",
      "type":"server-state-changed",
      "z":"306a47525f702e89",
      "g":"3d34411c2326b938",
      "name":"cube_shake",
      "server":"1b427ab1.8760e5",
      "version":4,
      "exposeToHomeAssistant":false,
      "haConfig":[
         {
            "property":"name",
            "value":""
         },
         {
            "property":"icon",
            "value":""
         }
      ],
      "entityidfilter":"sensor.kostka_biurko_action",
      "entityidfiltertype":"exact",
      "outputinitially":false,
      "state_type":"str",
      "haltifstate":"shake",
      "halt_if_type":"str",
      "halt_if_compare":"includes",
      "outputs":2,
      "output_only_on_state_change":true,
      "for":"0",
      "forType":"num",
      "forUnits":"minutes",
      "ignorePrevStateNull":false,
      "ignorePrevStateUnknown":false,
      "ignorePrevStateUnavailable":false,
      "ignoreCurrentStateUnknown":false,
      "ignoreCurrentStateUnavailable":false,
      "outputProperties":[
         {
            "property":"payload",
            "propertyType":"msg",
            "value":"",
            "valueType":"entityState"
         },
         {
            "property":"topic",
            "propertyType":"msg",
            "value":"",
            "valueType":"triggerId"
         },
         {
            "property":"data.action",
            "propertyType":"msg",
            "value":"",
            "valueType":"entityState"
         }
      ],
      "x":130,
      "y":920,
      "wires":[
         [
            "a22337b0606c29b4"
         ],
         [
            
         ]
      ]
   },
   {
      "id":"a22337b0606c29b4",
      "type":"api-call-service",
      "z":"306a47525f702e89",
      "g":"3d34411c2326b938",
      "name":"tv@turn_on",
      "server":"1b427ab1.8760e5",
      "version":5,
      "debugenabled":false,
      "domain":"media_player",
      "service":"turn_on",
      "areaId":[
         
      ],
      "deviceId":[
         "a5b3f0bb2623ddece3587a361843410f"
      ],
      "entityId":[
         
      ],
      "data":"",
      "dataType":"jsonata",
      "mergeContext":"",
      "mustacheAltTags":false,
      "outputProperties":[
         
      ],
      "queue":"none",
      "x":310,
      "y":920,
      "wires":[
         [
            
         ]
      ]
   },
   {
      "id":"07f7103719bb18e0",
      "type":"function",
      "z":"306a47525f702e89",
      "name":"Sync state",
      "func":"\nif (msg.data.sync){\n    if (msg.data.light.state == \"off\")\n        var msg1 = msg;\n    if (msg.data.light.state == \"on\")\n        var msg2 = msg;\n    return [msg1,msg2];\n}\n\n",
      "outputs":2,
      "noerr":0,
      "initialize":"",
      "finalize":"",
      "libs":[
         
      ],
      "x":1790,
      "y":480,
      "wires":[
         [
            "3c0748578277c93b"
         ],
         [
            "bc033bd670238299"
         ]
      ]
   },
   {
      "id":"3c0748578277c93b",
      "type":"api-call-service",
      "z":"306a47525f702e89",
      "name":"switch@on",
      "server":"1b427ab1.8760e5",
      "version":5,
      "debugenabled":false,
      "domain":"switch",
      "service":"turn_on",
      "areaId":[
         
      ],
      "deviceId":[
         
      ],
      "entityId":[
         "{{data.syncDevice.entity_id}}"
      ],
      "data":"",
      "dataType":"jsonata",
      "mergeContext":"",
      "mustacheAltTags":false,
      "outputProperties":[
         
      ],
      "queue":"none",
      "x":1990,
      "y":460,
      "wires":[
         [
            
         ]
      ]
   },
   {
      "id":"a0d617c8814c5f44",
      "type":"comment",
      "z":"306a47525f702e89",
      "g":"849cdacc2a4e55fe",
      "name":"Logo",
      "info":"",
      "x":650,
      "y":160,
      "wires":[
         
      ]
   },
   {
      "id":"8cdcb997cac4c6e0",
      "type":"comment",
      "z":"306a47525f702e89",
      "g":"849cdacc2a4e55fe",
      "name":"Right",
      "info":"",
      "x":770,
      "y":160,
      "wires":[
         
      ]
   },
   {
      "id":"44f3933daa241f76",
      "type":"comment",
      "z":"306a47525f702e89",
      "g":"849cdacc2a4e55fe",
      "name":"Top",
      "info":"",
      "x":650,
      "y":120,
      "wires":[
         
      ]
   },
   {
      "id":"a2c990207a730136",
      "type":"comment",
      "z":"306a47525f702e89",
      "g":"849cdacc2a4e55fe",
      "name":"Left",
      "info":"",
      "x":530,
      "y":160,
      "wires":[
         
      ]
   },
   {
      "id":"822c1be3834489c6",
      "type":"comment",
      "z":"306a47525f702e89",
      "g":"849cdacc2a4e55fe",
      "name":"Bottom",
      "info":"",
      "x":650,
      "y":200,
      "wires":[
         
      ]
   },
   {
      "id":"bcf79b2151bfbb3c",
      "type":"comment",
      "z":"306a47525f702e89",
      "g":"849cdacc2a4e55fe",
      "name":"Battery",
      "info":"",
      "x":650,
      "y":240,
      "wires":[
         
      ]
   },
   {
      "id":"242ccfef004e6408",
      "type":"comment",
      "z":"306a47525f702e89",
      "g":"43a371d03b7865df",
      "name":"Logo",
      "info":"",
      "x":430,
      "y":360,
      "wires":[
         
      ]
   },
   {
      "id":"6289946b1e0fb434",
      "type":"comment",
      "z":"306a47525f702e89",
      "g":"43a371d03b7865df",
      "name":"Right",
      "info":"",
      "x":430,
      "y":600,
      "wires":[
         
      ]
   },
   {
      "id":"6ca2f0ee681a6f16",
      "type":"comment",
      "z":"306a47525f702e89",
      "g":"43a371d03b7865df",
      "name":"Top",
      "info":"",
      "x":430,
      "y":500,
      "wires":[
         
      ]
   },
   {
      "id":"049a54588a6120a8",
      "type":"comment",
      "z":"306a47525f702e89",
      "g":"43a371d03b7865df",
      "name":"Left",
      "info":"",
      "x":430,
      "y":440,
      "wires":[
         
      ]
   },
   {
      "id":"3c6f0fcf7a59c205",
      "type":"comment",
      "z":"306a47525f702e89",
      "g":"43a371d03b7865df",
      "name":"Bottom",
      "info":"",
      "x":430,
      "y":680,
      "wires":[
         
      ]
   },
   {
      "id":"589447e16476a450",
      "type":"comment",
      "z":"306a47525f702e89",
      "name":"Battery",
      "info":"",
      "x":430,
      "y":760,
      "wires":[
         
      ]
   },
   {
      "id":"bbd312d5385c7525",
      "type":"api-current-state",
      "z":"306a47525f702e89",
      "g":"5d231f779a74ebba",
      "name":"",
      "server":"1b427ab1.8760e5",
      "version":3,
      "outputs":1,
      "halt_if":"",
      "halt_if_type":"str",
      "halt_if_compare":"is",
      "entity_id":"switch.poddasze_monitory",
      "state_type":"str",
      "blockInputOverrides":false,
      "outputProperties":[
         {
            "property":"data.syncDevice",
            "propertyType":"msg",
            "value":"",
            "valueType":"entity"
         },
         {
            "property":"data.sync",
            "propertyType":"msg",
            "value":"true",
            "valueType":"bool"
         }
      ],
      "for":"0",
      "forType":"num",
      "forUnits":"minutes",
      "override_topic":false,
      "state_location":"payload",
      "override_payload":"msg",
      "entity_location":"data",
      "override_data":"msg",
      "x":1040,
      "y":360,
      "wires":[
         [
            "d75851cf7b187bcb"
         ]
      ]
   },
   {
      "id":"bc033bd670238299",
      "type":"api-call-service",
      "z":"306a47525f702e89",
      "name":"switch@off",
      "server":"1b427ab1.8760e5",
      "version":5,
      "debugenabled":false,
      "domain":"switch",
      "service":"turn_off",
      "areaId":[
         
      ],
      "deviceId":[
         
      ],
      "entityId":[
         "{{data.syncDevice.entity_id}}"
      ],
      "data":"",
      "dataType":"jsonata",
      "mergeContext":"",
      "mustacheAltTags":false,
      "outputProperties":[
         
      ],
      "queue":"none",
      "x":1990,
      "y":520,
      "wires":[
         [
            
         ]
      ]
   },
   {
      "id":"1b427ab1.8760e5",
      "type":"server",
      "name":"Home Assistant",
      "addon":true
   }
]