Direkt zum Hauptinhalt

Rauchmelder Beispiel mit Benachrichtigungen

Beschreibung:

Ein Rauchmelder Beispiel mit Stopp Benachrichtigung:

Es wurden zwei Rauchmelder definiert und jenachdem Weclher als erstes Auslöst gibt die Nachricht per TTS aus.

grafik.png

DIe States sind die Rauchmelder, diese triggern die Send Action Buttons, also die Nachricht die eingeblendet wird um den TTS wieder stoppen. Und sie setzten eine globale Variable mit dem Text des Rauchmelders.
Dann wird die abort false gesetzt. Dann gehts in die schleife die checkt ob abort true ist. Ist dies nicht der fall gehts an die nachricht sagen dann 10 sekunden warten und wieder zum check. solange bis auf dem button stopp gedrückt wurde.
Dann wird bort zu true und die schleife wird beendet.

Hier einmal der Komplette code als export:

[
    {
        "id": "a9c36cccf58982c2",
        "type": "tab",
        "label": "Flow 78",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "86e5a3c4fa86cfd1",
        "type": "switch",
        "z": "a9c36cccf58982c2",
        "name": "Check abort",
        "property": "abort",
        "propertyType": "global",
        "rules": [
            {
                "t": "false"
            },
            {
                "t": "true"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 870,
        "y": 400,
        "wires": [
            [
                "7af0755b07585ec5"
            ],
            [
                "c7a9bf4239b1f8b6"
            ]
        ]
    },
    {
        "id": "bce92f530b3cdf44",
        "type": "api-call-service",
        "z": "a9c36cccf58982c2",
        "name": "Send  Actions Buttons",
        "server": "0b5c0a092e06b662",
        "version": 5,
        "debugenabled": false,
        "domain": "notify",
        "service": "mobile_app_gm1913",
        "areaId": [],
        "deviceId": [],
        "entityId": [],
        "data": "{\"message\":\"Rauchmelder-Alarm! Bitte überprüfen!\",\"data\":{\"channel\":\"Alarm\",\"priority\":\"high\",\"ttl\":0,\"sticky\":true,\"persistent\":true,\"url\":null,\"clickAction\":\"noAction\",\"actions\":[{\"action\":\"SNOOZE\",\"title\":\"Rauchmelder Stoppen\"}]}}",
        "dataType": "json",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "data"
            }
        ],
        "queue": "none",
        "x": 680,
        "y": 80,
        "wires": [
            []
        ]
    },
    {
        "id": "39d843e539471d4b",
        "type": "delay",
        "z": "a9c36cccf58982c2",
        "name": "",
        "pauseType": "delay",
        "timeout": "10",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "5",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": true,
        "allowrate": false,
        "outputs": 1,
        "x": 1330,
        "y": 100,
        "wires": [
            [
                "86e5a3c4fa86cfd1"
            ]
        ]
    },
    {
        "id": "7af0755b07585ec5",
        "type": "api-call-service",
        "z": "a9c36cccf58982c2",
        "name": "TTS Racuheraknnt auf dem Media Stream Alarm",
        "server": "0b5c0a092e06b662",
        "version": 5,
        "debugenabled": true,
        "domain": "notify",
        "service": "mobile_app_gm1913",
        "areaId": [],
        "deviceId": [],
        "entityId": [],
        "data": "{\"message\":\"TTS\",\"data\":{\"priority\":\"high\",\"sticky\":true,\"persistent\":true,\"url\":null,\"clickAction\":\"noAction\",\"media_stream\":\"alarm_stream\",\"tts_text\":\"Rauch {{ global.rauchmeldertext }} erkannt\"}}",
        "dataType": "json",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 1000,
        "y": 80,
        "wires": [
            [
                "39d843e539471d4b"
            ]
        ]
    },
    {
        "id": "ea362ac55f6f7a6f",
        "type": "change",
        "z": "a9c36cccf58982c2",
        "name": "Set abort faLSE",
        "rules": [
            {
                "t": "set",
                "p": "abort",
                "pt": "global",
                "to": "false",
                "tot": "bool"
            }
        ],
        "x": 740,
        "y": 460,
        "wires": [
            [
                "86e5a3c4fa86cfd1"
            ]
        ]
    },
    {
        "id": "c7a9bf4239b1f8b6",
        "type": "debug",
        "z": "a9c36cccf58982c2",
        "name": "debug 8",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1260,
        "y": 400,
        "wires": []
    },
    {
        "id": "5a79ebe91f9a2a96",
        "type": "server-state-changed",
        "z": "a9c36cccf58982c2",
        "name": "",
        "server": "0b5c0a092e06b662",
        "version": 4,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfilter": "binary_sensor.smoke_detected_1",
        "entityidfiltertype": "exact",
        "outputinitially": false,
        "state_type": "str",
        "haltifstate": "on",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "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": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "eventData"
            },
            {
                "property": "topic",
                "propertyType": "msg",
                "value": "",
                "valueType": "triggerId"
            }
        ],
        "x": 200,
        "y": 60,
        "wires": [
            [
                "bce92f530b3cdf44",
                "9d8c7aaab7f78142"
            ],
            []
        ]
    },
    {
        "id": "9d8c7aaab7f78142",
        "type": "change",
        "z": "a9c36cccf58982c2",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "rauchmeldertext",
                "pt": "global",
                "to": "Fahrradschuppen",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 240,
        "y": 120,
        "wires": [
            [
                "ea362ac55f6f7a6f"
            ]
        ]
    },
    {
        "id": "b7999f22e731b194",
        "type": "server-state-changed",
        "z": "a9c36cccf58982c2",
        "name": "",
        "server": "0b5c0a092e06b662",
        "version": 4,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfilter": "binary_sensor.smoke_detected_2",
        "entityidfiltertype": "exact",
        "outputinitially": false,
        "state_type": "str",
        "haltifstate": "on",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "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": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "eventData"
            },
            {
                "property": "topic",
                "propertyType": "msg",
                "value": "",
                "valueType": "triggerId"
            }
        ],
        "x": 180,
        "y": 400,
        "wires": [
            [
                "c5c9a8285b30fd81",
                "bce92f530b3cdf44"
            ],
            []
        ]
    },
    {
        "id": "c5c9a8285b30fd81",
        "type": "change",
        "z": "a9c36cccf58982c2",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "rauchmeldertext",
                "pt": "global",
                "to": "Wohnstube",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 460,
        "y": 520,
        "wires": [
            [
                "ea362ac55f6f7a6f"
            ]
        ]
    },
    {
        "id": "0b5c0a092e06b662",
        "type": "server",
        "name": "Home Assistant",
        "version": 5,
        "addon": true,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true,
        "heartbeat": false,
        "heartbeatInterval": "30",
        "areaSelector": "friendlyName",
        "deviceSelector": "friendlyName",
        "entitySelector": "friendlyName",
        "statusSeparator": ": ",
        "statusYear": "hidden",
        "statusMonth": "short",
        "statusDay": "numeric",
        "statusHourCycle": "default",
        "statusTimeFormat": "h:m",
        "enableGlobalContextStore": false
    }
]