A simple Siri-Switch (Node-RED + Dashboard + HomeKit)

This flow demonstrates basic interaction between Node-RED and HomeKit.

The contained Flow consists of two nodes: a HomeKit Service node and a UI Switch node. They are wired as a closed loop, so they provide each other with feedback.

In this example the HomeKit node is paired with the displayed iPhone. So when the user changes the switch in the iOS Home App the new state is being propagated to the UI node in Node-RED. This even supports Siri voice control with no further setup involved :)

Flow in action

[
    {
        "id": "9f2fd2c1.5ad08",
        "type": "tab",
        "label": "HomeKit Demo"
    },
    {
        "id": "287b69aa.05ea66",
        "type": "homekit-service",
        "z": "9f2fd2c1.5ad08",
        "accessory": "d1e30622.0d3aa8",
        "name": "Switch",
        "serviceName": "Switch",
        "x": 270,
        "y": 200,
        "wires": [
            [
                "37233ce8.cc8c34"
            ]
        ]
    },
    {
        "id": "37233ce8.cc8c34",
        "type": "ui_switch",
        "z": "9f2fd2c1.5ad08",
        "name": "",
        "label": "Switch",
        "group": "bb0e754e.70b108",
        "order": 0,
        "width": 0,
        "height": 0,
        "passthru": false,
        "topic": "",
        "style": "",
        "onvalue": "{\"On\":true}",
        "onvalueType": "json",
        "onicon": "",
        "oncolor": "",
        "offvalue": "{\"On\":false}",
        "offvalueType": "json",
        "officon": "",
        "offcolor": "",
        "x": 280,
        "y": 100,
        "wires": [
            [
                "287b69aa.05ea66"
            ]
        ]
    },
    {
        "id": "d1e30622.0d3aa8",
        "type": "homekit-accessory",
        "z": "",
        "accessoryName": "Connector",
        "pinCode": "111-11-111",
        "port": "",
        "manufacturer": "Default Manufacturer",
        "model": "Default Model",
        "serialNo": "Default Serial Number"
    },
    {
        "id": "bb0e754e.70b108",
        "type": "ui_group",
        "z": "",
        "name": "Default",
        "tab": "77efcdfa.edd224",
        "disp": false,
        "width": "6"
    },
    {
        "id": "77efcdfa.edd224",
        "type": "ui_tab",
        "z": "",
        "name": "HomeKit",
        "icon": "dashboard"
    }
]
mschm

Flow Info

created 8 months, 3 weeks ago

Node Types

Other

Tags

  • HomeKit
  • Siri
  • Switch
  • Voice
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option