Node-RED HomeKit Status auslesen?

  • Hallo,

    kann Node Red erkennen ob ich ein natives HomeKit gerät schalte?

    Also z.B. Eve Fenstersensor Status auslesen.


    Gruss matz

    Ich habe noch keine Möglichkeit dazu gefunden. Ich habe nur Nodes gefunden, die ein Gerät in HomeKit darstellen, das man dann schalten kann. Aber andersherum? Wär schön.

  • Für Homebridge habe ich was gefunden. Der Programmierer, der homebridge-alexa programmiert hat, hat da was, das alle Homebridge-Devices in Node Red anzeigt. Ich hab's allerdings noch nicht zum Laufen bekommen, die Nodes werden in meiner Node Red-Installation einfach nicht angezeigt. Ich komm noch dahinter.


    Falls es dich interessiert: https://github.com/NorthernMan…rib-homebridge-automation


    Stefan

  • Mittlerweile funktioniert node-red-contrib-homebridge-automation sehr gut! Ich habe mir mit dem homebridge-automation-switches Plugin einen Dummy-Schalter (Farbverlauf) erstellt. Wenn ich diesen betätige, dann wechseln die RGB-LED, die ich über homebridge-magichome eingebunden habe (TopView, TVBank) im Sekundentakt die Farbe.


    Wenn man etwas mit dem Delay und den HSB-Werten spielt, könnte man darüber beispielsweise einen eingeschalteten Fernseher simulieren (Anwesenheitssimulation) oder einen künstlichen Kaminofen in rot-orange flackernd beleuchten.


    Für alle interessierten hier mal mein flow dazu, den ich mit rudimentären Programmierkenntnissen umgesetzt habe:


    Code: flow
    1. [{"id":"d482d0c0.9e3078","type":"tab","label":"Color Fade","disabled":false,"info":""},{"id":"32444276.d7a866","type":"hb-control","z":"d482d0c0.9e3078","name":"TVBank","Homebridge":"Dingleberry Homebridge","Manufacturer":"ACME Ltd.","Service":"Lightbulb","device":"Dingleberry HomebridgeFF:19:85:E3:CE:30ACME Ltd.TVBank00000043","conf":"fdf192.d73e8e7","x":1040,"y":400,"wires":[]},{"id":"7bc87344.732e64","type":"function","z":"d482d0c0.9e3078","name":"change HSB","func":"var i = flow.get(\"i\");\nvar hue = i;\nvar sat = 80;\nvar bri = 100;\n\ni++;\nif (i>=359) {\n i = 0;\n}\n\nflow.set(\"i\", i);\n\nmsg.payload = {\"On\": true, \"Hue\": hue, \"Saturation\": sat, \"Brightness\": bri }\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":460,"wires":[["866526f0.1b23e8"]]},{"id":"589cd9a4.af449","type":"function","z":"d482d0c0.9e3078","name":"set var","func":"flow.set(\"i\", 0);\n\nreturn msg;","outputs":1,"noerr":0,"x":410,"y":400,"wires":[["7bc87344.732e64"]]},{"id":"219e1357.5611e4","type":"delay","z":"d482d0c0.9e3078","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":660,"y":560,"wires":[["7bc87344.732e64"]]},{"id":"45b1681b.1e07c","type":"hb-event","z":"d482d0c0.9e3078","name":"Farbverlauf","Homebridge":"Dingleberry Homebridge","Manufacturer":"Michael Froehlich","Service":"Switch","device":"Dingleberry HomebridgeFF:19:85:E3:CE:30Michael FroehlichFarbverlauf00000049","conf":"fdf192.d73e8e7","x":240,"y":340,"wires":[["cfda7cdc.29c3d","589cd9a4.af449"]]},{"id":"cfda7cdc.29c3d","type":"switch","z":"d482d0c0.9e3078","name":"","property":"payload.On","propertyType":"msg","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","repair":false,"outputs":2,"x":410,"y":340,"wires":[["85ef1681.7997f"],["e9672c32.a39c5"]]},{"id":"7b98d96a.e4c228","type":"function","z":"d482d0c0.9e3078","name":"on false","func":"msg.payload = {\"On\": false, \"Hue\": 360, \"Saturation\": 100, \"Brightness\": 0 }\n\nreturn msg;","outputs":1,"noerr":0,"x":760,"y":400,"wires":[["32444276.d7a866","a9ab329.eeaa25"]]},{"id":"e9672c32.a39c5","type":"function","z":"d482d0c0.9e3078","name":"a=1","func":"flow.set(\"a\", 1);\n\nreturn msg;","outputs":1,"noerr":0,"x":570,"y":380,"wires":[[]]},{"id":"85ef1681.7997f","type":"function","z":"d482d0c0.9e3078","name":"a=0","func":"flow.set(\"a\", 0);\n\nreturn msg;","outputs":1,"noerr":0,"x":570,"y":300,"wires":[[]]},{"id":"866526f0.1b23e8","type":"switch","z":"d482d0c0.9e3078","name":"","property":"a","propertyType":"flow","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":770,"y":460,"wires":[["7b98d96a.e4c228"],["219e1357.5611e4","32444276.d7a866","a9ab329.eeaa25"]]},{"id":"a9ab329.eeaa25","type":"hb-control","z":"d482d0c0.9e3078","name":"TopView","Homebridge":"Dingleberry Homebridge","Manufacturer":"ACME Ltd.","Service":"Lightbulb","device":"Dingleberry HomebridgeFF:19:85:E3:CE:30ACME Ltd.TopView00000043","conf":"fdf192.d73e8e7","x":1040,"y":340,"wires":[]},{"id":"fdf192.d73e8e7","type":"hb-conf","z":"","username":"081-85-854"}]