diff --git a/src/data/flows/home_leaving.json b/src/data/flows/home_leaving.json index 3f8aefe..b4e1d8f 100644 --- a/src/data/flows/home_leaving.json +++ b/src/data/flows/home_leaving.json @@ -6,6 +6,26 @@ "disabled": false, "info": "" }, + { + "id": "cc3f4f06d9ee1050", + "type": "group", + "z": "8aa6edec.5a013", + "name": "notify", + "style": { + "label": true + }, + "nodes": [ + "8bd431aac8edba25", + "1d9212ada487b166", + "2d9c5a51a0d3d65a", + "934778f06d5ff810", + "11441b9d4ec597d9" + ], + "x": 1594, + "y": 459, + "w": 412, + "h": 162 + }, { "id": "9c946ef945c199e5", "type": "group", @@ -21,13 +41,13 @@ "f7c20be07a75c04e", "662879feb30cc5fa" ], - "x": 1554, + "x": 1594, "y": 39, "w": 412, "h": 162 }, { - "id": "cc3f4f06d9ee1050", + "id": "14187342a7b09482", "type": "group", "z": "8aa6edec.5a013", "name": "notify", @@ -35,23 +55,39 @@ "label": true }, "nodes": [ - "8bd431aac8edba25", - "1d9212ada487b166", - "2d9c5a51a0d3d65a", - "934778f06d5ff810", - "11441b9d4ec597d9" + "19cfd22b49a2e356", + "8aa74b4cb48558f8", + "3bdaf73ce37b7397", + "d512fe1ba0adbf42", + "83e460c17170065f", + "1b8772493fd3aa94", + "c8db6380b138fd4e" ], - "x": 1554, - "y": 279, + "x": 1594, + "y": 239, "w": 412, - "h": 162 + "h": 202 + }, + { + "id": "11441b9d4ec597d9", + "type": "junction", + "z": "8aa6edec.5a013", + "g": "cc3f4f06d9ee1050", + "x": 1620, + "y": 540, + "wires": [ + [ + "1d9212ada487b166", + "8bd431aac8edba25" + ] + ] }, { "id": "662879feb30cc5fa", "type": "junction", "z": "8aa6edec.5a013", "g": "9c946ef945c199e5", - "x": 1580, + "x": 1620, "y": 120, "wires": [ [ @@ -61,16 +97,184 @@ ] }, { - "id": "11441b9d4ec597d9", + "id": "83e460c17170065f", "type": "junction", "z": "8aa6edec.5a013", + "g": "14187342a7b09482", + "x": 1620, + "y": 320, + "wires": [ + [ + "8aa74b4cb48558f8", + "19cfd22b49a2e356", + "1b8772493fd3aa94", + "c8db6380b138fd4e" + ] + ] + }, + { + "id": "934778f06d5ff810", + "type": "join", + "z": "8aa6edec.5a013", "g": "cc3f4f06d9ee1050", - "x": 1580, - "y": 360, + "name": "", + "mode": "custom", + "build": "merged", + "property": "notify", + "propertyType": "msg", + "key": "topic", + "joiner": "\\n", + "joinerType": "str", + "accumulate": false, + "timeout": "", + "count": "3", + "reduceRight": false, + "reduceExp": "", + "reduceInit": "", + "reduceInitType": "", + "reduceFixup": "", + "x": 1870, + "y": 540, "wires": [ [ - "1d9212ada487b166", - "8bd431aac8edba25" + "2d9c5a51a0d3d65a" + ] + ] + }, + { + "id": "2d9c5a51a0d3d65a", + "type": "link out", + "z": "8aa6edec.5a013", + "g": "cc3f4f06d9ee1050", + "name": "link_out_notify_home_leaving_2", + "mode": "link", + "links": [ + "8ed3b0974336e55b" + ], + "x": 1965, + "y": 540, + "wires": [] + }, + { + "id": "1d9212ada487b166", + "type": "template", + "z": "8aa6edec.5a013", + "g": "cc3f4f06d9ee1050", + "name": "title", + "field": "notify.title", + "fieldType": "msg", + "format": "handlebars", + "syntax": "mustache", + "template": "Gastmodus", + "output": "str", + "x": 1710, + "y": 500, + "wires": [ + [ + "934778f06d5ff810" + ] + ] + }, + { + "id": "8bd431aac8edba25", + "type": "template", + "z": "8aa6edec.5a013", + "g": "cc3f4f06d9ee1050", + "name": "icon", + "field": "notify.icon", + "fieldType": "msg", + "format": "handlebars", + "syntax": "mustache", + "template": "", + "output": "str", + "x": 1710, + "y": 580, + "wires": [ + [ + "934778f06d5ff810" + ] + ] + }, + { + "id": "f7c20be07a75c04e", + "type": "join", + "z": "8aa6edec.5a013", + "g": "9c946ef945c199e5", + "name": "", + "mode": "custom", + "build": "merged", + "property": "notify", + "propertyType": "msg", + "key": "topic", + "joiner": "\\n", + "joinerType": "str", + "accumulate": false, + "timeout": "", + "count": "3", + "reduceRight": false, + "reduceExp": "", + "reduceInit": "", + "reduceInitType": "", + "reduceFixup": "", + "x": 1870, + "y": 120, + "wires": [ + [ + "37c73ac2e71d9a61" + ] + ] + }, + { + "id": "37c73ac2e71d9a61", + "type": "link out", + "z": "8aa6edec.5a013", + "g": "9c946ef945c199e5", + "name": "link_out_notify_home_leaving_1", + "mode": "link", + "links": [ + "8ed3b0974336e55b" + ], + "x": 1965, + "y": 120, + "wires": [] + }, + { + "id": "254201c717321a67", + "type": "template", + "z": "8aa6edec.5a013", + "g": "9c946ef945c199e5", + "name": "title", + "field": "notify.title", + "fieldType": "msg", + "format": "handlebars", + "syntax": "mustache", + "template": "Beveiliging", + "output": "str", + "x": 1710, + "y": 80, + "wires": [ + [ + "f7c20be07a75c04e" + ] + ] + }, + { + "id": "60a9200995b666e2", + "type": "template", + "z": "8aa6edec.5a013", + "g": "9c946ef945c199e5", + "name": "icon", + "field": "notify.icon", + "fieldType": "msg", + "format": "handlebars", + "syntax": "mustache", + "template": "", + "output": "str", + "x": 1710, + "y": 160, + "wires": [ + [ + "f7c20be07a75c04e" ] ] }, @@ -222,7 +426,8 @@ "49ea77ab.4cfa28", "8d40faa88a9cd112", "b932464b99aa9267", - "f3398caf62b1ef7a" + "f3398caf62b1ef7a", + "cdc07b973642084c" ], [] ] @@ -265,7 +470,8 @@ [ "49ea77ab.4cfa28", "f3398caf62b1ef7a", - "b932464b99aa9267" + "b932464b99aa9267", + "cdc07b973642084c" ] ] }, @@ -677,131 +883,124 @@ "wires": [] }, { - "id": "60a9200995b666e2", + "id": "10249eab85b11e9f", "type": "template", "z": "8aa6edec.5a013", - "g": "9c946ef945c199e5", - "name": "icon", - "field": "notify.icon", + "name": "message", + "field": "notify.message", "fieldType": "msg", "format": "handlebars", "syntax": "mustache", - "template": "", + "template": "Beveiliging is ingeschakeld ", "output": "str", - "x": 1670, - "y": 160, + "x": 1440, + "y": 120, "wires": [ [ - "f7c20be07a75c04e" + "662879feb30cc5fa" ] ] }, { - "id": "254201c717321a67", + "id": "20ea56701637694a", "type": "template", "z": "8aa6edec.5a013", - "g": "9c946ef945c199e5", - "name": "title", - "field": "notify.title", + "name": "message", + "field": "notify.message", "fieldType": "msg", "format": "handlebars", "syntax": "mustache", - "template": "Beveiliging", + "template": "Beveiliging is ingeschakeld ", "output": "str", - "x": 1670, - "y": 80, + "x": 960, + "y": 540, "wires": [ [ - "f7c20be07a75c04e" + "11441b9d4ec597d9" ] ] }, { - "id": "37c73ac2e71d9a61", - "type": "link out", + "id": "39773eee4279f3fe", + "type": "api-call-service", "z": "8aa6edec.5a013", - "g": "9c946ef945c199e5", - "name": "link_out_notify_home_leaving_1", - "mode": "link", - "links": [ - "8ed3b0974336e55b" + "name": "turn off lights", + "server": "4ba92433.2478cc", + "version": 5, + "debugenabled": false, + "domain": "light", + "service": "turn_off", + "areaId": [], + "deviceId": [], + "entityId": [ + "{{payload.entity_id}}" ], - "x": 1925, - "y": 120, - "wires": [] - }, - { - "id": "f7c20be07a75c04e", - "type": "join", - "z": "8aa6edec.5a013", - "g": "9c946ef945c199e5", - "name": "", - "mode": "custom", - "build": "merged", - "property": "notify", - "propertyType": "msg", - "key": "topic", - "joiner": "\\n", - "joinerType": "str", - "accumulate": false, - "timeout": "", - "count": "3", - "reduceRight": false, - "reduceExp": "", - "reduceInit": "", - "reduceInitType": "", - "reduceFixup": "", - "x": 1830, - "y": 120, + "data": "", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "x": 1150, + "y": 300, "wires": [ [ - "37c73ac2e71d9a61" + "a91a402abef99c42" ] ] }, { - "id": "10249eab85b11e9f", + "id": "a91a402abef99c42", "type": "template", "z": "8aa6edec.5a013", - "name": "message", - "field": "notify.message", + "name": "format friendly name", + "field": "friendly_name", "fieldType": "msg", "format": "handlebars", "syntax": "mustache", - "template": "Beveiliging is ingeschakeld ", + "template": "{{{payload.attributes.friendly_name}}}", "output": "str", - "x": 1440, - "y": 120, + "x": 1340, + "y": 300, "wires": [ [ - "662879feb30cc5fa" + "ac6ad3992a800655" ] ] }, { - "id": "20ea56701637694a", - "type": "template", + "id": "ac6ad3992a800655", + "type": "join", "z": "8aa6edec.5a013", - "name": "message", - "field": "notify.message", - "fieldType": "msg", - "format": "handlebars", - "syntax": "mustache", - "template": "Beveiliging is ingeschakeld ", - "output": "str", - "x": 1440, - "y": 360, + "name": "", + "mode": "custom", + "build": "string", + "property": "friendly_name", + "propertyType": "msg", + "key": "topic", + "joiner": ", ", + "joinerType": "str", + "accumulate": false, + "timeout": "", + "count": "", + "reduceRight": false, + "reduceExp": "", + "reduceInit": "", + "reduceInitType": "", + "reduceFixup": "", + "x": 1510, + "y": 300, "wires": [ [ - "11441b9d4ec597d9" + "83e460c17170065f" ] ] }, { - "id": "8bd431aac8edba25", + "id": "19cfd22b49a2e356", "type": "template", "z": "8aa6edec.5a013", - "g": "cc3f4f06d9ee1050", + "g": "14187342a7b09482", "name": "icon", "field": "notify.icon", "fieldType": "msg", @@ -809,53 +1008,53 @@ "syntax": "mustache", "template": "", "output": "str", - "x": 1670, + "x": 1710, "y": 400, "wires": [ [ - "934778f06d5ff810" + "d512fe1ba0adbf42" ] ] }, { - "id": "1d9212ada487b166", + "id": "8aa74b4cb48558f8", "type": "template", "z": "8aa6edec.5a013", - "g": "cc3f4f06d9ee1050", + "g": "14187342a7b09482", "name": "title", "field": "notify.title", "fieldType": "msg", "format": "handlebars", "syntax": "mustache", - "template": "Gastmodus", + "template": "Verlichting", "output": "str", - "x": 1670, - "y": 320, + "x": 1710, + "y": 280, "wires": [ [ - "934778f06d5ff810" + "d512fe1ba0adbf42" ] ] }, { - "id": "2d9c5a51a0d3d65a", + "id": "3bdaf73ce37b7397", "type": "link out", "z": "8aa6edec.5a013", - "g": "cc3f4f06d9ee1050", - "name": "link_out_notify_home_leaving_2", + "g": "14187342a7b09482", + "name": "link_out_notify_ac_solar_record", "mode": "link", "links": [ - "8ed3b0974336e55b" + "a97f87cfab413716" ], - "x": 1925, - "y": 360, + "x": 1965, + "y": 320, "wires": [] }, { - "id": "934778f06d5ff810", + "id": "d512fe1ba0adbf42", "type": "join", "z": "8aa6edec.5a013", - "g": "cc3f4f06d9ee1050", + "g": "14187342a7b09482", "name": "", "mode": "custom", "build": "merged", @@ -866,17 +1065,91 @@ "joinerType": "str", "accumulate": false, "timeout": "", - "count": "3", + "count": "4", "reduceRight": false, "reduceExp": "", "reduceInit": "", "reduceInitType": "", "reduceFixup": "", - "x": 1830, + "x": 1870, + "y": 320, + "wires": [ + [ + "3bdaf73ce37b7397" + ] + ] + }, + { + "id": "1b8772493fd3aa94", + "type": "template", + "z": "8aa6edec.5a013", + "g": "14187342a7b09482", + "name": "notification id", + "field": "notify.notification_id", + "fieldType": "msg", + "format": "handlebars", + "syntax": "mustache", + "template": "lights", + "output": "str", + "x": 1730, "y": 360, "wires": [ [ - "2d9c5a51a0d3d65a" + "d512fe1ba0adbf42" + ] + ] + }, + { + "id": "cdc07b973642084c", + "type": "ha-get-entities", + "z": "8aa6edec.5a013", + "name": "lookup lights on", + "server": "4ba92433.2478cc", + "version": 1, + "rules": [ + { + "property": "entity_id", + "logic": "starts_with", + "value": "light.", + "valueType": "str" + }, + { + "property": "state", + "logic": "is", + "value": "on", + "valueType": "str" + } + ], + "outputType": "split", + "outputEmptyResults": false, + "outputLocationType": "msg", + "outputLocation": "payload", + "outputResultsCount": 1, + "x": 980, + "y": 300, + "wires": [ + [ + "39773eee4279f3fe" + ] + ] + }, + { + "id": "c8db6380b138fd4e", + "type": "template", + "z": "8aa6edec.5a013", + "g": "14187342a7b09482", + "name": "message", + "field": "notify.message", + "fieldType": "msg", + "format": "handlebars", + "syntax": "mustache", + "template": "{{{friendly_name}}} verlichting stond nog aan en is nu automatisch uitgeschakeld.", + "output": "str", + "x": 1720, + "y": 320, + "wires": [ + [ + "d512fe1ba0adbf42" ] ] },