PIR Sensor für Nachtbeleuchtung?

Hallo zusammen,

ich möchte einen PIR Sensor am Eingang anschließen, und soe mit der unteren Ambient Beleuchtung eine Nachtschaltung realisieren.
D.h. wenn nachts alles aus, soll der PIR Sensor eine Bewegung erkennen und die untere Ambient Beleuchtung langsam nur etwas einschalten.
Wenn gewünscht, soll die Ambient Beleuchtung aber "normal ein / ausgeschaltet werden in voller Helligeit.
Geht das ?
Welchen PIR Sensor würdet ihr empfehlen?

Grußß

Moin
Hast du das gelöst???
Oder suchst du noch eine Lösung???

Hallo Arno, der Sensor ist unterwegs, dann probiere ich das.
Hättest du ansonsten ein Lösung?
Also bezieht sich auf diesen thread:

Moin
nee dazu habe ich noch keine Lösung.
Aber zu deiner ürsprünhlichen Frage.
Ich habe den in meinem Wohnwagen im Schrank, anstatt Tür End Schalter, und mache damit ein LED Strip an, man kann die Zeit einstellen.

Den Ausgang schaltest du über einen Spannungsteiler, oder Festspannungsregler, oder Relais, oder Optokoppler auf dein MCP23017, der kann ja nur 3,3V.
grafik
Hier musst du dann, in beiden function Node den“pwm0“ in “pwm0-6“ ändern je nach dem welchen Dimmer du ansprechen willst. Und natürlich den Eingang in der MCP23017 Node
grafik

[
    {
        "id": "480d03723bd4573b",
        "type": "mcp23017input",
        "z": "d7c2753f2fc39af9",
        "name": "",
        "chip": "63a19ecf7d827979",
        "bitNum": "0",
        "pullUp": true,
        "invert": false,
        "debounce": 200,
        "onMsg": false,
        "offMsg": true,
        "x": 300,
        "y": 3380,
        "wires": [
            [
                "a9049ddfbb056a81"
            ]
        ]
    },
    {
        "id": "876c6a304fd9dabc",
        "type": "ui_slider",
        "z": "d7c2753f2fc39af9",
        "name": "",
        "label": "Nachtbeleuchtung",
        "tooltip": "",
        "group": "39357615a20afc22",
        "order": 6,
        "width": 0,
        "height": 0,
        "passthru": true,
        "outs": "end",
        "topic": "topic",
        "topicType": "msg",
        "min": 0,
        "max": "100",
        "step": "5",
        "className": "",
        "x": 550,
        "y": 3320,
        "wires": [
            [
                "2b470876417d30e0"
            ]
        ]
    },
    {
        "id": "2b470876417d30e0",
        "type": "function",
        "z": "d7c2753f2fc39af9",
        "name": "set Global",
        "func": "global.set(\"Nachtbeleuchtung\", msg.payload);\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 770,
        "y": 3320,
        "wires": [
            [
                "583bd0f92fb391e9",
                "dda5ca0ea0ce002a"
            ]
        ]
    },
    {
        "id": "a3672ae63fb21969",
        "type": "mqtt out",
        "z": "d7c2753f2fc39af9",
        "name": "",
        "topic": "",
        "qos": "",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "0ddb07c65cbb68bc",
        "x": 1170,
        "y": 3400,
        "wires": []
    },
    {
        "id": "ddb20b83d1a061af",
        "type": "inject",
        "z": "d7c2753f2fc39af9",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 350,
        "y": 3420,
        "wires": [
            [
                "a9049ddfbb056a81"
            ]
        ]
    },
    {
        "id": "583bd0f92fb391e9",
        "type": "debug",
        "z": "d7c2753f2fc39af9",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 1010,
        "y": 3260,
        "wires": []
    },
    {
        "id": "bf6c52b712a3bd3a",
        "type": "function",
        "z": "d7c2753f2fc39af9",
        "name": "set topic & payload",
        "func": "msg.topic = \"pkw/cmnd/PekawayMOTA/driver15\";\nvar value = global.get(\"Nachtbeleuchtung\")*40;\nvar mcp = msg.payload;\nvar str = value.toString();\nif (mcp == true);\nmsg.payload =  \"pwm,0,\" + str;\n\nreturn msg;\n\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 770,
        "y": 3380,
        "wires": [
            [
                "a3672ae63fb21969"
            ]
        ]
    },
    {
        "id": "b1f7859ed3433800",
        "type": "inject",
        "z": "d7c2753f2fc39af9",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "false",
        "payloadType": "bool",
        "x": 330,
        "y": 3460,
        "wires": [
            [
                "a9049ddfbb056a81"
            ]
        ]
    },
    {
        "id": "11facd5e2bec8a5c",
        "type": "function",
        "z": "d7c2753f2fc39af9",
        "name": "set topic & payload",
        "func": "msg.topic = \"pkw/cmnd/PekawayMOTA/driver15\";\nvar value = global.get(\"Nachtbeleuchtung\")*40;\nvar mcp = msg.payload;\nvar str = value.toString();\nif (mcp == false);\nmsg.payload =  \"pwm,0,\" + \"0\";\n\nreturn msg;\n\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 770,
        "y": 3420,
        "wires": [
            [
                "a3672ae63fb21969"
            ]
        ]
    },
    {
        "id": "a9049ddfbb056a81",
        "type": "switch",
        "z": "d7c2753f2fc39af9",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "true"
            },
            {
                "t": "false"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 570,
        "y": 3400,
        "wires": [
            [
                "bf6c52b712a3bd3a"
            ],
            [
                "11facd5e2bec8a5c"
            ]
        ]
    },
    {
        "id": "e0570d76bfddc761",
        "type": "file in",
        "z": "d7c2753f2fc39af9",
        "name": "",
        "filename": "pekaway/Nachtbeleuchtung",
        "format": "utf8",
        "chunk": false,
        "sendError": false,
        "encoding": "none",
        "allProps": false,
        "x": 580,
        "y": 3260,
        "wires": [
            [
                "876c6a304fd9dabc"
            ]
        ]
    },
    {
        "id": "dda5ca0ea0ce002a",
        "type": "file",
        "z": "d7c2753f2fc39af9",
        "name": "",
        "filename": "pekaway/Nachtbeleuchtung",
        "appendNewline": false,
        "createDir": true,
        "overwriteFile": "true",
        "encoding": "none",
        "x": 1020,
        "y": 3320,
        "wires": [
            []
        ]
    },
    {
        "id": "bab08604bfa31d89",
        "type": "inject",
        "z": "d7c2753f2fc39af9",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": "2",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 350,
        "y": 3260,
        "wires": [
            [
                "e0570d76bfddc761"
            ]
        ]
    },
    {
        "id": "63a19ecf7d827979",
        "type": "mcp23017chip",
        "addr": "0x26",
        "interval": "100"
    },
    {
        "id": "39357615a20afc22",
        "type": "ui_group",
        "name": "Test",
        "tab": "87822ed60f29be33",
        "order": 2,
        "disp": true,
        "width": 7,
        "collapse": false,
        "className": ""
    },
    {
        "id": "0ddb07c65cbb68bc",
        "type": "mqtt-broker",
        "name": "",
        "broker": "http://localhost",
        "port": "1883",
        "clientid": "",
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "sessionExpiry": ""
    },
    {
        "id": "87822ed60f29be33",
        "type": "ui_tab",
        "name": "Test",
        "icon": "build",
        "order": 20,
        "disabled": false,
        "hidden": false
    }
]

Das ist doch schon mal ein Anfang. Da kannst du ja dein Lichtsensor noch dazwischen stricken :wink:

Ja ok, aber wo kann ich nun bewirken dass der PIR Sensor nur bei Nacht schaltet ?

Wenn ich das bei mir starte kommt bei mir ein Error in Java Script code
image

Keine Ahnung was da passiert ist.
ich habe mid den code bei mir noch mal importier ich habe keine Fehler.
probier das mal.
flows(9).json (21.2 KB)

Hallo, im Grunde geht es, jedoch kommt noch bei einem set topic & payload ein Fehler.
Mein MC23017 schaltet (ich sehe ON/OFF )


Kann aber nur einmal einschalten oder einmal ausschalten, dann bleibt es so.
Je nachdem wie ich On Msg einstelle
image
Eigentlich müsste, so lange der PIR anzieht, “true” aktiv sein.
Wenn er abfällt, wieder “false”

Bekomme auch jede Menge Debug Meldungen, ist das OK so?

ich glaube das ist die einfachste Lösung.
häng eine Change node dazwischen, ung konfigurier diese wie unten


Mach mal beide Haken weg
grafik

Vieleicht solltest du beide Haken weg machen toggelt er dann.
Ich kann das leider nicht testen, mein MCP ist verreckt, und neue gibts nur noch in der Apotheke auf Rezept. Und nur den Chip krieg ich irgendwie nicht ans laufen.

Stell mal den Slider Nachtbeleuchtung auf einen Wert.
Dann kannst du mit den Injekt node true false ausprobieren.(Die sind eh nur zum Testen, die kannste nachher löschen)
Dann solltest du mall alle Debugs abschalten, außer die die du zum Testen brauchst. dann wird es übersichtlicher. und wenn du in den Debugs den Haken setzt
grafik
wird darunter trotzdem der Zustand angezeigt, obwohl im Debugfenster nichts angezeigt wird.
Bei false kommt die debug Meldung die du jetzt hast also Dimmer 0
Bei true bekommst du da die Meldung (eingestellter Wert *40) also bei 50% 2000 und bei 100% 4000.
Hier stellst du ein welcher Dimmer angesprochen wird. ( in beiden funktion)
grafik

Warum du da “set topic & payload” einen Fehler hast kann ich nicht nachvollziehen. Selbst in Windows kopiert habe ich da keinen Fehler.

Ich hab dir da noch einen Lichtsensor reingebaut
an das set Global den Lichtsensor anschließen die injekt node 49 und 100 kannst du wenn sie nicht zum testen benötigt werden löschen.


in check Lichtsensor den Wert (50) eintragen wo eingeschaltet werden darf.
Die 50 habe ich nur zum testen eingetragen. Dein Sensor sollte eine Number rausgeben und keinen String. sonst musst du das umwandeln.

[
    {
        "id": "e3a599a1214f61b0",
        "type": "tab",
        "label": "Export",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "5db0fe67be4339dc",
        "type": "mcp23017input",
        "z": "e3a599a1214f61b0",
        "name": "",
        "chip": "63a19ecf7d827979",
        "bitNum": "0",
        "pullUp": true,
        "invert": false,
        "debounce": 200,
        "onMsg": false,
        "offMsg": true,
        "x": 220,
        "y": 440,
        "wires": [
            [
                "504346420ac97d37"
            ]
        ]
    },
    {
        "id": "d77c6e884dd7e107",
        "type": "ui_slider",
        "z": "e3a599a1214f61b0",
        "name": "",
        "label": "Nachtbeleuchtung",
        "tooltip": "",
        "group": "39357615a20afc22",
        "order": 6,
        "width": 0,
        "height": 0,
        "passthru": true,
        "outs": "end",
        "topic": "topic",
        "topicType": "msg",
        "min": 0,
        "max": "100",
        "step": "5",
        "className": "",
        "x": 750,
        "y": 340,
        "wires": [
            [
                "48e2cb3ad73a69ba"
            ]
        ]
    },
    {
        "id": "48e2cb3ad73a69ba",
        "type": "function",
        "z": "e3a599a1214f61b0",
        "name": "set Global",
        "func": "global.set(\"Nachtbeleuchtung\", msg.payload);\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 970,
        "y": 340,
        "wires": [
            [
                "c932c4916e4142ee",
                "1660969c0268cda4"
            ]
        ]
    },
    {
        "id": "0697a861bf7f9ae9",
        "type": "mqtt out",
        "z": "e3a599a1214f61b0",
        "name": "",
        "topic": "",
        "qos": "",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "0ddb07c65cbb68bc",
        "x": 1410,
        "y": 480,
        "wires": []
    },
    {
        "id": "cfa0b2bc472b5ac3",
        "type": "inject",
        "z": "e3a599a1214f61b0",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "on",
        "payloadType": "str",
        "x": 210,
        "y": 480,
        "wires": [
            [
                "504346420ac97d37"
            ]
        ]
    },
    {
        "id": "c932c4916e4142ee",
        "type": "debug",
        "z": "e3a599a1214f61b0",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 1210,
        "y": 280,
        "wires": []
    },
    {
        "id": "7239d1cecf9ccbc7",
        "type": "function",
        "z": "e3a599a1214f61b0",
        "name": "set topic & payload",
        "func": "msg.topic = \"pkw/cmnd/PekawayMOTA/driver15\";\nvar value = global.get(\"Nachtbeleuchtung\")*40;\nvar mcp = msg.payload;\nvar str = value.toString();\n\n\nif (mcp == true) ;\nmsg.payload =  \"pwm,0,\" + str;\n\nreturn msg;\n\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1140,
        "y": 460,
        "wires": [
            [
                "0697a861bf7f9ae9",
                "41f198e8395431b5"
            ]
        ]
    },
    {
        "id": "e236affed994b34d",
        "type": "inject",
        "z": "e3a599a1214f61b0",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "off",
        "payloadType": "str",
        "x": 210,
        "y": 520,
        "wires": [
            [
                "504346420ac97d37"
            ]
        ]
    },
    {
        "id": "93f449c4872c5278",
        "type": "function",
        "z": "e3a599a1214f61b0",
        "name": "set topic & payload",
        "func": "msg.topic = \"pkw/cmnd/PekawayMOTA/driver15\";\nvar value = global.get(\"Nachtbeleuchtung\")*40;\nvar mcp = msg.payload;\nvar str = value.toString();\nif (mcp == false);\nmsg.payload =  \"pwm,0,\" + \"0\";\n\nreturn msg;\n\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1160,
        "y": 500,
        "wires": [
            [
                "0697a861bf7f9ae9",
                "41f198e8395431b5"
            ]
        ]
    },
    {
        "id": "96ac789b1d8ed7cf",
        "type": "switch",
        "z": "e3a599a1214f61b0",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "true"
            },
            {
                "t": "false"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 610,
        "y": 480,
        "wires": [
            [
                "079633285517d6f9"
            ],
            [
                "93f449c4872c5278"
            ]
        ]
    },
    {
        "id": "bcd2ed47a9c3d668",
        "type": "file in",
        "z": "e3a599a1214f61b0",
        "name": "",
        "filename": "pekaway/Nachtbeleuchtung",
        "format": "utf8",
        "chunk": false,
        "sendError": false,
        "encoding": "none",
        "allProps": false,
        "x": 780,
        "y": 280,
        "wires": [
            [
                "d77c6e884dd7e107"
            ]
        ]
    },
    {
        "id": "1660969c0268cda4",
        "type": "file",
        "z": "e3a599a1214f61b0",
        "name": "",
        "filename": "pekaway/Nachtbeleuchtung",
        "appendNewline": false,
        "createDir": true,
        "overwriteFile": "true",
        "encoding": "none",
        "x": 1220,
        "y": 340,
        "wires": [
            []
        ]
    },
    {
        "id": "0b1c23e919e5f95e",
        "type": "inject",
        "z": "e3a599a1214f61b0",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": "2",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 550,
        "y": 280,
        "wires": [
            [
                "bcd2ed47a9c3d668"
            ]
        ]
    },
    {
        "id": "41f198e8395431b5",
        "type": "debug",
        "z": "e3a599a1214f61b0",
        "name": "debug 2",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 1380,
        "y": 440,
        "wires": []
    },
    {
        "id": "ea2aec6c18b7cb66",
        "type": "inject",
        "z": "e3a599a1214f61b0",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "49",
        "payloadType": "num",
        "x": 570,
        "y": 380,
        "wires": [
            [
                "70eb858a2f5459cd"
            ]
        ]
    },
    {
        "id": "6a5182dfdf8efa2a",
        "type": "inject",
        "z": "e3a599a1214f61b0",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "100",
        "payloadType": "num",
        "x": 570,
        "y": 420,
        "wires": [
            [
                "70eb858a2f5459cd"
            ]
        ]
    },
    {
        "id": "70eb858a2f5459cd",
        "type": "function",
        "z": "e3a599a1214f61b0",
        "name": "set Global",
        "func": "global.set(\"Lichtsensor\", msg.payload);\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 750,
        "y": 400,
        "wires": [
            []
        ]
    },
    {
        "id": "079633285517d6f9",
        "type": "function",
        "z": "e3a599a1214f61b0",
        "name": "check Lichtsensor",
        "func": "var check = global.get(\"Lichtsensor\");\n\nif(global.get(\"Lichtsensor\")<50)\n{\n    msg.payload = true;\n}\n\nelse\nmsg.payload = false;\nglobal.set(\"LichtsensorEin\", msg.payload);\n\nreturn msg;\n\n\n\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 790,
        "y": 480,
        "wires": [
            [
                "147008b4243db15f"
            ]
        ]
    },
    {
        "id": "147008b4243db15f",
        "type": "switch",
        "z": "e3a599a1214f61b0",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "true"
            },
            {
                "t": "false"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 950,
        "y": 480,
        "wires": [
            [
                "7239d1cecf9ccbc7"
            ],
            [
                "93f449c4872c5278"
            ]
        ]
    },
    {
        "id": "504346420ac97d37",
        "type": "change",
        "z": "e3a599a1214f61b0",
        "name": "",
        "rules": [
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "on",
                "fromt": "str",
                "to": "true",
                "tot": "bool"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "off",
                "fromt": "str",
                "to": "false",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 450,
        "y": 480,
        "wires": [
            [
                "96ac789b1d8ed7cf"
            ]
        ]
    },
    {
        "id": "b05272ca294ab177",
        "type": "comment",
        "z": "e3a599a1214f61b0",
        "name": "Lichtsensor",
        "info": "",
        "x": 390,
        "y": 400,
        "wires": []
    },
    {
        "id": "63a19ecf7d827979",
        "type": "mcp23017chip",
        "addr": "0x26",
        "interval": "100"
    },
    {
        "id": "39357615a20afc22",
        "type": "ui_group",
        "name": "Test",
        "tab": "87822ed60f29be33",
        "order": 2,
        "disp": true,
        "width": 7,
        "collapse": false,
        "className": ""
    },
    {
        "id": "0ddb07c65cbb68bc",
        "type": "mqtt-broker",
        "name": "",
        "broker": "http://localhost",
        "port": "1883",
        "clientid": "",
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "sessionExpiry": ""
    },
    {
        "id": "87822ed60f29be33",
        "type": "ui_tab",
        "name": "Test",
        "icon": "build",
        "order": 20,
        "disabled": false,
        "hidden": false
    }
]

Hallo Arno, habe es mit dem BH1750 hinbekommen:

[{"id":"995e8bf58edab759","type":"Bh1750","z":"f3d93df51e6fd80c","name":"Lichtsensor1","bus":"1","address":"0x23","topic":"bh1750","readMode":"","x":490,"y":1180,"wires":[["0eb47d581a852c85"]]},{"id":"9b50abf8f8eed940","type":"inject","z":"f3d93df51e6fd80c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"10","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":250,"y":1180,"wires":[["995e8bf58edab759"]]},{"id":"b4ef12fc4879a018","type":"debug","z":"f3d93df51e6fd80c","name":"debug 13","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":860,"y":1180,"wires":[]},{"id":"ef6673168ff7f549","type":"mcp23017input","z":"f3d93df51e6fd80c","name":"","chip":"bf0f1697811eb554","bitNum":"0","pullUp":true,"invert":true,"debounce":200,"onMsg":true,"offMsg":true,"x":240,"y":1440,"wires":[["82d7d0786d9edfbf"]]},{"id":"c3a8ec22e820aca7","type":"ui_slider","z":"f3d93df51e6fd80c","name":"","label":"Nachtbeleuchtung Helligkeit","tooltip":"","group":"1884f74af5736225","order":6,"width":0,"height":0,"passthru":true,"outs":"end","topic":"topic","topicType":"msg","min":0,"max":"100","step":"5","className":"","x":800,"y":1360,"wires":[["f2474d97887d7657"]]},{"id":"f2474d97887d7657","type":"function","z":"f3d93df51e6fd80c","name":"set Global","func":"global.set(\"Nachtbeleuchtung\", msg.payload);\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":990,"y":1360,"wires":[["8184332793aca2d2","ee235bd3cb4ece99"]]},{"id":"0dd28fde9d0a0ba0","type":"mqtt out","z":"f3d93df51e6fd80c","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"0ddb07c65cbb68bc","x":1430,"y":1500,"wires":[]},{"id":"4acddb508245d6b8","type":"inject","z":"f3d93df51e6fd80c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"on","payloadType":"str","x":230,"y":1500,"wires":[["82d7d0786d9edfbf"]]},{"id":"22089a786045e978","type":"function","z":"f3d93df51e6fd80c","name":"set topic & payload","func":"msg.topic = \"pkw/cmnd/PekawayMOTA/driver15\";\nvar value = global.get(\"Nachtbeleuchtung\")*40;\nvar mcp = msg.payload;\nvar str = value.toString();\n\n\nif (mcp == true) {\nmsg.payload =  \"pwm,0,\" + str;\n}\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1160,"y":1480,"wires":[["0dd28fde9d0a0ba0","99f277b5cda443a5"]]},{"id":"7f8f8fd3aa02c44d","type":"inject","z":"f3d93df51e6fd80c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"off","payloadType":"str","x":230,"y":1540,"wires":[["82d7d0786d9edfbf"]]},{"id":"5f45b7b69bbec1f1","type":"function","z":"f3d93df51e6fd80c","name":"set topic & payload","func":"msg.topic = \"pkw/cmnd/PekawayMOTA/driver15\";\nvar value = global.get(\"Nachtbeleuchtung\")*40;\nvar mcp = msg.payload;\nvar str = value.toString();\nif (mcp == false) {\nmsg.payload =  \"pwm,0,\" + \"0\";\n}\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1170,"y":1520,"wires":[["0dd28fde9d0a0ba0","99f277b5cda443a5"]]},{"id":"929af14207f30132","type":"switch","z":"f3d93df51e6fd80c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":630,"y":1500,"wires":[["522d594b9a89bcad"],["5f45b7b69bbec1f1"]]},{"id":"c6d4e3e45aeacdd8","type":"file in","z":"f3d93df51e6fd80c","name":"","filename":"pekaway/Nachtbeleuchtung","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":860,"y":1300,"wires":[["c3a8ec22e820aca7"]]},{"id":"8184332793aca2d2","type":"file","z":"f3d93df51e6fd80c","name":"","filename":"pekaway/Nachtbeleuchtung","appendNewline":false,"createDir":true,"overwriteFile":"true","encoding":"none","x":1240,"y":1360,"wires":[[]]},{"id":"2a3f8445edee4fcd","type":"inject","z":"f3d93df51e6fd80c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"2","topic":"","payload":"","payloadType":"date","x":570,"y":1300,"wires":[["c6d4e3e45aeacdd8"]]},{"id":"99f277b5cda443a5","type":"debug","z":"f3d93df51e6fd80c","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1400,"y":1440,"wires":[]},{"id":"c81680e2fb6ba214","type":"inject","z":"f3d93df51e6fd80c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"49","payloadType":"num","x":590,"y":1400,"wires":[["d121c98e520e5896"]]},{"id":"72674af072f5f570","type":"inject","z":"f3d93df51e6fd80c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"100","payloadType":"num","x":590,"y":1440,"wires":[["d121c98e520e5896"]]},{"id":"d121c98e520e5896","type":"function","z":"f3d93df51e6fd80c","name":"set Global","func":"global.set(\"Lichtsensor\", msg.payload);\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":1420,"wires":[[]]},{"id":"522d594b9a89bcad","type":"function","z":"f3d93df51e6fd80c","name":"check Lichtsensor","func":"var check = global.get(\"Lichtsensor\");\n\nif(global.get(\"Lichtsensor\")<50)\n{\n    msg.payload = true;\n}\n\nelse\nmsg.payload = false;\nglobal.set(\"LichtsensorEin\", msg.payload);\n\nreturn msg;\n\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":1480,"wires":[["1013a4a4f889e417"]]},{"id":"1013a4a4f889e417","type":"switch","z":"f3d93df51e6fd80c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":970,"y":1480,"wires":[["22089a786045e978"],["5f45b7b69bbec1f1"]]},{"id":"82d7d0786d9edfbf","type":"change","z":"f3d93df51e6fd80c","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"true","tot":"bool"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":1500,"wires":[["929af14207f30132","caa2b370c996960a"]]},{"id":"d2930cb310fb496c","type":"comment","z":"f3d93df51e6fd80c","name":"Lichtsensor","info":"","x":230,"y":1100,"wires":[]},{"id":"0eb47d581a852c85","type":"function","z":"f3d93df51e6fd80c","name":"set Global","func":"msg.payload = Number((msg.payload).toFixed(0));\nglobal.set(\"Lichtsensor\", msg.payload);\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":1180,"wires":[["b4ef12fc4879a018"]]},{"id":"ee235bd3cb4ece99","type":"debug","z":"f3d93df51e6fd80c","name":"debug 14","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1240,"y":1280,"wires":[]},{"id":"caa2b370c996960a","type":"debug","z":"f3d93df51e6fd80c","name":"debug 15","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":780,"y":1580,"wires":[]},{"id":"bf0f1697811eb554","type":"mcp23017chip","addr":"0x22","interval":"100"},{"id":"1884f74af5736225","type":"ui_group","name":"Test","tab":"608293e12e898cc6","order":2,"disp":true,"width":7,"collapse":false,"className":""},{"id":"0ddb07c65cbb68bc","type":"mqtt-broker","name":"","broker":"http://localhost","port":"1883","clientid":"","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"608293e12e898cc6","type":"ui_tab","name":"Test","icon":"build","order":20,"disabled":false,"hidden":false}]

@ range4200t
Hallo Stefan
Hier ist ein Update mit Signal Fläche und Farbumschlag.
Mußte es leider komplett umbauen :frowning:


Ich bekiomme den Lichtsensor bei mir nicht installiert.
an dem funktion mit den Injekt 49/100 musst du den Lichtsensor anschließen.
in der Change node Dunkel/Hell Licht AN AUS kannst du den Text ändern
in der Fuction davor die Farbe
Nachtlicht.json (20.2 KB)
Mit der Auswahl der Dimmer versuche ich evtl. am WE.
Gruß
Arno

@range4200t
Hi Stefan
ging besser als ich gedacht habe.


grafik
grafik
grafik
grafik
Nachtlicht.json (36.9 KB)
viel Spass
Gruß
Arno

Hi Arno, super.
Ich hoffe ich komme morgen zum Testen.

Hallo Arno, der die Einstellung finde ich nach der Installation von deinem Flow nicht. Beim Ergebnis kommt “Scheinwerfer” ???
image

schau mal was da drine steht.
vermutlich haben die sich woanders einsortiert.


Ich glaube die sind bei mir unter Scheinwerfen, das kannst du ja ändern.
Oder suchst du die Einstellung???
grafik
da musst du mal schauen wo sich die einsortiert haben.
grafik

Da steht:
grafik


grafik

Aber ich vermisse das hier:
grafik

Hi Stefan
dann musst du da eine neue Gruppe entwerfen. bei mir lag das auf der Testseite in der Gruppe Scheinwerfer
grafik
und die Beiden Slider findest du vermutlich links im Menü in “Meine Konfig”
Schau hier mal rein, in die beiden Slider und in der ganz unten liegenden liegenden Text Node
Reset und Comand Dimmer
da steht in der Gruppe sicher “(Meine Konfig) Nachtlicht”.
grafik
Bin auf der Arbeit, kann dir leider nicht anders weiterhelfen :wink:

Habs gefunden, danke. War “Meine Konfig”