Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [
- {
- "id": "967995f2.033478",
- "type": "tab",
- "label": "Vacuum Control",
- "disabled": false,
- "info": "## **Flow for automation of Xioami vacuum**\n**By Anders Lukic**\n\n---\n<br>\n\n---\n### **Functionality**\n---\n\nThis flow automates control over my S5 robot vacuum cleaner. It does the following:\n\n * Use actionable notification to ask if cleaning should start when nobody is home\n * Pause cleaning when the doorbell is pressed\n * Use actionable notification to ask to empty dustbin when the robot has cleaned 200m2 or more\n\n---\n### **Requirements**\n---\nThis flow requires the following additional configuration to work:\n\n * Definition of IOS push categories for actionable notifications\n * Definition of input booleans for room selection\n\nSee this link for example configuration definitions:\n\nhttps://pastebin.com/raw/DFrUZKe1"
- },
- {
- "id": "674c2c16.545254",
- "type": "server-events",
- "z": "967995f2.033478",
- "name": "IOS Action?",
- "server": "3bebce79.1e0962",
- "event_type": "ios.notification_action_fired",
- "exposeToHomeAssistant": false,
- "haConfig": [
- {
- "property": "name",
- "value": ""
- },
- {
- "property": "icon",
- "value": ""
- }
- ],
- "x": 90,
- "y": 280,
- "wires": [
- [
- "448ac56c.397d4c"
- ]
- ]
- },
- {
- "id": "448ac56c.397d4c",
- "type": "switch",
- "z": "967995f2.033478",
- "name": "Time for vacuuming?",
- "property": "payload.event.actionName",
- "propertyType": "msg",
- "rules": [
- {
- "t": "eq",
- "v": "VACUUM_ASK_LATER",
- "vt": "str"
- },
- {
- "t": "eq",
- "v": "VACUUM_FULL_CLEAN",
- "vt": "str"
- },
- {
- "t": "eq",
- "v": "VACUUM_ROOM_CLEAN",
- "vt": "str"
- },
- {
- "t": "eq",
- "v": "VACUUM_POSTPONE",
- "vt": "str"
- }
- ],
- "checkall": "false",
- "repair": false,
- "outputs": 4,
- "x": 280,
- "y": 280,
- "wires": [
- [
- "6aa3e92f.656be8"
- ],
- [
- "198ee6b5.4e85a9"
- ],
- [
- "a8f42787.5a4068"
- ],
- []
- ],
- "outputLabels": [
- "Remind me later (in 15 mins)",
- "Clean entire house",
- "Clean selected rooms only",
- "Postpone cleaning (do nothing"
- ]
- },
- {
- "id": "730084a.e6b177c",
- "type": "comment",
- "z": "967995f2.033478",
- "name": "Ask to start vacuum when away",
- "info": "",
- "x": 150,
- "y": 120,
- "wires": []
- },
- {
- "id": "198ee6b5.4e85a9",
- "type": "api-call-service",
- "z": "967995f2.033478",
- "name": "Start full clean",
- "server": "3bebce79.1e0962",
- "version": 1,
- "debugenabled": false,
- "service_domain": "vacuum",
- "service": "start",
- "entityId": "vacuum.xiaomi_vacuum_cleaner",
- "data": "",
- "dataType": "json",
- "mergecontext": "",
- "output_location": "payload",
- "output_location_type": "msg",
- "mustacheAltTags": false,
- "x": 500,
- "y": 260,
- "wires": [
- []
- ]
- },
- {
- "id": "72fb6ed9.18238",
- "type": "json",
- "z": "967995f2.033478",
- "name": "Format as JSON",
- "property": "payload",
- "action": "",
- "pretty": false,
- "x": 1110,
- "y": 300,
- "wires": [
- [
- "b4d3b4d0.6ef6c8"
- ]
- ]
- },
- {
- "id": "a8f42787.5a4068",
- "type": "ha-get-entities",
- "z": "967995f2.033478",
- "server": "3bebce79.1e0962",
- "name": "Get selected rooms",
- "rules": [
- {
- "property": "entity_id",
- "logic": "starts_with",
- "value": "input_boolean.clean_room",
- "valueType": "str"
- },
- {
- "property": "state",
- "logic": "is",
- "value": "on",
- "valueType": "str"
- }
- ],
- "output_type": "split",
- "output_empty_results": false,
- "output_location_type": "msg",
- "output_location": "payload",
- "output_results_count": 1,
- "x": 510,
- "y": 300,
- "wires": [
- [
- "4741293b.54d968",
- "7524e6b5.738128"
- ]
- ]
- },
- {
- "id": "4741293b.54d968",
- "type": "change",
- "z": "967995f2.033478",
- "name": "Get room IDs only",
- "rules": [
- {
- "t": "set",
- "p": "payload",
- "pt": "msg",
- "to": "payload.entity_id",
- "tot": "msg"
- },
- {
- "t": "change",
- "p": "payload",
- "pt": "msg",
- "from": "input_boolean.clean_room_",
- "fromt": "str",
- "to": "",
- "tot": "str"
- }
- ],
- "action": "",
- "property": "",
- "from": "",
- "to": "",
- "reg": false,
- "x": 710,
- "y": 300,
- "wires": [
- [
- "9b8316e8.d15c18"
- ]
- ]
- },
- {
- "id": "9b8316e8.d15c18",
- "type": "join",
- "z": "967995f2.033478",
- "name": "Combine to array",
- "mode": "auto",
- "build": "object",
- "property": "payload",
- "propertyType": "msg",
- "key": "",
- "joiner": ",",
- "joinerType": "str",
- "accumulate": false,
- "timeout": "",
- "count": "",
- "reduceRight": false,
- "reduceExp": "",
- "reduceInit": "",
- "reduceInitType": "",
- "reduceFixup": "",
- "x": 910,
- "y": 300,
- "wires": [
- [
- "72fb6ed9.18238"
- ]
- ]
- },
- {
- "id": "b4d3b4d0.6ef6c8",
- "type": "api-call-service",
- "z": "967995f2.033478",
- "name": "Start room cleaning",
- "server": "3bebce79.1e0962",
- "version": 1,
- "debugenabled": false,
- "service_domain": "vacuum",
- "service": "send_command",
- "entityId": "vacuum.xiaomi_vacuum_cleaner",
- "data": "{ \"command\": \"app_segment_clean\", \"params\": [{{payload}}]}",
- "dataType": "json",
- "mergecontext": "",
- "output_location": "payload",
- "output_location_type": "msg",
- "mustacheAltTags": false,
- "x": 1310,
- "y": 300,
- "wires": [
- []
- ]
- },
- {
- "id": "7524e6b5.738128",
- "type": "template",
- "z": "967995f2.033478",
- "name": "Entity names",
- "field": "payload",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "{{payload.attributes.friendly_name}}",
- "output": "str",
- "x": 690,
- "y": 340,
- "wires": [
- [
- "8ebff89f.02d438"
- ]
- ]
- },
- {
- "id": "8ebff89f.02d438",
- "type": "join",
- "z": "967995f2.033478",
- "name": "combine msgs",
- "mode": "custom",
- "build": "string",
- "property": "payload",
- "propertyType": "msg",
- "key": "topic",
- "joiner": "[92,110]",
- "joinerType": "bin",
- "accumulate": false,
- "timeout": "",
- "count": "",
- "reduceRight": false,
- "reduceExp": "",
- "reduceInit": "",
- "reduceInitType": "",
- "reduceFixup": "",
- "x": 860,
- "y": 340,
- "wires": [
- [
- "6bce24e7.7cfb8c"
- ]
- ]
- },
- {
- "id": "9605b4db.a7a878",
- "type": "api-call-service",
- "z": "967995f2.033478",
- "name": "Confirm start",
- "server": "3bebce79.1e0962",
- "version": 1,
- "debugenabled": false,
- "service_domain": "notify",
- "service": "mobile_app_anders_iphone",
- "entityId": "",
- "data": "{\"message\":\"Støvsugning starter i:\\n\\n {{payload}}\"}",
- "dataType": "json",
- "mergecontext": "",
- "output_location": "",
- "output_location_type": "none",
- "mustacheAltTags": false,
- "x": 1190,
- "y": 340,
- "wires": [
- []
- ]
- },
- {
- "id": "6bce24e7.7cfb8c",
- "type": "change",
- "z": "967995f2.033478",
- "name": "Clean names",
- "rules": [
- {
- "t": "change",
- "p": "payload",
- "pt": "msg",
- "from": "Støvsug ",
- "fromt": "str",
- "to": "",
- "tot": "str"
- }
- ],
- "action": "",
- "property": "",
- "from": "",
- "to": "",
- "reg": false,
- "x": 1030,
- "y": 340,
- "wires": [
- [
- "9605b4db.a7a878"
- ]
- ]
- },
- {
- "id": "6aa3e92f.656be8",
- "type": "delay",
- "z": "967995f2.033478",
- "name": "Ask again in 15 mins.",
- "pauseType": "delay",
- "timeout": "30",
- "timeoutUnits": "seconds",
- "rate": "1",
- "nbRateUnits": "1",
- "rateUnits": "second",
- "randomFirst": "1",
- "randomLast": "5",
- "randomUnits": "seconds",
- "drop": false,
- "x": 520,
- "y": 220,
- "wires": [
- [
- "cd40bece.b140b"
- ]
- ]
- },
- {
- "id": "34984a6c.b675c6",
- "type": "switch",
- "z": "967995f2.033478",
- "name": "Doorbell",
- "property": "payload.event.id",
- "propertyType": "msg",
- "rules": [
- {
- "t": "eq",
- "v": "hue_smart_button1",
- "vt": "str"
- }
- ],
- "checkall": "true",
- "repair": false,
- "outputs": 1,
- "x": 260,
- "y": 440,
- "wires": [
- [
- "d2c7107c.d1909"
- ]
- ]
- },
- {
- "id": "18c1908e.db781f",
- "type": "server-events",
- "z": "967995f2.033478",
- "name": "Deconz events",
- "server": "3bebce79.1e0962",
- "event_type": "deconz_event",
- "exposeToHomeAssistant": false,
- "haConfig": [
- {
- "property": "name",
- "value": ""
- },
- {
- "property": "icon",
- "value": ""
- }
- ],
- "x": 100,
- "y": 440,
- "wires": [
- [
- "34984a6c.b675c6"
- ]
- ]
- },
- {
- "id": "301dd639.58180a",
- "type": "api-current-state",
- "z": "967995f2.033478",
- "name": "Is vacuumingr?",
- "server": "3bebce79.1e0962",
- "version": 1,
- "outputs": 2,
- "halt_if": "cleaning",
- "halt_if_type": "str",
- "halt_if_compare": "is",
- "override_topic": false,
- "entity_id": "vacuum.xiaomi_vacuum_cleaner",
- "state_type": "str",
- "state_location": "payload",
- "override_payload": "msg",
- "entity_location": "data",
- "override_data": "msg",
- "blockInputOverrides": false,
- "x": 620,
- "y": 440,
- "wires": [
- [
- "dc889be8.cd09d8"
- ],
- []
- ],
- "outputLabels": [
- "Ja",
- "Nej"
- ]
- },
- {
- "id": "dc889be8.cd09d8",
- "type": "api-call-service",
- "z": "967995f2.033478",
- "name": "Pause vacuum",
- "server": "3bebce79.1e0962",
- "version": 1,
- "debugenabled": false,
- "service_domain": "vacuum",
- "service": "pause",
- "entityId": "vacuum.xiaomi_vacuum_cleaner",
- "data": "",
- "dataType": "json",
- "mergecontext": "",
- "output_location": "",
- "output_location_type": "none",
- "mustacheAltTags": false,
- "x": 800,
- "y": 440,
- "wires": [
- []
- ]
- },
- {
- "id": "d2c7107c.d1909",
- "type": "api-current-state",
- "z": "967995f2.033478",
- "name": "Someone home?",
- "server": "3bebce79.1e0962",
- "version": 1,
- "outputs": 2,
- "halt_if": "home",
- "halt_if_type": "str",
- "halt_if_compare": "is",
- "override_topic": false,
- "entity_id": "person.alle",
- "state_type": "str",
- "state_location": "payload",
- "override_payload": "msg",
- "entity_location": "data",
- "override_data": "msg",
- "blockInputOverrides": false,
- "x": 430,
- "y": 440,
- "wires": [
- [
- "301dd639.58180a"
- ],
- []
- ]
- },
- {
- "id": "d2106db8.edb2",
- "type": "comment",
- "z": "967995f2.033478",
- "name": "Pause cleaning when doorbell is pressed",
- "info": "",
- "x": 180,
- "y": 400,
- "wires": []
- },
- {
- "id": "ffff7569.bfbd88",
- "type": "inject",
- "z": "967995f2.033478",
- "name": "timestamp",
- "props": [
- {
- "p": "payload"
- },
- {
- "p": "topic",
- "vt": "str"
- }
- ],
- "repeat": "",
- "crontab": "45 18 * * 1,2,3,4,5,0",
- "once": false,
- "onceDelay": "",
- "topic": "",
- "payload": "",
- "payloadType": "date",
- "x": 110,
- "y": 620,
- "wires": [
- [
- "20bb71d8.9dc3ae"
- ]
- ]
- },
- {
- "id": "349b5e95.5a1932",
- "type": "comment",
- "z": "967995f2.033478",
- "name": "Ask to send vacuum to dustbin for manual emptying",
- "info": "",
- "x": 210,
- "y": 540,
- "wires": []
- },
- {
- "id": "20bb71d8.9dc3ae",
- "type": "api-current-state",
- "z": "967995f2.033478",
- "name": "Someone home?",
- "server": "3bebce79.1e0962",
- "version": 1,
- "outputs": 2,
- "halt_if": "home",
- "halt_if_type": "str",
- "halt_if_compare": "is",
- "override_topic": false,
- "entity_id": "person.alle",
- "state_type": "str",
- "state_location": "payload",
- "override_payload": "msg",
- "entity_location": "data",
- "override_data": "msg",
- "blockInputOverrides": false,
- "x": 290,
- "y": 620,
- "wires": [
- [
- "881c801.8789b8"
- ],
- []
- ]
- },
- {
- "id": "2872b879.7cc788",
- "type": "api-call-service",
- "z": "967995f2.033478",
- "name": "Set last empty",
- "server": "3bebce79.1e0962",
- "version": 1,
- "debugenabled": true,
- "service_domain": "input_number",
- "service": "set_value",
- "entityId": "input_number.last_vaccuum_reset_m2",
- "data": "{ \"value\": {{payload}}}",
- "dataType": "json",
- "mergecontext": "",
- "output_location": "payload",
- "output_location_type": "msg",
- "mustacheAltTags": false,
- "x": 860,
- "y": 700,
- "wires": [
- []
- ]
- },
- {
- "id": "881c801.8789b8",
- "type": "api-current-state",
- "z": "967995f2.033478",
- "name": "Vacuum state",
- "server": "3bebce79.1e0962",
- "version": 1,
- "outputs": 1,
- "halt_if": "",
- "halt_if_type": "str",
- "halt_if_compare": "is",
- "override_topic": false,
- "entity_id": "vacuum.xiaomi_vacuum_cleaner",
- "state_type": "str",
- "state_location": "payload1",
- "override_payload": "msg",
- "entity_location": "data1",
- "override_data": "msg",
- "blockInputOverrides": false,
- "x": 480,
- "y": 620,
- "wires": [
- [
- "a4ecc108.9a555"
- ]
- ]
- },
- {
- "id": "a4ecc108.9a555",
- "type": "api-current-state",
- "z": "967995f2.033478",
- "name": "Last reset count",
- "server": "3bebce79.1e0962",
- "version": 1,
- "outputs": 1,
- "halt_if": "",
- "halt_if_type": "str",
- "halt_if_compare": "is",
- "override_topic": false,
- "entity_id": "input_number.last_vaccuum_reset_m2",
- "state_type": "str",
- "state_location": "payload2",
- "override_payload": "msg",
- "entity_location": "data2",
- "override_data": "msg",
- "blockInputOverrides": false,
- "x": 660,
- "y": 620,
- "wires": [
- [
- "b578a632.767998"
- ]
- ]
- },
- {
- "id": "b578a632.767998",
- "type": "function",
- "z": "967995f2.033478",
- "name": "area since last empty",
- "func": "let lastempty=msg.payload2;\nlet cleanarea=msg.data1.attributes.total_cleaned_area;\nlet diff=cleanarea-lastempty\nmsg.payload = diff;\nreturn msg;",
- "outputs": 1,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "x": 860,
- "y": 620,
- "wires": [
- [
- "24e3946b.cb13cc"
- ]
- ]
- },
- {
- "id": "24e3946b.cb13cc",
- "type": "switch",
- "z": "967995f2.033478",
- "name": "Time to empty?",
- "property": "payload",
- "propertyType": "msg",
- "rules": [
- {
- "t": "gt",
- "v": "181",
- "vt": "num"
- }
- ],
- "checkall": "true",
- "repair": false,
- "outputs": 1,
- "x": 1060,
- "y": 620,
- "wires": [
- [
- "5861ed94.9ccc24"
- ]
- ]
- },
- {
- "id": "5861ed94.9ccc24",
- "type": "api-call-service",
- "z": "967995f2.033478",
- "name": "Send notifcation",
- "server": "3bebce79.1e0962",
- "version": 1,
- "debugenabled": false,
- "service_domain": "notify",
- "service": "mobile_app_anders_iphone",
- "entityId": "",
- "data": "{\"title\":\"Tøm støvsuger?\",\"message\":\"Vil du tømme støvsugeren, der har kørt {{payload}} m2 siden sidste tømning?\",\"data\":{\"push\":{\"category\":\"vacuum_empty_notification\"}}}",
- "dataType": "json",
- "mergecontext": "",
- "output_location": "",
- "output_location_type": "none",
- "mustacheAltTags": false,
- "x": 1240,
- "y": 620,
- "wires": [
- []
- ]
- },
- {
- "id": "ea903d2c.3a64c",
- "type": "server-events",
- "z": "967995f2.033478",
- "name": "IOS Action?",
- "server": "3bebce79.1e0962",
- "event_type": "ios.notification_action_fired",
- "exposeToHomeAssistant": false,
- "haConfig": [
- {
- "property": "name",
- "value": ""
- },
- {
- "property": "icon",
- "value": ""
- }
- ],
- "x": 90,
- "y": 740,
- "wires": [
- [
- "ee169cb9.e013e"
- ]
- ]
- },
- {
- "id": "ee169cb9.e013e",
- "type": "switch",
- "z": "967995f2.033478",
- "name": "Time to empty?",
- "property": "payload.event.actionName",
- "propertyType": "msg",
- "rules": [
- {
- "t": "eq",
- "v": "VACUUM_EMPTY_ASK_LATER",
- "vt": "str"
- },
- {
- "t": "eq",
- "v": "VACUUM_EMPTY_YES",
- "vt": "str"
- }
- ],
- "checkall": "false",
- "repair": false,
- "outputs": 2,
- "x": 260,
- "y": 740,
- "wires": [
- [
- "7d69a4f4.60a48c"
- ],
- [
- "5a232d93.5e95c4"
- ]
- ],
- "outputLabels": [
- "Remind me later",
- "Yes - Send robot to dustbin"
- ]
- },
- {
- "id": "7d69a4f4.60a48c",
- "type": "delay",
- "z": "967995f2.033478",
- "name": "Ask again in 15 mins.",
- "pauseType": "delay",
- "timeout": "15",
- "timeoutUnits": "minutes",
- "rate": "1",
- "nbRateUnits": "1",
- "rateUnits": "second",
- "randomFirst": "1",
- "randomLast": "5",
- "randomUnits": "seconds",
- "drop": false,
- "x": 480,
- "y": 700,
- "wires": [
- [
- "5861ed94.9ccc24"
- ]
- ]
- },
- {
- "id": "5a232d93.5e95c4",
- "type": "api-current-state",
- "z": "967995f2.033478",
- "name": "Vacuum state",
- "server": "3bebce79.1e0962",
- "version": 1,
- "outputs": 1,
- "halt_if": "",
- "halt_if_type": "str",
- "halt_if_compare": "is",
- "override_topic": false,
- "entity_id": "vacuum.xiaomi_vacuum_cleaner",
- "state_type": "str",
- "state_location": "payload1",
- "override_payload": "msg",
- "entity_location": "data1",
- "override_data": "msg",
- "blockInputOverrides": false,
- "x": 460,
- "y": 740,
- "wires": [
- [
- "2651ec5f.c46fc4"
- ]
- ]
- },
- {
- "id": "700750af.2b8da",
- "type": "api-call-service",
- "z": "967995f2.033478",
- "name": "Goto dustbin",
- "server": "3bebce79.1e0962",
- "version": 1,
- "debugenabled": true,
- "service_domain": "xiaomi_miio",
- "service": "vacuum_goto",
- "entityId": "vacuum.xiaomi_vacuum_cleaner",
- "data": "{\"x_coord\":20200,\"y_coord\":27000}",
- "dataType": "json",
- "mergecontext": "",
- "output_location": "payload",
- "output_location_type": "msg",
- "mustacheAltTags": false,
- "x": 850,
- "y": 780,
- "wires": [
- []
- ]
- },
- {
- "id": "7923d8a6.963d48",
- "type": "server-state-changed",
- "z": "967995f2.033478",
- "name": "Vacuum is returning?",
- "server": "3bebce79.1e0962",
- "version": 1,
- "exposeToHomeAssistant": false,
- "haConfig": [
- {
- "property": "name",
- "value": ""
- },
- {
- "property": "icon",
- "value": ""
- }
- ],
- "entityidfilter": "vacuum.xiaomi_vacuum_cleaner",
- "entityidfiltertype": "exact",
- "outputinitially": false,
- "state_type": "str",
- "haltifstate": "returning",
- "halt_if_type": "str",
- "halt_if_compare": "is",
- "outputs": 2,
- "output_only_on_state_change": true,
- "x": 120,
- "y": 580,
- "wires": [
- [
- "20bb71d8.9dc3ae"
- ],
- []
- ]
- },
- {
- "id": "2651ec5f.c46fc4",
- "type": "change",
- "z": "967995f2.033478",
- "name": "Get cleaned area",
- "rules": [
- {
- "t": "set",
- "p": "payload",
- "pt": "msg",
- "to": "msg.data1.attributes.total_cleaned_area",
- "tot": "msg"
- }
- ],
- "action": "",
- "property": "",
- "from": "",
- "to": "",
- "reg": false,
- "x": 670,
- "y": 740,
- "wires": [
- [
- "2872b879.7cc788",
- "700750af.2b8da"
- ]
- ]
- },
- {
- "id": "1619e493.c1e5cb",
- "type": "trigger-state",
- "z": "967995f2.033478",
- "name": "Home state changed",
- "server": "3bebce79.1e0962",
- "exposeToHomeAssistant": false,
- "haConfig": [
- {
- "property": "name",
- "value": ""
- },
- {
- "property": "icon",
- "value": ""
- }
- ],
- "entityid": "person.alle",
- "entityidfiltertype": "exact",
- "debugenabled": false,
- "constraints": [],
- "outputs": 2,
- "customoutputs": [],
- "outputinitially": false,
- "state_type": "str",
- "x": 120,
- "y": 160,
- "wires": [
- [
- "39b74814.c4faa8"
- ],
- []
- ]
- },
- {
- "id": "39b74814.c4faa8",
- "type": "ha-get-entities",
- "z": "967995f2.033478",
- "server": "3bebce79.1e0962",
- "name": "Count home",
- "rules": [
- {
- "property": "entity_id",
- "logic": "starts_with",
- "value": "person.",
- "valueType": "str"
- },
- {
- "property": "state",
- "logic": "is",
- "value": "home",
- "valueType": "str"
- }
- ],
- "output_type": "count",
- "output_empty_results": false,
- "output_location_type": "msg",
- "output_location": "payload",
- "output_results_count": 1,
- "x": 330,
- "y": 160,
- "wires": [
- [
- "93c8e379.38e76"
- ]
- ]
- },
- {
- "id": "93c8e379.38e76",
- "type": "switch",
- "z": "967995f2.033478",
- "name": "Nobody home?",
- "property": "payload",
- "propertyType": "msg",
- "rules": [
- {
- "t": "eq",
- "v": "0",
- "vt": "num"
- },
- {
- "t": "else"
- }
- ],
- "checkall": "true",
- "repair": false,
- "outputs": 2,
- "x": 520,
- "y": 160,
- "wires": [
- [
- "cd40bece.b140b"
- ],
- []
- ]
- },
- {
- "id": "cd40bece.b140b",
- "type": "api-call-service",
- "z": "967995f2.033478",
- "name": "Send notifcation",
- "server": "3bebce79.1e0962",
- "version": 1,
- "debugenabled": false,
- "service_domain": "notify",
- "service": "mobile_app_anders_iphone",
- "entityId": "",
- "data": "{\"message\":\"Der er ingen hjemme. Skal jeg klare støvsugningen, mens I er væk?\",\"data\":{\"push\":{\"category\":\"vacuum_notification\"}}}",
- "dataType": "json",
- "mergecontext": "",
- "output_location": "",
- "output_location_type": "none",
- "mustacheAltTags": false,
- "x": 740,
- "y": 160,
- "wires": [
- []
- ]
- },
- {
- "id": "a6a7cdf0.b8d69",
- "type": "comment",
- "z": "967995f2.033478",
- "name": "Start cleaning from Lovelace via Dummy script",
- "info": "",
- "x": 190,
- "y": 30,
- "wires": []
- },
- {
- "id": "a7dc1ca.eaedde",
- "type": "change",
- "z": "967995f2.033478",
- "name": "Get room IDs only",
- "rules": [
- {
- "t": "set",
- "p": "payload",
- "pt": "msg",
- "to": "payload.entity_id",
- "tot": "msg"
- },
- {
- "t": "change",
- "p": "payload",
- "pt": "msg",
- "from": "input_boolean.clean_room_",
- "fromt": "str",
- "to": "",
- "tot": "str"
- }
- ],
- "action": "",
- "property": "",
- "from": "",
- "to": "",
- "reg": false,
- "x": 690,
- "y": 70,
- "wires": [
- [
- "cbc1c759.a32698"
- ]
- ]
- },
- {
- "id": "cbc1c759.a32698",
- "type": "join",
- "z": "967995f2.033478",
- "name": "Combine to array",
- "mode": "auto",
- "build": "object",
- "property": "payload",
- "propertyType": "msg",
- "key": "",
- "joiner": ",",
- "joinerType": "str",
- "accumulate": false,
- "timeout": "",
- "count": "",
- "reduceRight": false,
- "reduceExp": "",
- "reduceInit": "",
- "reduceInitType": "",
- "reduceFixup": "",
- "x": 890,
- "y": 70,
- "wires": [
- [
- "f0fe8062.94cdb"
- ]
- ]
- },
- {
- "id": "f0fe8062.94cdb",
- "type": "json",
- "z": "967995f2.033478",
- "name": "Format as JSON",
- "property": "payload",
- "action": "",
- "pretty": false,
- "x": 1090,
- "y": 70,
- "wires": [
- [
- "69523ea5.71763"
- ]
- ]
- },
- {
- "id": "69523ea5.71763",
- "type": "api-call-service",
- "z": "967995f2.033478",
- "name": "Start room cleaning",
- "server": "3bebce79.1e0962",
- "version": 1,
- "debugenabled": false,
- "service_domain": "vacuum",
- "service": "send_command",
- "entityId": "vacuum.xiaomi_vacuum_cleaner",
- "data": "{ \"command\": \"app_segment_clean\", \"params\": [{{payload}}]}",
- "dataType": "json",
- "mergecontext": "",
- "output_location": "payload",
- "output_location_type": "msg",
- "mustacheAltTags": false,
- "x": 1290,
- "y": 70,
- "wires": [
- []
- ]
- },
- {
- "id": "29b6f561.0a57da",
- "type": "server-events",
- "z": "967995f2.033478",
- "name": "",
- "server": "3bebce79.1e0962",
- "event_type": "call_service",
- "exposeToHomeAssistant": false,
- "haConfig": [
- {
- "property": "name",
- "value": ""
- },
- {
- "property": "icon",
- "value": ""
- }
- ],
- "waitForRunning": true,
- "x": 110,
- "y": 70,
- "wires": [
- [
- "fd3ab97b.bf6ac8"
- ]
- ]
- },
- {
- "id": "fd3ab97b.bf6ac8",
- "type": "switch",
- "z": "967995f2.033478",
- "name": "Vacuum script",
- "property": "payload.event.service",
- "propertyType": "msg",
- "rules": [
- {
- "t": "eq",
- "v": "nodered_vacuum",
- "vt": "str"
- }
- ],
- "checkall": "true",
- "repair": false,
- "outputs": 1,
- "x": 300,
- "y": 70,
- "wires": [
- [
- "240d3b30.3ae6c4"
- ]
- ]
- },
- {
- "id": "240d3b30.3ae6c4",
- "type": "ha-get-entities",
- "z": "967995f2.033478",
- "server": "3bebce79.1e0962",
- "name": "Get selected rooms",
- "rules": [
- {
- "property": "entity_id",
- "logic": "starts_with",
- "value": "input_boolean.clean_room",
- "valueType": "str"
- },
- {
- "property": "state",
- "logic": "is",
- "value": "on",
- "valueType": "str"
- }
- ],
- "output_type": "split",
- "output_empty_results": false,
- "output_location_type": "msg",
- "output_location": "payload",
- "output_results_count": 1,
- "x": 490,
- "y": 70,
- "wires": [
- [
- "a7dc1ca.eaedde"
- ]
- ]
- },
- {
- "id": "3bebce79.1e0962",
- "type": "server",
- "name": "Home Assistant",
- "addon": true
- }
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement