diff --git a/flows.json b/flows.json index 105242e..70a89c3 100644 --- a/flows.json +++ b/flows.json @@ -13,11 +13,6 @@ } ] }, - { - "id": "a320f821a7cb3f55", - "type": "tab", - "label": "Maintenance" - }, { "id": "97e0f1338e182d76", "type": "tab", @@ -3212,932 +3207,6 @@ "x": 2340, "y": 720 }, - { - "id": "ecee1bee9953f98a", - "type": "ha-get-entities", - "z": "a320f821a7cb3f55", - "name": "Low Bat Sensors", - "wires": [ - [ - "5f8552a4635072aa" - ] - ], - "server": "657c7463.48e1e4", - "version": 1, - "rules": [ - { - "property": "entity_id", - "logic": "is", - "value": ".*low_bat.*", - "valueType": "re" - }, - { - "property": "attributes.battery", - "logic": "is_not", - "value": "High", - "valueType": "str" - } - ], - "outputType": "array", - "outputEmptyResults": false, - "outputLocationType": "msg", - "outputLocation": "payload", - "outputResultsCount": 1, - "x": 550, - "y": 180 - }, - { - "id": "1b30535ba22c4655", - "type": "inject", - "z": "a320f821a7cb3f55", - "name": "", - "wires": [ - [ - "293113adda48f9d0" - ] - ], - "props": [ - { - "p": "payload" - }, - { - "p": "topic", - "vt": "str" - } - ], - "repeat": "", - "crontab": "", - "once": false, - "onceDelay": 0.1, - "topic": "", - "payload": "", - "payloadType": "date", - "x": 160, - "y": 240 - }, - { - "id": "b9891a936c8fb9d0", - "type": "debug", - "z": "a320f821a7cb3f55", - "name": "debug 3", - "wires": [], - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "false", - "statusVal": "", - "statusType": "auto", - "x": 1040, - "y": 540 - }, - { - "id": "556cc66d606c190e", - "type": "ha-get-entities", - "z": "a320f821a7cb3f55", - "name": "Battery Sensors - Low", - "wires": [ - [ - "5f8552a4635072aa" - ] - ], - "server": "657c7463.48e1e4", - "version": 1, - "rules": [ - { - "property": "entity_id", - "logic": "is", - "value": ".*battery.*", - "valueType": "re" - }, - { - "property": "attributes.state_class", - "logic": "is", - "value": "measurement", - "valueType": "str" - }, - { - "property": "state", - "logic": "lt", - "value": "10", - "valueType": "num" - } - ], - "outputType": "array", - "outputEmptyResults": false, - "outputLocationType": "msg", - "outputLocation": "payload", - "outputResultsCount": 1, - "x": 560, - "y": 300 - }, - { - "id": "1e34ff50a693e724", - "type": "ha-get-entities", - "z": "a320f821a7cb3f55", - "name": "Battery Sensors", - "wires": [ - [ - "b9891a936c8fb9d0" - ] - ], - "server": "657c7463.48e1e4", - "version": 1, - "rules": [ - { - "property": "entity_id", - "logic": "is", - "value": ".*battery.*", - "valueType": "re" - } - ], - "outputType": "array", - "outputEmptyResults": false, - "outputLocationType": "msg", - "outputLocation": "payload", - "outputResultsCount": 1, - "x": 540, - "y": 540 - }, - { - "id": "89a7c77a676b858b", - "type": "ha-get-entities", - "z": "a320f821a7cb3f55", - "name": "Battery Sensors - Unavailable", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 1, - "rules": [ - { - "property": "entity_id", - "logic": "is", - "value": ".*battery.*", - "valueType": "re" - }, - { - "property": "attributes.state_class", - "logic": "is", - "value": "measurement", - "valueType": "str" - }, - { - "property": "state", - "logic": "is", - "value": "unavailable", - "valueType": "str" - } - ], - "outputType": "array", - "outputEmptyResults": false, - "outputLocationType": "msg", - "outputLocation": "payload", - "outputResultsCount": 1, - "x": 590, - "y": 420 - }, - { - "id": "91f002d04003ce84", - "type": "comment", - "z": "a320f821a7cb3f55", - "name": "Filter for all *battery* entities", - "wires": [], - "info": "", - "x": 580, - "y": 500 - }, - { - "id": "ac0b28356c7eb45a", - "type": "comment", - "z": "a320f821a7cb3f55", - "name": "HomeMatic Devices", - "wires": [], - "info": "", - "x": 550, - "y": 140 - }, - { - "id": "a8192e1fcbdc41aa", - "type": "comment", - "z": "a320f821a7cb3f55", - "name": "Hue devices", - "wires": [], - "info": "", - "x": 530, - "y": 260 - }, - { - "id": "6beef06f4f0b788d", - "type": "comment", - "z": "a320f821a7cb3f55", - "name": "Any unavailable device", - "wires": [], - "info": "", - "x": 560, - "y": 380 - }, - { - "id": "5f8552a4635072aa", - "type": "split", - "z": "a320f821a7cb3f55", - "name": "", - "wires": [ - [ - "9dcd82782246d4e9" - ] - ], - "splt": "\\n", - "spltType": "str", - "arraySplt": 1, - "arraySpltType": "len", - "stream": false, - "addname": "", - "x": 850, - "y": 300 - }, - { - "id": "cc33a58286775199", - "type": "api-call-service", - "z": "a320f821a7cb3f55", - "name": "Notify via HA", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "notify.gotify_ha", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [], - "labelId": [], - "data": "{\"title\":\"warning\",\"message\":\"{{{payload}}}\"}", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "notify", - "service": "gotify_ha", - "output_location": "", - "output_location_type": "none", - "x": 1270, - "y": 300 - }, - { - "id": "9dcd82782246d4e9", - "type": "template", - "z": "a320f821a7cb3f55", - "name": "", - "wires": [ - [ - "cc33a58286775199" - ] - ], - "field": "payload", - "fieldType": "msg", - "format": "handlebars", - "syntax": "mustache", - "template": "Battery level low for {{payload.attributes.friendly_name}} ({{payload.state}}%)", - "output": "str", - "x": 1060, - "y": 300 - }, - { - "id": "293113adda48f9d0", - "type": "schedex", - "z": "a320f821a7cb3f55", - "name": "Saturday at 11:00", - "wires": [ - [ - "ecee1bee9953f98a", - "556cc66d606c190e", - "89a7c77a676b858b" - ] - ], - "passthroughunhandled": true, - "suspended": false, - "lat": "", - "lon": "", - "ontime": "11:00", - "ontopic": "", - "onpayload": "", - "onoffset": 0, - "onrandomoffset": 0, - "offtime": "", - "offtopic": "", - "offpayload": "", - "offoffset": 0, - "offrandomoffset": 0, - "mon": false, - "tue": false, - "wed": false, - "thu": false, - "fri": true, - "sat": true, - "sun": false, - "x": 190, - "y": 300 - }, - { - "id": "edaf40fcc105703a", - "type": "comment", - "z": "a320f821a7cb3f55", - "name": "Battery state alerts for all devices", - "wires": [], - "info": "", - "x": 170, - "y": 140 - }, - { - "id": "e4eda627074a2cf3", - "type": "comment", - "z": "a320f821a7cb3f55", - "name": "Unavailable devices alert", - "wires": [], - "info": "Any devices that becomes unavailable in Home Assistant will be reported. This might indicate zigbee connecticity issues.", - "x": 150, - "y": 620 - }, - { - "id": "a2a4917908eed983", - "type": "trigger-state", - "z": "a320f821a7cb3f55", - "name": "", - "wires": [ - [ - "deb32f94b6f9aad7" - ], - [] - ], - "d": true, - "server": "657c7463.48e1e4", - "version": 5, - "inputs": 0, - "outputs": 2, - "exposeAsEntityConfig": "", - "entities": { - "entity": [], - "substring": [], - "regex": [ - ".*" - ] - }, - "debugEnabled": false, - "constraints": [ - { - "targetType": "this_entity", - "targetValue": "", - "propertyType": "current_state", - "propertyValue": "new_state.state", - "comparatorType": "is", - "comparatorValueDatatype": "str", - "comparatorValue": "unavailable" - } - ], - "customOutputs": [], - "outputInitially": false, - "stateType": "str", - "enableInput": false, - "x": 120, - "y": 680 - }, - { - "id": "deb32f94b6f9aad7", - "type": "debug", - "z": "a320f821a7cb3f55", - "name": "State changed debug", - "wires": [], - "active": false, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "payload", - "targetType": "msg", - "statusVal": "", - "statusType": "auto", - "x": 500, - "y": 680 - }, - { - "id": "comment-heos-individual", - "type": "comment", - "z": "a320f821a7cb3f55", - "name": "HEOS individual speaker reset via TCP", - "wires": [], - "info": "", - "x": 200, - "y": 760 - }, - { - "id": "comment-heos-all", - "type": "comment", - "z": "a320f821a7cb3f55", - "name": "HEOS reset all speakers sequentially", - "wires": [], - "info": "", - "x": 200, - "y": 1120 - }, - { - "id": "heos-trigger-bedroom", - "type": "server-state-changed", - "z": "a320f821a7cb3f55", - "name": "Reset Speaker Bedroom", - "wires": [ - [ - "heos-change-target" - ] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_button.reset_speaker_bedroom" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": 0, - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - }, - { - "property": "speaker", - "propertyType": "msg", - "value": "Bedroom", - "valueType": "str" - }, - { - "property": "ip", - "propertyType": "msg", - "value": "192.168.1.XXX", - "valueType": "str" - } - ], - "x": 160, - "y": 800 - }, - { - "id": "heos-trigger-kitchen", - "type": "server-state-changed", - "z": "a320f821a7cb3f55", - "name": "Reset Speaker Kitchen", - "wires": [ - [ - "heos-change-target" - ] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_button.reset_speaker_kitchen" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": 0, - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - }, - { - "property": "speaker", - "propertyType": "msg", - "value": "Kitchen", - "valueType": "str" - }, - { - "property": "ip", - "propertyType": "msg", - "value": "192.168.1.XXX", - "valueType": "str" - } - ], - "x": 160, - "y": 880 - }, - { - "id": "heos-trigger-bathroom", - "type": "server-state-changed", - "z": "a320f821a7cb3f55", - "name": "Reset Speaker Bathroom", - "wires": [ - [ - "heos-change-target" - ] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_button.reset_speaker_bathroom" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": 0, - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - }, - { - "property": "speaker", - "propertyType": "msg", - "value": "Bathroom", - "valueType": "str" - }, - { - "property": "ip", - "propertyType": "msg", - "value": "192.168.1.XXX", - "valueType": "str" - } - ], - "x": 160, - "y": 960 - }, - { - "id": "heos-trigger-hometheater", - "type": "server-state-changed", - "z": "a320f821a7cb3f55", - "name": "Reset Speaker Home Theater", - "wires": [ - [ - "heos-change-target" - ] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_button.reset_speaker_home_theater" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": 0, - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - }, - { - "property": "speaker", - "propertyType": "msg", - "value": "Home Theater", - "valueType": "str" - }, - { - "property": "ip", - "propertyType": "msg", - "value": "192.168.1.XXX", - "valueType": "str" - } - ], - "x": 160, - "y": 1040 - }, - { - "id": "heos-change-target", - "type": "change", - "z": "a320f821a7cb3f55", - "name": "Set speaker target", - "wires": [ - [ - "heos-tcp", - "heos-debug" - ] - ], - "rules": [ - { - "t": "set", - "p": "host", - "pt": "msg", - "to": "ip", - "tot": "msg" - }, - { - "t": "set", - "p": "port", - "pt": "msg", - "to": "1255", - "tot": "num" - }, - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "heos://system/reboot\r\n", - "tot": "str" - }, - { - "t": "set", - "p": "topic", - "pt": "msg", - "to": "\"Reboot \" & msg.speaker & \" @ \" & msg.ip & \":1255\"", - "tot": "jsonata" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 410, - "y": 920 - }, - { - "id": "heos-tcp", - "type": "tcp request", - "z": "a320f821a7cb3f55", - "name": "Telnet HEOS", - "wires": [ - [] - ], - "server": "", - "port": "", - "out": "immed", - "ret": "string", - "splitc": "0", - "newline": "", - "trim": false, - "tls": "", - "x": 620, - "y": 880 - }, - { - "id": "heos-debug", - "type": "debug", - "z": "a320f821a7cb3f55", - "name": "HEOS command (debug)", - "wires": [], - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "true", - "targetType": "full", - "statusVal": "", - "statusType": "auto", - "x": 620, - "y": 960 - }, - { - "id": "heos-trigger-all", - "type": "server-state-changed", - "z": "a320f821a7cb3f55", - "name": "Reset All Speakers", - "wires": [ - [ - "heos-emit-all" - ] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_button.reset_all_speakers" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": 0, - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 160, - "y": 1160 - }, - { - "id": "heos-emit-all", - "type": "function", - "z": "a320f821a7cb3f55", - "name": "Emit 4 button presses", - "wires": [ - [ - "heos-delay-all" - ] - ], - "func": "const buttons = [\n \"input_button.reset_speaker_bedroom\",\n \"input_button.reset_speaker_kitchen\",\n \"input_button.reset_speaker_bathroom\",\n \"input_button.reset_speaker_home_theater\"\n];\nreturn [buttons.map(b => ({ ...msg, payload: b }))];", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 380, - "y": 1160 - }, - { - "id": "heos-delay-all", - "type": "delay", - "z": "a320f821a7cb3f55", - "name": "5s between resets", - "wires": [ - [ - "heos-service-press" - ] - ], - "pauseType": "rate", - "timeout": "5", - "timeoutUnits": "seconds", - "rate": "1", - "nbRateUnits": "5", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": false, - "allowrate": false, - "outputs": 1, - "x": 580, - "y": 1160 - }, - { - "id": "heos-service-press", - "type": "api-call-service", - "z": "a320f821a7cb3f55", - "name": "Press speaker reset button", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "input_button.press", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [], - "labelId": [], - "data": "{\"entity_id\": payload}", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "input_button", - "service": "press", - "x": 780, - "y": 1160 - }, { "id": "d46b0ef0ec904159", "type": "server-state-changed", @@ -22786,5 +21855,1002 @@ "output_location_type": "none", "x": 660, "y": 1300 + }, + { + "type": "tab", + "label": "Maintenance", + "id": "a320f821a7cb3f55" + }, + { + "id": "ecee1bee9953f98a", + "type": "ha-get-entities", + "z": "a320f821a7cb3f55", + "name": "Low Bat Sensors", + "wires": [ + [ + "5f8552a4635072aa" + ] + ], + "server": "657c7463.48e1e4", + "version": 1, + "rules": [ + { + "property": "entity_id", + "logic": "is", + "value": ".*low_bat.*", + "valueType": "re" + }, + { + "property": "attributes.battery", + "logic": "is_not", + "value": "High", + "valueType": "str" + } + ], + "outputType": "array", + "outputEmptyResults": false, + "outputLocationType": "msg", + "outputLocation": "payload", + "outputResultsCount": 1, + "x": 550, + "y": 180 + }, + { + "id": "1b30535ba22c4655", + "type": "inject", + "z": "a320f821a7cb3f55", + "name": "", + "wires": [ + [ + "293113adda48f9d0" + ] + ], + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 160, + "y": 240 + }, + { + "id": "b9891a936c8fb9d0", + "type": "debug", + "z": "a320f821a7cb3f55", + "name": "debug 3", + "wires": [], + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "statusVal": "", + "statusType": "auto", + "x": 1040, + "y": 540 + }, + { + "id": "556cc66d606c190e", + "type": "ha-get-entities", + "z": "a320f821a7cb3f55", + "name": "Battery Sensors - Low", + "wires": [ + [ + "5f8552a4635072aa" + ] + ], + "server": "657c7463.48e1e4", + "version": 1, + "rules": [ + { + "property": "entity_id", + "logic": "is", + "value": ".*battery.*", + "valueType": "re" + }, + { + "property": "attributes.state_class", + "logic": "is", + "value": "measurement", + "valueType": "str" + }, + { + "property": "state", + "logic": "lt", + "value": "10", + "valueType": "num" + } + ], + "outputType": "array", + "outputEmptyResults": false, + "outputLocationType": "msg", + "outputLocation": "payload", + "outputResultsCount": 1, + "x": 560, + "y": 300 + }, + { + "id": "1e34ff50a693e724", + "type": "ha-get-entities", + "z": "a320f821a7cb3f55", + "name": "Battery Sensors", + "wires": [ + [ + "b9891a936c8fb9d0" + ] + ], + "server": "657c7463.48e1e4", + "version": 1, + "rules": [ + { + "property": "entity_id", + "logic": "is", + "value": ".*battery.*", + "valueType": "re" + } + ], + "outputType": "array", + "outputEmptyResults": false, + "outputLocationType": "msg", + "outputLocation": "payload", + "outputResultsCount": 1, + "x": 540, + "y": 540 + }, + { + "id": "89a7c77a676b858b", + "type": "ha-get-entities", + "z": "a320f821a7cb3f55", + "name": "Battery Sensors - Unavailable", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 1, + "rules": [ + { + "property": "entity_id", + "logic": "is", + "value": ".*battery.*", + "valueType": "re" + }, + { + "property": "attributes.state_class", + "logic": "is", + "value": "measurement", + "valueType": "str" + }, + { + "property": "state", + "logic": "is", + "value": "unavailable", + "valueType": "str" + } + ], + "outputType": "array", + "outputEmptyResults": false, + "outputLocationType": "msg", + "outputLocation": "payload", + "outputResultsCount": 1, + "x": 590, + "y": 420 + }, + { + "id": "91f002d04003ce84", + "type": "comment", + "z": "a320f821a7cb3f55", + "name": "Filter for all *battery* entities", + "wires": [], + "info": "", + "x": 580, + "y": 500 + }, + { + "id": "ac0b28356c7eb45a", + "type": "comment", + "z": "a320f821a7cb3f55", + "name": "HomeMatic Devices", + "wires": [], + "info": "", + "x": 550, + "y": 140 + }, + { + "id": "a8192e1fcbdc41aa", + "type": "comment", + "z": "a320f821a7cb3f55", + "name": "Hue devices", + "wires": [], + "info": "", + "x": 530, + "y": 260 + }, + { + "id": "6beef06f4f0b788d", + "type": "comment", + "z": "a320f821a7cb3f55", + "name": "Any unavailable device", + "wires": [], + "info": "", + "x": 560, + "y": 380 + }, + { + "id": "5f8552a4635072aa", + "type": "split", + "z": "a320f821a7cb3f55", + "name": "", + "wires": [ + [ + "9dcd82782246d4e9" + ] + ], + "splt": "\\n", + "spltType": "str", + "arraySplt": 1, + "arraySpltType": "len", + "stream": false, + "addname": "", + "x": 850, + "y": 300 + }, + { + "id": "cc33a58286775199", + "type": "api-call-service", + "z": "a320f821a7cb3f55", + "name": "Notify via HA", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "notify.gotify_ha", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [], + "labelId": [], + "data": "{\"title\":\"warning\",\"message\":\"{{{payload}}}\"}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "notify", + "service": "gotify_ha", + "output_location": "", + "output_location_type": "none", + "x": 1270, + "y": 300 + }, + { + "id": "9dcd82782246d4e9", + "type": "template", + "z": "a320f821a7cb3f55", + "name": "", + "wires": [ + [ + "cc33a58286775199" + ] + ], + "field": "payload", + "fieldType": "msg", + "format": "handlebars", + "syntax": "mustache", + "template": "Battery level low for {{payload.attributes.friendly_name}} ({{payload.state}}%)", + "output": "str", + "x": 1060, + "y": 300 + }, + { + "id": "293113adda48f9d0", + "type": "schedex", + "z": "a320f821a7cb3f55", + "name": "Saturday at 11:00", + "wires": [ + [ + "ecee1bee9953f98a", + "556cc66d606c190e", + "89a7c77a676b858b" + ] + ], + "passthroughunhandled": true, + "suspended": false, + "lat": "", + "lon": "", + "ontime": "11:00", + "ontopic": "", + "onpayload": "", + "onoffset": 0, + "onrandomoffset": 0, + "offtime": "", + "offtopic": "", + "offpayload": "", + "offoffset": 0, + "offrandomoffset": 0, + "mon": false, + "tue": false, + "wed": false, + "thu": false, + "fri": true, + "sat": true, + "sun": false, + "x": 190, + "y": 300 + }, + { + "id": "edaf40fcc105703a", + "type": "comment", + "z": "a320f821a7cb3f55", + "name": "Battery state alerts for all devices", + "wires": [], + "info": "", + "x": 170, + "y": 140 + }, + { + "id": "e4eda627074a2cf3", + "type": "comment", + "z": "a320f821a7cb3f55", + "name": "Unavailable devices alert", + "wires": [], + "info": "Any devices that becomes unavailable in Home Assistant will be reported. This might indicate zigbee connecticity issues.", + "x": 150, + "y": 620 + }, + { + "id": "a2a4917908eed983", + "type": "trigger-state", + "z": "a320f821a7cb3f55", + "name": "", + "wires": [ + [ + "deb32f94b6f9aad7" + ], + [] + ], + "d": true, + "server": "657c7463.48e1e4", + "version": 5, + "inputs": 0, + "outputs": 2, + "exposeAsEntityConfig": "", + "entities": { + "entity": [], + "substring": [], + "regex": [ + ".*" + ] + }, + "debugEnabled": false, + "constraints": [ + { + "targetType": "this_entity", + "targetValue": "", + "propertyType": "current_state", + "propertyValue": "new_state.state", + "comparatorType": "is", + "comparatorValueDatatype": "str", + "comparatorValue": "unavailable" + } + ], + "customOutputs": [], + "outputInitially": false, + "stateType": "str", + "enableInput": false, + "x": 120, + "y": 680 + }, + { + "id": "deb32f94b6f9aad7", + "type": "debug", + "z": "a320f821a7cb3f55", + "name": "State changed debug", + "wires": [], + "active": false, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "payload", + "targetType": "msg", + "statusVal": "", + "statusType": "auto", + "x": 500, + "y": 680 + }, + { + "id": "comment-heos-individual", + "type": "comment", + "z": "a320f821a7cb3f55", + "name": "HEOS individual speaker reset via TCP", + "wires": [], + "info": "", + "x": 200, + "y": 760 + }, + { + "id": "comment-heos-all", + "type": "comment", + "z": "a320f821a7cb3f55", + "name": "HEOS reset all speakers sequentially", + "wires": [], + "info": "", + "x": 200, + "y": 1120 + }, + { + "id": "heos-trigger-bedroom", + "type": "server-state-changed", + "z": "a320f821a7cb3f55", + "name": "Reset Speaker Bedroom", + "wires": [ + [ + "heos-change-target" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_button.reset_speaker_bedroom" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": 0, + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + }, + { + "property": "speaker", + "propertyType": "msg", + "value": "Bedroom", + "valueType": "str" + }, + { + "property": "ip", + "propertyType": "msg", + "value": "192.168.1.60", + "valueType": "str" + } + ], + "x": 160, + "y": 800 + }, + { + "id": "heos-trigger-kitchen", + "type": "server-state-changed", + "z": "a320f821a7cb3f55", + "name": "Reset Speaker Kitchen", + "wires": [ + [ + "heos-change-target" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_button.reset_speaker_kitchen" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": 0, + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + }, + { + "property": "speaker", + "propertyType": "msg", + "value": "Kitchen", + "valueType": "str" + }, + { + "property": "ip", + "propertyType": "msg", + "value": "192.168.1.62", + "valueType": "str" + } + ], + "x": 160, + "y": 880 + }, + { + "id": "heos-trigger-bathroom", + "type": "server-state-changed", + "z": "a320f821a7cb3f55", + "name": "Reset Speaker Bathroom", + "wires": [ + [ + "heos-change-target" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_button.reset_speaker_bathroom" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": 0, + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + }, + { + "property": "speaker", + "propertyType": "msg", + "value": "Bathroom", + "valueType": "str" + }, + { + "property": "ip", + "propertyType": "msg", + "value": "192.168.1.61", + "valueType": "str" + } + ], + "x": 160, + "y": 960 + }, + { + "id": "heos-trigger-hometheater", + "type": "server-state-changed", + "z": "a320f821a7cb3f55", + "name": "Reset Speaker Home Theater", + "wires": [ + [ + "heos-change-target" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_button.reset_speaker_home_theater" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": 0, + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + }, + { + "property": "speaker", + "propertyType": "msg", + "value": "Home Theater", + "valueType": "str" + }, + { + "property": "ip", + "propertyType": "msg", + "value": "192.168.1.204", + "valueType": "str" + } + ], + "x": 160, + "y": 1040 + }, + { + "id": "heos-change-target", + "type": "change", + "z": "a320f821a7cb3f55", + "name": "Set speaker target", + "wires": [ + [ + "heos-tcp", + "heos-debug" + ] + ], + "rules": [ + { + "t": "set", + "p": "host", + "pt": "msg", + "to": "ip", + "tot": "msg" + }, + { + "t": "set", + "p": "port", + "pt": "msg", + "to": "1255", + "tot": "num" + }, + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "heos://system/reboot\r\n", + "tot": "str" + }, + { + "t": "set", + "p": "topic", + "pt": "msg", + "to": "\"Reboot \" & msg.speaker & \" @ \" & msg.ip & \":1255\"", + "tot": "jsonata" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 410, + "y": 920 + }, + { + "id": "heos-tcp", + "type": "tcp request", + "z": "a320f821a7cb3f55", + "name": "Telnet HEOS", + "wires": [ + [] + ], + "server": "", + "port": "", + "out": "immed", + "ret": "string", + "splitc": "0", + "newline": "", + "trim": false, + "tls": "", + "x": 620, + "y": 880 + }, + { + "id": "heos-debug", + "type": "debug", + "z": "a320f821a7cb3f55", + "name": "HEOS command (debug)", + "wires": [], + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 620, + "y": 960 + }, + { + "id": "heos-trigger-all", + "type": "server-state-changed", + "z": "a320f821a7cb3f55", + "name": "Reset All Speakers", + "wires": [ + [ + "heos-emit-all" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_button.reset_all_speakers" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": 0, + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 160, + "y": 1160 + }, + { + "id": "heos-emit-all", + "type": "function", + "z": "a320f821a7cb3f55", + "name": "Emit 4 button presses", + "wires": [ + [ + "heos-delay-all" + ] + ], + "func": "const buttons = [\n \"input_button.reset_speaker_bedroom\",\n \"input_button.reset_speaker_kitchen\",\n \"input_button.reset_speaker_bathroom\",\n \"input_button.reset_speaker_home_theater\"\n];\nreturn [buttons.map(b => ({ ...msg, payload: b }))];", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 380, + "y": 1160 + }, + { + "id": "heos-delay-all", + "type": "delay", + "z": "a320f821a7cb3f55", + "name": "5s between resets", + "wires": [ + [ + "heos-service-press" + ] + ], + "pauseType": "rate", + "timeout": "5", + "timeoutUnits": "seconds", + "rate": "1", + "nbRateUnits": "5", + "rateUnits": "second", + "randomFirst": "1", + "randomLast": "5", + "randomUnits": "seconds", + "drop": false, + "allowrate": false, + "outputs": 1, + "x": 580, + "y": 1160 + }, + { + "id": "heos-service-press", + "type": "api-call-service", + "z": "a320f821a7cb3f55", + "name": "Press speaker reset button", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "input_button.press", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [], + "labelId": [], + "data": "{\"entity_id\": payload}", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "input_button", + "service": "press", + "x": 780, + "y": 1160 + }, + { + "id": "p2catch_mnt", + "type": "catch", + "z": "a320f821a7cb3f55", + "name": "Catch all errors", + "wires": [ + [ + "p2fmt_mnt" + ] + ], + "scope": null, + "uncaught": false, + "x": 160, + "y": 1360 + }, + { + "id": "p2fmt_mnt", + "type": "function", + "z": "a320f821a7cb3f55", + "name": "Format error", + "wires": [ + [ + "p2ntfy_mnt" + ] + ], + "func": "const err = (msg.error && msg.error.message) ? msg.error.message : String(msg.payload || 'Unknown error');\nconst src = (msg.error && msg.error.source) ? (msg.error.source.name || msg.error.source.id || '') : '';\nmsg.payload = JSON.stringify({\n title: 'Node-RED Error: Maintenance',\n message: err + (src ? '\\n\\nNode: ' + src : '')\n});\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "timeout": "", + "x": 400, + "y": 1360 + }, + { + "id": "p2ntfy_mnt", + "type": "api-call-service", + "z": "a320f821a7cb3f55", + "name": "Notify error", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "notify.gotify_ha", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [], + "labelId": [], + "data": "{{{payload}}}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "notify", + "service": "gotify_ha", + "output_location": "", + "output_location_type": "none", + "x": 660, + "y": 1360 } ] \ No newline at end of file