Die letzten sechs Beiträge:

Über mich

Wie viele ....

Random Post
Search
  • Home
  • Category Archives: Edis Blog
Search
  • Window- Doorsensor Monitoring with ZigBee2MQTT, Node-RED on a Raspi

    Overview

    This Node-RED flow is designed to monitor a ZigBee-based WC (restroom) window sensor. It detects the window status (open/closed) and monitors the sensor’s battery level. Relevant state changes trigger Pushover notifications. Now a new Version is online V1.1 with little improvements in the Dashboard when the flow starts.

    Features

    • Window Status Detection: Identifies whether the window is open or closed.
    • Battery Status Monitoring: Keeps track of the sensor’s battery level.
    • Notification System: Sends Pushover notifications when the sensor contact is open for a adjustable time, when the sensor will be closed or the battery level is low.

    Requirements

    • Node-RED installed
    • ZigBee sensor compatible with Node-RED (i have used the Aquara MCCGQ11LM)
    • Pushover credentials to use the notification feature

    Installation

    1. Install Node-RED your desired system.
    2. Required Nodes: Dashboard, Pushover, ZigBee2MQTT, node-red-contrib-ui-led
    3. Import the flow into Node-RED.
    4. Create an Pushover Account if you don´t have
    5. Configure the required Pushover Api Node with your credentials.
    6. Activate and test the flow.

    Usage

    • The flow runs automatically in the background and monitors the sensor.
    • A push notification is sent if the window is opened for an adjustable time, when it ist closed or the battery is low.

    License

    This project is licensed under the MIT License.

    Contact

    For questions or improvements, feel free to open an issue on GitHub or submit a pull request. Or write me an via the Contact Page: https://edi.teppert.com/contact

    Node-Red Flow

    The flow (Download here) is available as a JSON file in the project and can be downloaded or the JSON code can be copied

     


    Here you will find the GitHub Repositroy:

    https://github.com/EdiTep/ZigBee2MQTT-Aquara-Sensor

    The Flow V 1.1 of the Project (Downlod here):

    [
        {
            "id": "d6070f5350480dbb",
            "type": "zigbee2mqtt-in",
            "z": "4e6fdb9451843a3d",
            "g": "59e1941a3b68e077",
            "name": "WC Fenster Sensor",
            "server": "1bfcccb11dd30d19",
            "friendly_name": "WCFensterSensor (MCCGQ11LM)",
            "device_id": "0x00158d008b117102",
            "state": "contact",
            "outputAtStartup": false,
            "filterChanges": true,
            "enableMultiple": false,
            "x": 144,
            "y": 100,
            "wires": [
                [
                    "2e1f096ac9e37b56",
                    "dea796bef74cd015",
                    "b968904d4861c3ab"
                ]
            ]
        },
        {
            "id": "cf468edabe628d0d",
            "type": "pushover api",
            "z": "4e6fdb9451843a3d",
            "g": "59e1941a3b68e077",
            "keys": "d24db8d2d165ad26",
            "title": "WC Fenster Meldung",
            "name": "WC Fenster Meldung",
            "x": 1074,
            "y": 280,
            "wires": []
        },
        {
            "id": "382888c4c7c1315e",
            "type": "zigbee2mqtt-in",
            "z": "4e6fdb9451843a3d",
            "g": "59e1941a3b68e077",
            "name": "WC Fenster Sensor Akku",
            "server": "1bfcccb11dd30d19",
            "friendly_name": "WCFensterSensor (MCCGQ11LM)",
            "device_id": "0x00158d008b117102",
            "state": "battery",
            "outputAtStartup": true,
            "filterChanges": false,
            "enableMultiple": false,
            "x": 164,
            "y": 340,
            "wires": [
                [
                    "8d8e2ed54aaa2a81",
                    "2abbd3a4ad5102dd"
                ]
            ]
        },
        {
            "id": "2e1f096ac9e37b56",
            "type": "function",
            "z": "4e6fdb9451843a3d",
            "g": "59e1941a3b68e077",
            "name": "Fenster Zustand auswerten",
            "func": "if (msg.payload === true || msg.payload === 'true') {\n    return [null, msg]; // Open (true) -> second output\n} else if (msg.payload === false || msg.payload === 'false') {\n    return [msg, null]; // Closed (false) -> first output\n} else {\n    return null; // Ignore other values\n}",
            "outputs": 2,
            "timeout": "",
            "noerr": 0,
            "initialize": "",
            "finalize": "",
            "libs": [],
            "x": 214,
            "y": 240,
            "wires": [
                [
                    "6ca24693b4fd377e",
                    "2ceabb5369c7d016",
                    "434f42e55bd0d9f9"
                ],
                [
                    "6ca24693b4fd377e",
                    "ec487efa4e8c2ecf",
                    "434f42e55bd0d9f9"
                ]
            ]
        },
        {
            "id": "66cdc35624062665",
            "type": "comment",
            "z": "4e6fdb9451843a3d",
            "g": "59e1941a3b68e077",
            "name": "ZigBee Fenster im WC Sensor überwachen. Wenn Fenster 3 min. oder weitere 5 min. offen eine Pushover Nachricht schicken. Wenn Akku unter 5% ebenfalls",
            "info": "",
            "x": 574,
            "y": 60,
            "wires": []
        },
        {
            "id": "8d8e2ed54aaa2a81",
            "type": "function",
            "z": "4e6fdb9451843a3d",
            "g": "59e1941a3b68e077",
            "name": "Batteriestand überwachen",
            "func": "let batteryLevel = msg.payload;\n\n// Prüfe, ob der Batteriestand definiert ist und ≤ 5%\nif (batteryLevel !== undefined && batteryLevel <= 5) {\n    msg.payload = `Warnung: Der Batteriestand des WC-Fenster Sensors ist kritisch: ${batteryLevel}%`;\n    return msg;\n} else {\n    // Keine Nachricht senden, wenn der Batteriestand über 5% liegt\n    return null;\n}",
            "outputs": 1,
            "timeout": "",
            "noerr": 0,
            "initialize": "",
            "finalize": "",
            "libs": [],
            "x": 514,
            "y": 340,
            "wires": [
                [
                    "cf468edabe628d0d"
                ]
            ]
        },
        {
            "id": "b968904d4861c3ab",
            "type": "function",
            "z": "4e6fdb9451843a3d",
            "g": "59e1941a3b68e077",
            "name": "Fenster offen / zu Timer",
            "func": "const firstInterval = 3 * 60 * 1000; // 3 Minuten in Millisekunden\nconst secondInterval = 5 * 60 * 1000; // 5 Minuten in Millisekunden\n\n// Lade den letzten Zustand aus dem Kontext (Standard: null)\nconst lastState = context.get('lastState') || null;\n\n// Timer-Objekte initialisieren\nif (!context.firstInterval) context.firstInterval = null;\nif (!context.secondInterval) context.secondInterval = null;\n\nif (msg.payload === false) { // Fenster geöffnet\n    // Nur bei einer Zustandsänderung von geschlossen nach offen ausführen\n    if (lastState !== false) {\n        // Aktualisiere den letzten Zustand\n        context.set('lastState', false);\n\n        // Wenn kein Timer aktiv ist, erstelle einen\n        if (!context.firstInterval && !context.secondInterval) {\n            // Starte den einmaligen Verzögerungstimer für die erste Meldung\n            context.firstInterval = setTimeout(() => {\n                node.send({ payload: 'WC Fenster ist offen!' }); // Erste Nachricht nach 3 Minuten senden\n\n                // Starte wiederholten Timer nach der ersten Meldung\n                context.secondInterval = setInterval(() => {\n                    node.send({ payload: 'WC Fenster ist immer noch offen!' });\n                }, secondInterval);\n            }, firstInterval);\n        }\n    }\n} else if (msg.payload === true) { // Fenster geschlossen\n    // Nur bei einer Zustandsänderung von offen nach geschlossen ausführen\n    if (lastState !== true) {\n        // Aktualisiere den letzten Zustand\n        context.set('lastState', true);\n\n        // Lösche den ersten Verzögerungstimer, falls er noch läuft\n        if (context.firstInterval) {\n            clearTimeout(context.firstInterval);\n            context.firstInterval = null;\n        }\n\n        // Lösche den wiederholten Timer\n        if (context.secondInterval) {\n            clearInterval(context.secondInterval);\n            context.secondInterval = null;\n        }\n\n        // Nachricht senden, dass das Fenster geschlossen wurde\n        node.send({ payload: 'WC Fenster wurde geschlossen' });\n    }\n}\n\nreturn null;\n",
            "outputs": 1,
            "timeout": "",
            "noerr": 0,
            "initialize": "",
            "finalize": "",
            "libs": [],
            "x": 504,
            "y": 100,
            "wires": [
                [
                    "d76908ac9eaae204",
                    "cf468edabe628d0d"
                ]
            ],
            "info": "const firstInterval = 3 * 60 * 1000; // 3 Minuten in Millisekunden\nconst secondInterval = 5 * 60 * 1000; // 5 Minuten in Millisekunden\n\n// Timer-Objekte initialisieren\nif (!context.firstInterval) {\n    context.firstInterval = null;\n}\nif (!context.secondInterval) {\n    context.secondInterval = null;\n}\n\nif (msg.payload === false) { // Fenster geöffnet\n    // Wenn kein Timer aktiv ist, erstelle einen\n    if (!context.firstInterval && !context.secondInterval) {\n        // Starte den einmaligen Verzögerungstimer für die erste Meldung\n        context.firstInterval = setTimeout(() => {\n            node.send({ payload: 'Fenster ist offen!' }); // Erste Nachricht nach 3 Minuten senden\n\n            // Starte wiederholten Timer nach der ersten Meldung\n            context.secondInterval = setInterval(() => {\n                node.send({ payload: 'Fenster ist immer noch offen!' });\n            }, secondInterval);\n        }, firstInterval);\n    }\n} else if (msg.payload === true) { // Fenster geschlossen\n    // Lösche den ersten Verzögerungstimer, falls er noch läuft\n    if (context.firstInterval) {\n        clearTimeout(context.firstInterval);\n        context.firstInterval = null;\n    }\n\n    // Lösche den wiederholten Timer\n    if (context.secondInterval) {\n        clearInterval(context.secondInterval);\n        context.secondInterval = null;\n    }\n\n    node.send({ payload: 'Fenster wurde geschlossen' }); // Nachricht für Schließen\n}\n\nreturn null;\n"
        },
        {
            "id": "d76908ac9eaae204",
            "type": "debug",
            "z": "4e6fdb9451843a3d",
            "g": "59e1941a3b68e077",
            "name": "Fenster auf / zu Meldungen",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": true,
            "complete": "payload",
            "targetType": "msg",
            "statusVal": "payload",
            "statusType": "auto",
            "x": 1054,
            "y": 100,
            "wires": []
        },
        {
            "id": "6ca24693b4fd377e",
            "type": "debug",
            "z": "4e6fdb9451843a3d",
            "g": "59e1941a3b68e077",
            "name": "Fenster Zustand",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": true,
            "complete": "payload",
            "targetType": "msg",
            "statusVal": "payload",
            "statusType": "auto",
            "x": 654,
            "y": 215,
            "wires": []
        },
        {
            "id": "80479bbf8f11d3f4",
            "type": "ui_text",
            "z": "4e6fdb9451843a3d",
            "g": "59e1941a3b68e077",
            "group": "507542867a7bb60c",
            "order": 1,
            "width": 6,
            "height": 2,
            "name": "WC Fenster Zustand",
            "label": "",
            "format": "{{msg.payload}}",
            "layout": "col-center",
            "className": "",
            "style": true,
            "font": "Arial Black,Arial Black,Gadget,sans-serif",
            "fontSize": "18",
            "color": "#000000",
            "x": 1074,
            "y": 200,
            "wires": []
        },
        {
            "id": "2abbd3a4ad5102dd",
            "type": "ui_gauge",
            "z": "4e6fdb9451843a3d",
            "g": "59e1941a3b68e077",
            "name": "",
            "group": "507542867a7bb60c",
            "order": 3,
            "width": 3,
            "height": 3,
            "gtype": "gage",
            "title": "Akku Sensor Kapazität",
            "label": "%",
            "format": "{{value}} %",
            "min": 0,
            "max": "100",
            "colors": [
                "#ab3f38",
                "#e6e600",
                "#50b232"
            ],
            "seg1": "",
            "seg2": "",
            "diff": false,
            "className": "",
            "x": 1074,
            "y": 320,
            "wires": []
        },
        {
            "id": "434f42e55bd0d9f9",
            "type": "ui_led2",
            "z": "4e6fdb9451843a3d",
            "g": "59e1941a3b68e077",
            "order": 2,
            "group": "507542867a7bb60c",
            "width": 3,
            "height": 3,
            "label": "",
            "property": "payload",
            "labelPlacement": "left",
            "labelAlignment": "left",
            "colorForValue": [
                {
                    "color": "#ff0000",
                    "value": "false",
                    "valueType": "bool"
                },
                {
                    "color": "#008000",
                    "value": "true",
                    "valueType": "bool"
                }
            ],
            "allowColorForValueInMessage": false,
            "shape": "circle",
            "showGlow": true,
            "name": "WC Fenster LED",
            "x": 1064,
            "y": 240,
            "wires": []
        },
        {
            "id": "ec487efa4e8c2ecf",
            "type": "change",
            "z": "4e6fdb9451843a3d",
            "g": "59e1941a3b68e077",
            "name": "true = GESCHLOSSEN",
            "rules": [
                {
                    "t": "set",
                    "p": "payload",
                    "pt": "msg",
                    "to": "WC Fenster geschlossen",
                    "tot": "str"
                }
            ],
            "action": "",
            "property": "",
            "from": "",
            "to": "",
            "reg": false,
            "x": 504,
            "y": 140,
            "wires": [
                [
                    "80479bbf8f11d3f4"
                ]
            ]
        },
        {
            "id": "2ceabb5369c7d016",
            "type": "change",
            "z": "4e6fdb9451843a3d",
            "g": "59e1941a3b68e077",
            "name": "false = OFFEN",
            "rules": [
                {
                    "t": "set",
                    "p": "payload",
                    "pt": "msg",
                    "to": "WC Fenster OFFEN",
                    "tot": "str"
                }
            ],
            "action": "",
            "property": "",
            "from": "",
            "to": "",
            "reg": false,
            "x": 474,
            "y": 180,
            "wires": [
                [
                    "80479bbf8f11d3f4"
                ]
            ]
        },
        {
            "id": "dea796bef74cd015",
            "type": "debug",
            "z": "4e6fdb9451843a3d",
            "g": "59e1941a3b68e077",
            "name": "true / false",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": true,
            "complete": "payload",
            "targetType": "msg",
            "statusVal": "payload",
            "statusType": "auto",
            "x": 204,
            "y": 180,
            "wires": []
        },
        {
            "id": "50d078fac87374bc",
            "type": "inject",
            "z": "4e6fdb9451843a3d",
            "g": "59e1941a3b68e077",
            "name": "Zustand auslesen",
            "props": [
                {
                    "p": "payload"
                }
            ],
            "repeat": "",
            "crontab": "",
            "once": true,
            "onceDelay": 0.1,
            "topic": "",
            "payload": "",
            "payloadType": "date",
            "x": 164,
            "y": 287,
            "wires": [
                [
                    "9dbc4a01fcccd9e5"
                ]
            ]
        },
        {
            "id": "9dbc4a01fcccd9e5",
            "type": "zigbee2mqtt-get",
            "z": "4e6fdb9451843a3d",
            "g": "59e1941a3b68e077",
            "name": "Zustand WC Fenster",
            "server": "1bfcccb11dd30d19",
            "friendly_name": "WCFensterSensor (MCCGQ11LM)",
            "device_id": "0x00158d008b117102",
            "state": "contact",
            "enableMultiple": false,
            "x": 394,
            "y": 287,
            "wires": [
                [
                    "edd7a5bdcb67cbea",
                    "2e1f096ac9e37b56"
                ]
            ]
        },
        {
            "id": "edd7a5bdcb67cbea",
            "type": "debug",
            "z": "4e6fdb9451843a3d",
            "g": "59e1941a3b68e077",
            "name": "Zustand",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": true,
            "complete": "payload",
            "targetType": "msg",
            "statusVal": "payload",
            "statusType": "auto",
            "x": 634,
            "y": 287,
            "wires": []
        },
        {
            "id": "1bfcccb11dd30d19",
            "type": "zigbee2mqtt-server",
            "name": "Sonoff ZigBee Raspi",
            "host": "Raspi",
            "mqtt_port": "1883",
            "mqtt_username": "raspi",
            "mqtt_password": "Password",
            "mqtt_qos": "2",
            "tls": "",
            "usetls": false,
            "base_topic": "zigbee2mqtt"
        },
        {
            "id": "d24db8d2d165ad26",
            "type": "pushover-keys",
            "name": "Fenster Alarm Pushover (Gruppe)"
        },
        {
            "id": "507542867a7bb60c",
            "type": "ui_group",
            "name": "WC Fenster Überwachung",
            "tab": "b1a7800aebadd728",
            "order": 3,
            "disp": true,
            "width": "6",
            "collapse": false,
            "className": ""
        },
        {
            "id": "b1a7800aebadd728",
            "type": "ui_tab",
            "name": "ZigBee Geräte Überwachung",
            "icon": "bug_report",
            "order": 6,
            "disabled": false,
            "hidden": false
        }
    ]

     

  • Node-Red Control Proxon T300, E3DC, Shelly

    Control Proxon T300 hot water storage tank PV priority switching input with ShellyPlus1 via MQTT and Node-Red

    Overview of the project

    Control of the PV priority switching input of the T300 hot water storage tank of a Proxon ventilation heating system using a ShellyPlus1 via Node-Red and MQTT. The ShellyPlus1 is controlled via Node-Red and MQTT in such a way that the priority switching is activated when an adjustable battery charge and the feed-in reaches an adjustable wattage and deactivated again when the values are undershot. A pushover message is sent on activation and deactivation so that the switching processes can be monitored even when nobody is at home.

    On the circuit board of the T300, on which the display is also soldered, there is the terminal block X13. The circuit board is on the back of the display. To access the terminal block, you must first remove the long strip on the front below the display. It is only pressed into the side of the insulation of the device with pointed claws. There are three screws behind it that need to be loosened. You can then remove the entire upper part of the device insulation upwards. The display is inserted into two grooves and must be held firmly when sliding it out to prevent damage. The priority circuit of the PV system is located on terminal block X13. The switching input of the ShellyPlus1 is connected to X13-1 and X13-2. Please remember that this is a potential-free contact. The suitable relay in this case is the ShellyPlus1. The control line can be led out of the T300 through an existing opening at the rear (this can be seen when you have removed the cover and the display) using a two-pole cable (I used a telephone cable). This cable have to bo connected with to the I/O connections of the Shelly 1 (note: only the ShellyPlus1 is potential-free!) and then evaluate all available parameters via the home automation system (battery charge status, current yield and thus switch the PV priority on or off.

    The terminal block X13 has 3.3 V at the connection itself. Following Parameters in the installer menu (code 1000) have to be adapted:

    In the Installer menu:

    Set F22 PV mode to SG (Smart Grid). This activates the digital input
    Set F23 PV Eheiz to 5V
    Set F24 PV WP to 5V
    Set F25 WP Time to 5 min (or what you want, this is the time to wait bevor X13 switches to on)
    

    In the Settings menu:

    D05 PV Priority ON
    

    After I contacted Zimmermann, they sent me a CVS file with all the Modbus information, the wiring can be seen on the circuit diagrams that were given to me at the time of acceptance. Please leave me an email via PM and I can send you the CSV file.

    Installation, requirements

    1. Raspberry Pi is required as host for the other requirement
    2. Install an MQTT Broker (i used Mosquitto)
    3. Install Node-Red with Dashboard
    4. Install RSCP to MQTT Dashboard v1.0
    5. Install node-red-node-pushover – required to send Pushover Messages
      • a pushover account should be created, if you want to use it when the trial period ends, you have to pay $5. See Infos here: https://pushover.net/pricing
    6. Configure ShellyPlus1 and integrate it into the network, so you can use it via MQTT
    7. Connect the switching input of the Shelly to X13 1 + 2

    Documentation to set the T300 Parameters

    A PDF-File with the Docu with screenshots is also available here in the project, see below

    Node-Red Flow

    The flow (Downlod here) is available as a JSON file in the project and can be downloaded or the JSON code can be copied


    Circuit diagram extract Proxon T300

    PDF-File download


    Pictures of the Proxon T300 Project


    The Flow of the Project (Downlod here):

    [
        {
            "id": "0a84b244800e8247",
            "type": "group",
            "z": "7ef373a00e10516c",
            "style": {
                "stroke": "#999999",
                "stroke-opacity": "1",
                "fill": "none",
                "fill-opacity": "1",
                "label": true,
                "label-position": "nw",
                "color": "#a4a4a4"
            },
            "nodes": [
                "05fc060bd26e4089",
                "dfc61f75940d3c66",
                "eff750731d0990d5",
                "2bdb79883b954acb",
                "02ad5aae205da174",
                "18452708c0b73fae",
                "d7f99ac2359e19a3",
                "a708c32a3446469d",
                "2fd982002462245e",
                "33f3eed00bc3718b",
                "b172759af4d97713",
                "d7c853e5c3b96baa",
                "f97416f502395c53",
                "6d02d08b05d294d1",
                "3e54535e6aae6d57",
                "ee0fd2f5b3fc0947",
                "fc1e048978525d93",
                "20a63eef0ba4f3c6",
                "bb87556ffb1b8363",
                "030e6d5e64bf2215",
                "e63c3dba1cd08de8",
                "e4163a6c1a155bb4",
                "573dde1f82267408",
                "2c75e1915891a96e",
                "b2bd78e514f07082",
                "b5015436dff96404",
                "4f72183c2032b57f",
                "1a8d08504ced80b0",
                "6f42c5bc3d35bcde",
                "d1a3ea2ff70442c4",
                "0e94415422a04522",
                "02fd191bf7410fb6",
                "3eecca5ce515b52c",
                "9e8ec577ac9bd8c8",
                "af696281252ae973",
                "20dc12569de7555f",
                "18f60484b67ec067",
                "22137cec5a557070",
                "a40133bad02c1719",
                "fc4917821ea2fc51",
                "a45718bdbbd4e11d",
                "9f2ced77c1845ad8",
                "b2ab691f890f8bd0"
            ],
            "x": 14,
            "y": 19,
            "w": 1092,
            "h": 650
        },
        {
            "id": "05fc060bd26e4089",
            "type": "mqtt in",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "",
            "topic": "Haus/Keller/Shelly/PVBoiler/command/switch:0",
            "qos": "1",
            "datatype": "auto-detect",
            "broker": "88539582a8a310de",
            "nl": false,
            "rap": false,
            "inputs": 0,
            "x": 220,
            "y": 100,
            "wires": [
                [
                    "9f2ced77c1845ad8"
                ]
            ]
        },
        {
            "id": "dfc61f75940d3c66",
            "type": "mqtt out",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "",
            "topic": "Haus/Keller/Shelly/PVBoiler/command/switch:0",
            "qos": "",
            "retain": "",
            "respTopic": "",
            "contentType": "",
            "userProps": "",
            "correl": "",
            "expiry": "",
            "broker": "88539582a8a310de",
            "x": 880,
            "y": 100,
            "wires": []
        },
        {
            "id": "eff750731d0990d5",
            "type": "comment",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "E3DC Hauskraftwerk - Akku Ladung % + PV Watt auswerten => ShellyPlus1 => Boiler BOOST de- / aktivieren einstellbarem Grenzwert XX % + XXXX Watt",
            "info": "",
            "x": 550,
            "y": 60,
            "wires": []
        },
        {
            "id": "2bdb79883b954acb",
            "type": "ui_gauge",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "E3DC Akku Ladezustand in %",
            "group": "3b18bed1450c9878",
            "order": 2,
            "width": 6,
            "height": 5,
            "gtype": "gage",
            "title": "E3DC Akku Ladezustand in %",
            "label": "%",
            "format": "{{value | number:0}}",
            "min": 0,
            "max": "100",
            "colors": [
                "#ff9200",
                "#e6e600",
                "#00f900"
            ],
            "seg1": "69",
            "seg2": "71",
            "diff": false,
            "className": "",
            "x": 510,
            "y": 160,
            "wires": []
        },
        {
            "id": "02ad5aae205da174",
            "type": "function",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Akku% + Solar Watt Vergleich Grenzwerte",
            "func": "// Prüfe, ob der Schwellenwert für Akku oder Solar aktualisiert wird\nif (msg.topic === \"threshold\") {\n    context.set(\"threshold_akku\", msg.payload);\n} else if (msg.topic === \"thresholdsolar\") {\n    context.set(\"threshold_solar\", msg.payload);\n}\n\n// Lade die gespeicherten Schwellwerte aus dem Context\nlet threshold_akku = context.get(\"threshold_akku\");\nlet threshold_solar = context.get(\"threshold_solar\");\n\n// Wenn die Schwellenwerte noch nicht gesetzt sind, nicht weitermachen\nif (threshold_akku === undefined || threshold_solar === undefined) {\n    node.warn(\"Schwellwerte nicht gesetzt. Warte auf Threshold.\");\n    return null;\n}\n\n// Prüfe, ob die Nachricht vom Akku oder der Solareinspeisung stammt\nif (msg.topic === \"Haus/Keller/e3dc/battery/soc\") {\n    context.set(\"battery_soc\", msg.payload);\n}\nif (msg.topic === \"Haus/Keller/e3dc/solar/power\") {\n    context.set(\"solar_power\", msg.payload);\n}\n\n// Lade die aktuellen Werte für Akku und Solar aus dem Context\nlet battery_soc = context.get(\"battery_soc\");\nlet solar_power = context.get(\"solar_power\");\n\n// Wenn keine gültigen Werte für Akku oder Solar vorhanden sind, nicht weitermachen\nif (battery_soc === undefined || solar_power === undefined) {\n    node.warn(\"Werte für Akku oder Einspeisung nicht vorhanden. Warte auf Eingabewerte.\");\n    return null;\n}\n\n// Debug-Ausgabe für Akku, Solar und Threshold-Werte\nnode.warn(\"Akkustand: \" + battery_soc + \"%, Einspeisung: \" + solar_power + \" Watt, Grenzwert Akku: \" + threshold_akku + \" %, Grenzwert Einspeisung: \" + threshold_solar + \" Watt\");\n\n// Prüfe, ob beide Werte die Schwellenwerte erfüllen\nif (battery_soc >= threshold_akku && solar_power >= threshold_solar) {\n    node.warn(\"Bedingungen erfüllt: Shelly wird eingeschaltet.\");\n    return {\n        topic: \"Haus/Keller/Shelly/PVBoiler/command/switch:0\",\n        payload: \"on\",\n        led: \"on\"  // LED Payload\n    };\n} else {\n    node.warn(\"Bedingungen NICHT erfüllt: Shelly wird ausgeschaltet.\");\n    return {\n        topic: \"Haus/Keller/Shelly/PVBoiler/command/switch:0\",\n        payload: \"off\",\n        led: \"off\"  // LED Payload\n    };\n}\n",
            "outputs": 1,
            "timeout": "",
            "noerr": 0,
            "initialize": "",
            "finalize": "",
            "libs": [],
            "x": 540,
            "y": 280,
            "wires": [
                [
                    "d7f99ac2359e19a3",
                    "18452708c0b73fae",
                    "2c75e1915891a96e",
                    "0e94415422a04522",
                    "a40133bad02c1719"
                ]
            ]
        },
        {
            "id": "18452708c0b73fae",
            "type": "mqtt out",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "ShellyPlus1 PV Vorrang Boiler BOOST",
            "topic": "Haus/Keller/Shelly/PVBoiler/command/switch:0",
            "qos": "2",
            "retain": "true",
            "respTopic": "",
            "contentType": "",
            "userProps": "",
            "correl": "",
            "expiry": "",
            "broker": "88539582a8a310de",
            "x": 930,
            "y": 140,
            "wires": []
        },
        {
            "id": "d7f99ac2359e19a3",
            "type": "debug",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "on / off von Function",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": true,
            "complete": "true",
            "targetType": "full",
            "statusVal": "payload",
            "statusType": "auto",
            "x": 960,
            "y": 180,
            "wires": []
        },
        {
            "id": "a708c32a3446469d",
            "type": "inject",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Schwelle Akku",
            "props": [
                {
                    "p": "payload"
                }
            ],
            "repeat": "",
            "crontab": "",
            "once": false,
            "onceDelay": 0.1,
            "topic": "",
            "payload": "8",
            "payloadType": "num",
            "x": 140,
            "y": 480,
            "wires": [
                [
                    "2fd982002462245e"
                ]
            ]
        },
        {
            "id": "2fd982002462245e",
            "type": "ui_slider",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Grenzwert Akku einstellen",
            "label": "Grenzwert %",
            "tooltip": "",
            "group": "3b18bed1450c9878",
            "order": 5,
            "width": 6,
            "height": 3,
            "passthru": true,
            "outs": "end",
            "topic": "threshold",
            "topicType": "str",
            "min": "20",
            "max": 100,
            "step": "2",
            "className": "",
            "x": 370,
            "y": 480,
            "wires": [
                [
                    "33f3eed00bc3718b",
                    "02ad5aae205da174",
                    "02fd191bf7410fb6"
                ]
            ]
        },
        {
            "id": "33f3eed00bc3718b",
            "type": "ui_text",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "group": "3b18bed1450c9878",
            "order": 7,
            "width": 5,
            "height": 2,
            "name": "",
            "label": "BOOST beenden unter (Akku)",
            "format": "{{msg.payload}} %",
            "layout": "col-center",
            "className": "",
            "style": true,
            "font": "Arial Black,Arial Black,Gadget,sans-serif",
            "fontSize": "18",
            "color": "#ff9200",
            "x": 950,
            "y": 480,
            "wires": []
        },
        {
            "id": "b172759af4d97713",
            "type": "mqtt in",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "",
            "topic": "Haus/Keller/e3dc/battery/power",
            "qos": "2",
            "datatype": "auto-detect",
            "broker": "88539582a8a310de",
            "nl": false,
            "rap": true,
            "rh": 0,
            "inputs": 0,
            "x": 170,
            "y": 568,
            "wires": [
                [
                    "3e54535e6aae6d57"
                ]
            ]
        },
        {
            "id": "d7c853e5c3b96baa",
            "type": "ui_gauge",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Batterie Be- Entladung in Watt",
            "group": "3b18bed1450c9878",
            "order": 4,
            "width": 6,
            "height": 5,
            "gtype": "gage",
            "title": "Batterie Be- Entladung in Watt",
            "label": "Watt",
            "format": "{{value | number:0}}",
            "min": "-500",
            "max": "1000",
            "colors": [
                "#ff2600",
                "#e6e600",
                "#60c453"
            ],
            "seg1": "0",
            "seg2": "400",
            "diff": false,
            "className": "",
            "x": 950,
            "y": 568,
            "wires": []
        },
        {
            "id": "f97416f502395c53",
            "type": "mqtt in",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "",
            "topic": "Haus/Keller/e3dc/home/power",
            "qos": "2",
            "datatype": "auto-detect",
            "broker": "88539582a8a310de",
            "nl": false,
            "rap": true,
            "rh": 0,
            "inputs": 0,
            "x": 170,
            "y": 628,
            "wires": [
                [
                    "573dde1f82267408"
                ]
            ]
        },
        {
            "id": "6d02d08b05d294d1",
            "type": "ui_gauge",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Hausverbrauch aktuell in Watt",
            "group": "3b18bed1450c9878",
            "order": 1,
            "width": 6,
            "height": 5,
            "gtype": "gage",
            "title": "Hausverbrauch aktuell in Watt",
            "label": "Watt",
            "format": "{{value | number:0}}",
            "min": "0",
            "max": "4500",
            "colors": [
                "#00b500",
                "#e6e600",
                "#ca3838"
            ],
            "seg1": "500",
            "seg2": "1500",
            "diff": false,
            "className": "",
            "x": 950,
            "y": 628,
            "wires": []
        },
        {
            "id": "3e54535e6aae6d57",
            "type": "function",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Dynamische Werte für Gauge",
            "func": "const value = msg.payload;\n\n// Rundung auf ganze Zahlen\nconst roundedValue = Math.round(value);\n\nconst absValue = Math.abs(roundedValue);\n\n// Berechnung des maxWert, 120% vom absoluten Wert, immer im positiven Bereich\nlet maxWert = Math.round(absValue * 1.2 + 200);\n\n// Berechnung des minWert, abhängig davon, ob value positiv oder negativ ist\nlet minWert = roundedValue < 0 ? Math.round(-absValue * 1.5) : Math.round(-absValue * 0.5);\n\nlet minSeg = Math.round(absValue * 0.4);  // 40% vom absoluten Wert\nlet maxSeg = Math.round(absValue * 0.8);  // 80% vom absoluten Wert\n\n// Debug-Ausgabe zur Überprüfung\n// node.warn(\"Akku Ladung - Max Wert: \" + maxWert + \", Min Wert: \" + minWert + \", Min Seg: \" + minSeg + \", Max Seg: \" + maxSeg);\n\nmsg = {\n    ui_control: {\n        gtype: \"gage\",\n        min: minWert,\n        max: maxWert,\n        colors: [\"red\", \"orange\", \"green\"],\n        seg1: minSeg,\n        seg2: maxSeg\n    },\n    // Sende die gerundeten Werte an das ui_gauge\n    payload: roundedValue\n};\n\nreturn msg;\n",
            "outputs": 1,
            "timeout": "",
            "noerr": 0,
            "initialize": "",
            "finalize": "",
            "libs": [],
            "x": 520,
            "y": 568,
            "wires": [
                [
                    "d7c853e5c3b96baa"
                ]
            ]
        },
        {
            "id": "ee0fd2f5b3fc0947",
            "type": "mqtt in",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Einspeisung Wert",
            "topic": "Haus/Keller/e3dc/solar/power",
            "qos": "2",
            "datatype": "auto-detect",
            "broker": "88539582a8a310de",
            "nl": false,
            "rap": true,
            "rh": 0,
            "inputs": 0,
            "x": 120,
            "y": 220,
            "wires": [
                [
                    "b2bd78e514f07082",
                    "6f42c5bc3d35bcde",
                    "02ad5aae205da174"
                ]
            ]
        },
        {
            "id": "fc1e048978525d93",
            "type": "ui_gauge",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Einspeisung Watt",
            "group": "3b18bed1450c9878",
            "order": 3,
            "width": 6,
            "height": 5,
            "gtype": "gage",
            "title": "E3DC Solar Strom Einspeisung in Watt",
            "label": "Watt",
            "format": "{{value | number:0}}",
            "min": 0,
            "max": "100",
            "colors": [
                "#ff9200",
                "#e6e600",
                "#00f900"
            ],
            "seg1": "69",
            "seg2": "71",
            "diff": false,
            "className": "",
            "x": 630,
            "y": 240,
            "wires": []
        },
        {
            "id": "20a63eef0ba4f3c6",
            "type": "ui_led",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "order": 10,
            "group": "3b18bed1450c9878",
            "width": 6,
            "height": 3,
            "label": "ShellyPlus1 AN / AUS",
            "labelPlacement": "left",
            "labelAlignment": "center",
            "colorForValue": [
                {
                    "color": "#ff0000",
                    "value": "false",
                    "valueType": "bool"
                },
                {
                    "color": "#00f900",
                    "value": "true",
                    "valueType": "bool"
                }
            ],
            "allowColorForValueInMessage": true,
            "shape": "circle",
            "showGlow": true,
            "name": "ShellyPlus1 AN / AUS",
            "x": 960,
            "y": 280,
            "wires": []
        },
        {
            "id": "bb87556ffb1b8363",
            "type": "mqtt in",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Akku Ladung",
            "topic": "Haus/Keller/e3dc/battery/soc",
            "qos": "2",
            "datatype": "auto-detect",
            "broker": "88539582a8a310de",
            "nl": false,
            "rap": true,
            "rh": 0,
            "inputs": 0,
            "x": 110,
            "y": 160,
            "wires": [
                [
                    "2bdb79883b954acb",
                    "02ad5aae205da174",
                    "1a8d08504ced80b0"
                ]
            ]
        },
        {
            "id": "030e6d5e64bf2215",
            "type": "inject",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Schwelle Solar",
            "props": [
                {
                    "p": "payload"
                }
            ],
            "repeat": "",
            "crontab": "",
            "once": false,
            "onceDelay": 0.1,
            "topic": "",
            "payload": "500",
            "payloadType": "num",
            "x": 140,
            "y": 519,
            "wires": [
                [
                    "e63c3dba1cd08de8"
                ]
            ]
        },
        {
            "id": "e63c3dba1cd08de8",
            "type": "ui_slider",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Solar Grenzwert Watt einstellen",
            "label": "Grenzwert Watt",
            "tooltip": "",
            "group": "3b18bed1450c9878",
            "order": 6,
            "width": 6,
            "height": 3,
            "passthru": true,
            "outs": "end",
            "topic": "thresholdsolar",
            "topicType": "str",
            "min": "150",
            "max": "3000",
            "step": "25",
            "className": "",
            "x": 430,
            "y": 520,
            "wires": [
                [
                    "e4163a6c1a155bb4",
                    "02ad5aae205da174",
                    "3eecca5ce515b52c"
                ]
            ]
        },
        {
            "id": "e4163a6c1a155bb4",
            "type": "ui_text",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "group": "3b18bed1450c9878",
            "order": 9,
            "width": 5,
            "height": 2,
            "name": "",
            "label": "BOOST beenden unter (Solar)",
            "format": "{{msg.payload}} Watt",
            "layout": "col-center",
            "className": "",
            "style": true,
            "font": "Arial Black,Arial Black,Gadget,sans-serif",
            "fontSize": "18",
            "color": "#ff9200",
            "x": 950,
            "y": 519,
            "wires": []
        },
        {
            "id": "573dde1f82267408",
            "type": "function",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Dynamische Werte für Gauge",
            "func": "const value = msg.payload;\n\n// Rundung auf ganze Zahlen\nconst roundedValue = Math.round(value);\n\nconst absValue = Math.abs(roundedValue);\n\n// Berechnung des maxWert, 120% vom absoluten Wert, immer im positiven Bereich\nlet maxWert = Math.round(absValue * 1.2 + 200);\n\n// Berechnung des minWert, abhängig davon, ob value positiv oder negativ ist\nlet minWert = roundedValue < 0 ? Math.round(-absValue * 1.5) : Math.round(-absValue * 0.5);\n\nlet minSeg = Math.round(absValue * 0.4);  // 40% vom absoluten Wert\nlet maxSeg = Math.round(absValue * 0.8);  // 80% vom absoluten Wert\n\n// Debug-Ausgabe zur Überprüfung\n// node.warn(\"Haus Verbrauch - Max Wert: \" + maxWert + \", Min Wert: \" + minWert + \", Min Seg: \" + minSeg + \", Max Seg: \" + maxSeg);\n\nmsg = {\n    ui_control: {\n        gtype: \"gage\",\n        min: minWert,\n        max: maxWert,\n        colors: [\"red\", \"orange\", \"green\"],\n        seg1: minSeg,\n        seg2: maxSeg\n    },\n    // Sende die gerundeten Werte an das ui_gauge\n    payload: roundedValue\n};\n\nreturn msg;\n",
            "outputs": 1,
            "timeout": "",
            "noerr": 0,
            "initialize": "",
            "finalize": "",
            "libs": [],
            "x": 520,
            "y": 628,
            "wires": [
                [
                    "6d02d08b05d294d1"
                ]
            ]
        },
        {
            "id": "2c75e1915891a96e",
            "type": "function",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "LED Farbe steuern",
            "func": "var led = msg.payload;\nif (led == \"on\") {\n    msg.payload = true;\n} else if (led == \"off\") {\n    msg.payload = false;\n}\nreturn msg;",
            "outputs": 1,
            "timeout": 0,
            "noerr": 0,
            "initialize": "",
            "finalize": "",
            "libs": [],
            "x": 910,
            "y": 240,
            "wires": [
                [
                    "20a63eef0ba4f3c6"
                ]
            ]
        },
        {
            "id": "b2bd78e514f07082",
            "type": "function",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Dynamische Werte",
            "func": "const value = msg.payload;\n\n// Rundung auf ganze Zahlen\nconst roundedValue = Math.round(value);\n\nconst absValue = Math.abs(roundedValue);\n\n// Berechnung des maxWert, 120% vom absoluten Wert, immer im positiven Bereich\nlet maxWert = Math.round(absValue * 1.2 + 200);\n\n// Berechnung des minWert, abhängig davon, ob value positiv oder negativ ist\nlet minWert = roundedValue < 0 ? Math.round(-absValue * 1.5) : Math.round(-absValue * 0.5);\n\nlet minSeg = Math.round(absValue * 0.4);  // 40% vom absoluten Wert\nlet maxSeg = Math.round(absValue * 0.8);  // 80% vom absoluten Wert\n\n// Debug-Ausgabe zur Überprüfung\n// node.warn(\"Einspeisung - Max Wert: \" + maxWert + \", Min Wert: \" + minWert + \", Min Seg: \" + minSeg + \", Max Seg: \" + maxSeg);\n\nmsg = {\n    ui_control: {\n        gtype: \"gage\",\n        min: minWert,\n        max: maxWert,\n        colors: [\"red\", \"orange\", \"green\"],\n        seg1: minSeg,\n        seg2: maxSeg\n    },\n    // Sende die gerundeten Werte an das ui_gauge\n    payload: roundedValue\n};\n\nreturn msg;\n",
            "outputs": 1,
            "timeout": "",
            "noerr": 0,
            "initialize": "",
            "finalize": "",
            "libs": [],
            "x": 430,
            "y": 240,
            "wires": [
                [
                    "fc1e048978525d93"
                ]
            ]
        },
        {
            "id": "b5015436dff96404",
            "type": "ui_text",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "group": "3b18bed1450c9878",
            "order": 8,
            "width": 2,
            "height": 2,
            "name": "",
            "label": "&&",
            "format": "",
            "layout": "col-center",
            "className": "",
            "style": true,
            "font": "Arial Black,Arial Black,Gadget,sans-serif",
            "fontSize": "24",
            "color": "#ff9200",
            "x": 730,
            "y": 596,
            "wires": []
        },
        {
            "id": "4f72183c2032b57f",
            "type": "pushover",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "PV BOOST an",
            "device": "HandyX",
            "title": "PV Boiler Aktivierung",
            "priority": 0,
            "sound": "climb",
            "url": "",
            "url_title": "",
            "html": false,
            "x": 1000,
            "y": 340,
            "wires": []
        },
        {
            "id": "1a8d08504ced80b0",
            "type": "debug",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "%",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": true,
            "complete": "true",
            "targetType": "full",
            "statusVal": "topic:payload",
            "statusType": "auto",
            "x": 550,
            "y": 200,
            "wires": []
        },
        {
            "id": "6f42c5bc3d35bcde",
            "type": "debug",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "W",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": true,
            "complete": "true",
            "targetType": "full",
            "statusVal": "topic:payload",
            "statusType": "auto",
            "x": 350,
            "y": 200,
            "wires": []
        },
        {
            "id": "d1a3ea2ff70442c4",
            "type": "change",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Text bauen",
            "rules": [
                {
                    "t": "set",
                    "p": "payload",
                    "pt": "msg",
                    "to": "BOOST wurde aktiviert",
                    "tot": "str"
                }
            ],
            "action": "",
            "property": "",
            "from": "",
            "to": "",
            "reg": false,
            "x": 810,
            "y": 340,
            "wires": [
                [
                    "4f72183c2032b57f"
                ]
            ]
        },
        {
            "id": "0e94415422a04522",
            "type": "function",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Prüfe Zustand ON",
            "func": "// Hole den letzten bekannten Zustand\nlet lastState = context.get('lastState') || 'off';\n\n// Aktueller Zustand\nlet currentState = msg.payload;\n\n// Wenn der letzte Zustand 'off' war und der neue Zustand 'on' ist, Nachricht senden\nif (lastState === 'off' && currentState === 'on') {\n    // Zustand aktualisieren\n    context.set('lastState', 'on');\n    return [msg, null]; // Nachricht weiterleiten\n} else {\n    // Zustand aktualisieren (bei 'off' oder wiederholtem 'on')\n    context.set('lastState', currentState);\n    return [null, null]; // Keine Nachricht senden\n}\n",
            "outputs": 1,
            "timeout": "",
            "noerr": 0,
            "initialize": "",
            "finalize": "",
            "libs": [],
            "x": 470,
            "y": 320,
            "wires": [
                [
                    "d1a3ea2ff70442c4",
                    "9e8ec577ac9bd8c8"
                ]
            ],
            "info": "// Hole den letzten bekannten Zustand\nlet lastState = context.get('lastState') || 'off';\n\n// Aktueller Zustand\nlet currentState = msg.payload;\n\n// Debug-Ausgabe für Akku, Solar und Threshold-Werte\nnode.warn(\"Letzter Zustand: \" + lastState + \", Aktueller Zustand: \" + currentState);\n\n// Wenn der letzte Zustand 'off' war und der neue Zustand 'on' ist, Nachricht senden\nif (lastState === 'off' && currentState === 'on') {\n    // Zustand aktualisieren\n    context.set('lastState', 'on');\n    return msg; // Nachricht weiterleiten\n} else {\n    // Zustand aktualisieren (bei 'off' oder wiederholtem 'on')\n    context.set('lastState', currentState);\n    return null; // Keine Nachricht senden\n}"
        },
        {
            "id": "02fd191bf7410fb6",
            "type": "debug",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Grenze Akku",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": true,
            "complete": "true",
            "targetType": "full",
            "statusVal": "payload",
            "statusType": "auto",
            "x": 450,
            "y": 420,
            "wires": []
        },
        {
            "id": "3eecca5ce515b52c",
            "type": "debug",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Grenze Einspeisung",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": true,
            "complete": "true",
            "targetType": "full",
            "statusVal": "payload",
            "statusType": "auto",
            "x": 680,
            "y": 420,
            "wires": []
        },
        {
            "id": "9e8ec577ac9bd8c8",
            "type": "debug",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Zustand",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": true,
            "complete": "true",
            "targetType": "full",
            "statusVal": "payload",
            "statusType": "auto",
            "x": 640,
            "y": 320,
            "wires": []
        },
        {
            "id": "af696281252ae973",
            "type": "inject",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Verbinden",
            "props": [
                {
                    "p": "action",
                    "v": "connect",
                    "vt": "str"
                }
            ],
            "repeat": "",
            "crontab": "",
            "once": true,
            "onceDelay": "2",
            "topic": "",
            "x": 130,
            "y": 280,
            "wires": [
                [
                    "20dc12569de7555f"
                ]
            ]
        },
        {
            "id": "20dc12569de7555f",
            "type": "mqtt in",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Alle E3DC Topics",
            "topic": "",
            "qos": "0",
            "datatype": "utf8",
            "broker": "88539582a8a310de",
            "nl": false,
            "rap": true,
            "rh": 0,
            "inputs": 1,
            "x": 160,
            "y": 380,
            "wires": [
                [
                    "22137cec5a557070"
                ]
            ]
        },
        {
            "id": "18f60484b67ec067",
            "type": "inject",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "MQTT Subscribe",
            "props": [
                {
                    "p": "action",
                    "v": "subscribe",
                    "vt": "str"
                },
                {
                    "p": "topic",
                    "vt": "str"
                }
            ],
            "repeat": "",
            "crontab": "",
            "once": true,
            "onceDelay": "3",
            "topic": "Haus/Keller/e3dc/#",
            "x": 150,
            "y": 320,
            "wires": [
                [
                    "20dc12569de7555f"
                ]
            ]
        },
        {
            "id": "22137cec5a557070",
            "type": "debug",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "E3DC Topics",
            "active": false,
            "tosidebar": true,
            "console": false,
            "tostatus": false,
            "complete": "payload",
            "targetType": "msg",
            "statusVal": "",
            "statusType": "auto",
            "x": 250,
            "y": 420,
            "wires": []
        },
        {
            "id": "a40133bad02c1719",
            "type": "function",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Prüfe Zustand OFF",
            "func": "// Hole den letzten bekannten Zustand\nlet lastState = context.get('lastState') || 'on';\n\n// Aktueller Zustand\nlet currentState = msg.payload;\n\n// Debug-Ausgabe für Akku, Solar und Threshold-Werte\nnode.warn(\"Letzter Zustand: \" + lastState + \", Aktueller Zustand: \" + currentState);\n\n// Wenn der letzte Zustand 'on' war und der neue Zustand 'off' ist, Nachricht senden\nif (lastState === 'on' && currentState === 'off') {\n    // Zustand aktualisieren\n    context.set('lastState', 'off');\n    return msg; // Nachricht weiterleiten\n} else {\n    // Zustand aktualisieren (bei 'on' oder wiederholtem 'off')\n    context.set('lastState', currentState);\n    return null; // Keine Nachricht senden\n}",
            "outputs": 1,
            "timeout": "",
            "noerr": 0,
            "initialize": "",
            "finalize": "",
            "libs": [],
            "x": 470,
            "y": 360,
            "wires": [
                [
                    "fc4917821ea2fc51",
                    "a45718bdbbd4e11d"
                ]
            ],
            "info": "// Hole den letzten bekannten Zustand\nlet lastState = context.get('lastState') || 'on';\n\n// Aktueller Zustand\nlet currentState = msg.payload;\n\n// Debug-Ausgabe für Akku, Solar und Threshold-Werte\nnode.warn(\"Letzter Zustand: \" + lastState + \", Aktueller Zustand: \" + currentState);\n\n// Wenn der letzte Zustand 'on' war und der neue Zustand 'off' ist, Nachricht senden\nif (lastState === 'on' && currentState === 'off') {\n    // Zustand aktualisieren\n    context.set('lastState', 'off');\n    return msg; // Nachricht weiterleiten\n} else {\n    // Zustand aktualisieren (bei 'on' oder wiederholtem 'off')\n    context.set('lastState', currentState);\n    return null; // Keine Nachricht senden\n}\n"
        },
        {
            "id": "fc4917821ea2fc51",
            "type": "change",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Text bauen",
            "rules": [
                {
                    "t": "set",
                    "p": "payload",
                    "pt": "msg",
                    "to": "Bolier heizen wurde deaktiviert",
                    "tot": "str"
                }
            ],
            "action": "",
            "property": "",
            "from": "",
            "to": "",
            "reg": false,
            "x": 810,
            "y": 380,
            "wires": [
                [
                    "b2ab691f890f8bd0"
                ]
            ]
        },
        {
            "id": "a45718bdbbd4e11d",
            "type": "debug",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Zustand",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": true,
            "complete": "true",
            "targetType": "full",
            "statusVal": "payload",
            "statusType": "auto",
            "x": 640,
            "y": 360,
            "wires": []
        },
        {
            "id": "9f2ced77c1845ad8",
            "type": "ui_switch",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "Shelly AN / AUS",
            "label": "Shelly AN / AUS (manuell)",
            "tooltip": "",
            "group": "3b18bed1450c9878",
            "order": 11,
            "width": 12,
            "height": 3,
            "passthru": false,
            "decouple": "true",
            "topic": "",
            "topicType": "str",
            "style": "",
            "onvalue": "on",
            "onvalueType": "str",
            "onicon": "fa-power-off fa-2x",
            "oncolor": "green",
            "offvalue": "off",
            "offvalueType": "str",
            "officon": "fa-power-off fa-2x",
            "offcolor": "red",
            "animate": true,
            "className": "",
            "x": 540,
            "y": 100,
            "wires": [
                [
                    "dfc61f75940d3c66",
                    "2c75e1915891a96e"
                ]
            ]
        },
        {
            "id": "b2ab691f890f8bd0",
            "type": "pushover",
            "z": "7ef373a00e10516c",
            "g": "0a84b244800e8247",
            "name": "PV BOOST aus",
            "device": "HandyX",
            "title": "PV Boiler Aktivierung",
            "priority": 0,
            "sound": "falling",
            "url": "",
            "url_title": "",
            "html": false,
            "x": 1000,
            "y": 380,
            "wires": []
        },
        {
            "id": "88539582a8a310de",
            "type": "mqtt-broker",
            "name": "Raspi Mosquitto",
            "broker": "raspberrypi",
            "port": "1883",
            "clientid": "",
            "autoConnect": true,
            "usetls": false,
            "protocolVersion": "4",
            "keepalive": "60",
            "cleansession": true,
            "autoUnsubscribe": true,
            "birthTopic": "",
            "birthQos": "0",
            "birthRetain": "false",
            "birthPayload": "",
            "birthMsg": {},
            "closeTopic": "",
            "closeQos": "0",
            "closeRetain": "false",
            "closePayload": "",
            "closeMsg": {},
            "willTopic": "",
            "willQos": "0",
            "willRetain": "false",
            "willPayload": "",
            "willMsg": {},
            "userProps": "",
            "sessionExpiry": ""
        },
        {
            "id": "3b18bed1450c9878",
            "type": "ui_group",
            "name": "Warmwasser Boiler BOOST Steuerung",
            "tab": "af215acfc79f52e9",
            "order": 1,
            "disp": true,
            "width": "18",
            "collapse": false,
            "className": ""
        },
        {
            "id": "af215acfc79f52e9",
            "type": "ui_tab",
            "name": "ShellyPlus Boiler BOOST Steuerung",
            "icon": "wi-wu-hazy",
            "order": 2,
            "disabled": false,
            "hidden": false
        }
    ]
  • Node-Red – Flows, Nodes, Infos

    Hier findet ihr Infos zum Thema Node-Red, Mosqitto, MQTT und was so zu dem Thema gehört.

    Ich werde auch anonymisierte Flows und Nodes hier zur Verfügung stellen, die bei mir auf meinen Systemen laufen. Wäre schön wenn Feedback kommt mit Verbesserungsvorschlägen. Wenn jemand die Sachen gebrauchen kann, dann einfach übernehmen.

    Gruß

    Edi

  • Heim Automation – IoT mit Raspi, Node-Red, MQTT, iOBroker uvm.

    Seit dem Einzug ins eigene Heim hat sich bei dem Thema Heim Automation bei mir vieles entwickelt, liegt wohl auch daran, dass ich beruflich in der IT arbeite und es unglaublich viel Spaß macht wenn man beim Programmieren oder Elektronik basteln, löten, messen ein Ergebnis sieht, das auch etwas bewegt oder steuert und nicht nur einfach ein Programm abläuft.

    # Programm zur Raspberry Pi GPIO Steuerung mit Python 
    
    import RPi.GPIO as GPIO
    import time
    import sys
    
    # GPIO PIN Nummer
    SwitchNummer = 27
    
    GPIO.setmode(GPIO.BCM)
    GPIO.setup(SwitchNummer, GPIO.IN, pull_up_down=GPIO.PUD_UP)
    
    def read_gpio(pin):
    stable_value = GPIO.input(pin)
    start_time = time.time()
    while time.time() - start_time < 0.05: # 50ms debounce time
    if GPIO.input(pin) != stable_value:
    start_time = time.time()
    stable_value = GPIO.input(pin)
    return stable_value
    
    # Variable zum Verfolgen des anfaenglichen Schalterzustands
    schalter_zustand = GPIO.input(SwitchNummer)
    
    print('GPIO PIN 27 Zustand anzeigen')
    schalter_zustand = GPIO.input(SwitchNummer)
    
    if schalter_zustand == 0:
    print("Schalter geöffnet")
    sys.exit(0) # GPIO is HIGH
    else:
    print("Schalter GESCHLOSSEN")
    sys.exit(1) # GPIO is LOW
    
    # (c) ETe 2024-10
    

    Angefangen hat es mit dem Raspiberry Pi, den ich zur Überwachung und Steuerung meines Garagentors genutzt habe. Zu Beginn hab ich Python Scripte geschrieben, die nach eingehendem Funktionstest als Dienst auf dem Raspi laufen und ihre Aufgabe erfüllen. Da die Benachrichtigung per SMS vom Raspi aus schwierig und  vermutlich auch kostenpflichtig gewesen wäre, habe ich  andere Lösungen gesucht und auch gefunden. Pushover ist ein Dienst, der bis zu einem Aufkommen von 10000 Nachrichten / Monat kostenlos ist. In Python hab ich das für mich programmiert, es ist auch gut möglich in Node-Red oder im iOBroker. Alle anderen HA Plattformen unterstützen es bestimmt auch.

    Inzwischen habe ich so einiges an IoT Geräten im Einsatz, die unter anderem zum Steuern von Steckdosen oder dem Warmwasserspeicher zum Einsatz kommen. Mit den ermittelten Werten aus der PV Anlage mit Akku kann so der erzeugte Strom effizient genutzt werden in dem Zeiten wo überschüssige Energie vorhanden ist.

    Zum Einsatz kommt dazu unter Anderem sehr intensiv Node-Red. Grundlage vieler Algorithmen ist der MQTT-Broker Mosquito, der wie auch Node-Red auf dem Raspi laufen. iOBroker ist auch im Einsatz, für den gibt es unzählige Adapter, die so ziemlich alles steuern können. Ich habe ihn im Einsatz um mit der Visualisierung iQontrol meine Rollläden zu steuern.

    Ein Gebiet für das es jeden Tag neue Ideen und Herausforderungen gibt. Es wird nie langweilig (zumindest mir nicht). Mit jedem Projekt wächst man mehr in die verschiedenen Programme hinein und kann besser damit umgehen. Beim Programmieren bleibt auch der Geist aktiv und wach, das ist für die Gesundheit hilfreich, sofern man es nicht übertreibt und andere Dinge auf der Strecke bleiben.

    Mal sehen was ich hier so alles zusammentragen werde.

    Gruß

    Edi

  • Kletter Urlaub Brüggler Schweiz September 2024

    Kletter Urlaub am Brüggler im September 2024

    Die vermutlich letzte Chance dieses Jahr eine mehrtägige Kletter Tour gemeinsam zu verbringen haben wir erfreulicherweise auf Anhieb mit dem ersten Terminvorschlag planen können. Wir hatten zwei Tage an denen ideales Wetter herrschte, lediglich kalt war es aber trocken ohne Niederschläge und wolkenlos.

    Das Auto meines Kollegen war gerade so groß genug um das umfangreiche Equipment für vier Personen mit der ganzen Ausrüstung fürs Klettern und schlafen auf dem Campingplatz unterhalb vom Brüggler unterzubringen. Ein vier Mann Zelt haben wir mitgenommen aber nicht verwendet, da wir im Aufenthaltsraum der Hütte schlafen konnten. Das hat (unnötigerweise) recht viel Platz im Kofferraum eingenommen. Ansonsten waren natürlich ISO-Matten, Luftmatratzen, Schlafsäcke, Kissen notwendig. Das Essen und das was zur Zubereitung notwendig war, sowie das Geschirr musste auch mit. Also da kommt schon einiges zusammen.

    Es konnte alles verstaut werden und wir haben auch noch Platz im Auto gehabt.

    Unten das Topo der Routen, die wir an den zwei Tagen geklettert sind.

    • 19.09 – Weihnachtsroute
    • 20.09 – Dornröschen

    Einige Impressionen mit Bilder von den Kollegen

    Zwei wunderbare Tage mal wieder mit herrlichen Klettererlebnissen.

    Sollte man einfach öfter machen

    Viel Spaß beim Schmökern

    Gruß

    Edi