Rob's Node-Red Template and Example Flow Thread!

Thanks @Mike. Does this still require the Hue bridge?

Yes. I suspect most integrations require the hue bridge. Otherwise, it’s through zigbee2mqtt, which is fine, but loose the hue app. Some hue bulbs now are also bluetooth.

1 Like

Can I confirm pre-requisites? Standard NR version (v2.2.3) that comes with Core + the Yadomi module install (via palette)? I tried the non v2 version and was having issues needing me to remove the Yadomi module manually and restarting NR.

I’m on Node Red 3.0.2 But, nothing more than what you suggest.

I’m wondering then if the Yadomi module is only compatible with the latest NR?

I used it with Node-red 2.x and it worked fine :slight_smile:

Would you mind detailing what you installed as I followed the instructions as per Mike’s post.

@Mike @Flucko Looking for some assistance with installing Philips Hue support if you don’t mind…

I’ve installed the Yadomi flow.
I’ve imported V2_HUE-CLIP-API_Node-Red-Flows_Fred.Blo.json (I did try the other file that’s mentioned but that was crashing NodeRed and causing the container to restart). I get an error about a missing flow type called Junction.
image

Where can I find this? Thanks.

It is built-in with NR3 and there is no back-porting to earlier versions.

1 Like

Ohhh… hmm.
I thought @Flucko mentioned they had it running under NR 2.x.

i’m also seeing this:

[error] Error [ERR_UNHANDLED_ERROR]: Unhandled error. (Event { type: ‘error’, status: 403, message: ‘Forbidden’ })

Looks to be being raised within Yadomi’s flow.

Yes I have it running.
First install and configure: GitHub - yadomi/node-red-contrib-philipshue-events: Implements the Philips Hue API v2 EventSource as a node-red node
Then import the file without v2 prefix: hue-clip-api.node-red-flows/HUE-CLIP-API_Node-Red-Flows.json at main · andesse/hue-clip-api.node-red-flows · GitHub
This one does not give the junktion error.

2 Likes

I’m sure they are the steps I’ve already tried. Installing the Yadomi flow via:

@Flucko How are you generating the application ID that is used in the hue-events node? I’m wondering if I’m using a wrong ID hence the 403 forbidden error.

@Flucko I think I’ve made some progress… I used this:

Update: Thanks @Flucko - finally got it working! Now need to work out how to use this in NR! :slight_smile:

2 Likes

Could someone post a simple motion light flow with manual override? I am having a hard time getting this conditional flow to function. There is no “AND” logic, or do I miss something?

Edit: NR2 :slight_smile: or should I update to make it easier?

Updating won’t affect the difficulty/learning curve.

Give me a moment

1 Like

[
    {
        "id": "bf4ea44d12cdb861",
        "type": "switch",
        "z": "58e7bdb7185fc146",
        "name": "Active (true) Inactive (false)",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "true"
            },
            {
                "t": "false"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 700,
        "y": 100,
        "wires": [
            [
                "e19b69c293125301"
            ],
            [
                "184cd0614edc18e1"
            ]
        ]
    },
    {
        "id": "a436fe0b6634ef4a",
        "type": "MagicHome UFO",
        "z": "58e7bdb7185fc146",
        "name": "CLoset Led",
        "ip": "192.168.24.152",
        "style": "RGBW",
        "x": 1090,
        "y": 120,
        "wires": [
            []
        ]
    },
    {
        "id": "184cd0614edc18e1",
        "type": "change",
        "z": "58e7bdb7185fc146",
        "name": "ON",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "{ \"on\": true }",
                "tot": "json"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 910,
        "y": 140,
        "wires": [
            [
                "a436fe0b6634ef4a"
            ]
        ]
    },
    {
        "id": "e19b69c293125301",
        "type": "change",
        "z": "58e7bdb7185fc146",
        "name": "OFF",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "{ \"on\": false }",
                "tot": "json"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 910,
        "y": 100,
        "wires": [
            [
                "a436fe0b6634ef4a"
            ]
        ]
    },
    {
        "id": "35d3df5fdcb128ea",
        "type": "zigbee2mqtt-in",
        "z": "58e7bdb7185fc146",
        "name": "",
        "server": "6c5abdd60ef1d8af",
        "friendly_name": "Stairs Top Motion (3326-L)",
        "device_id": "0x000d6f000e05335c",
        "state": "occupancy",
        "outputAtStartup": false,
        "filterChanges": true,
        "enableMultiple": false,
        "x": 210,
        "y": 100,
        "wires": [
            [
                "e290bd32923df4b5"
            ]
        ]
    },
    {
        "id": "e290bd32923df4b5",
        "type": "switch",
        "z": "58e7bdb7185fc146",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "nnull"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 390,
        "y": 100,
        "wires": [
            [
                "916eaf6f0b9e8fe9"
            ]
        ]
    },
    {
        "id": "c8e20c08b65eae10",
        "type": "comment",
        "z": "58e7bdb7185fc146",
        "name": "Simple light on when motion, off when none. Global variable used to determine if flow is allowed to process when triggered for manual over-ride. ",
        "info": "",
        "x": 620,
        "y": 40,
        "wires": []
    },
    {
        "id": "916eaf6f0b9e8fe9",
        "type": "switch",
        "z": "58e7bdb7185fc146",
        "name": "",
        "property": "manualoveride",
        "propertyType": "global",
        "rules": [
            {
                "t": "false"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 510,
        "y": 100,
        "wires": [
            [
                "bf4ea44d12cdb861"
            ]
        ]
    },
    {
        "id": "9f12a8b7fbdfd346",
        "type": "comment",
        "z": "58e7bdb7185fc146",
        "name": "Set/Change the global variable by sending a payload of true of false to a change node",
        "info": "",
        "x": 440,
        "y": 160,
        "wires": []
    },
    {
        "id": "344357e0c69c502d",
        "type": "inject",
        "z": "58e7bdb7185fc146",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 190,
        "y": 200,
        "wires": [
            [
                "ead05452862f2b51"
            ]
        ]
    },
    {
        "id": "ead05452862f2b51",
        "type": "change",
        "z": "58e7bdb7185fc146",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "manualoverride",
                "pt": "global",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 410,
        "y": 200,
        "wires": [
            []
        ]
    },
    {
        "id": "359264e672327b41",
        "type": "inject",
        "z": "58e7bdb7185fc146",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "false",
        "payloadType": "bool",
        "x": 190,
        "y": 240,
        "wires": [
            [
                "ead05452862f2b51"
            ]
        ]
    },
    {
        "id": "6c5abdd60ef1d8af",
        "type": "zigbee2mqtt-server",
        "name": "zigbeemqtt",
        "host": "10.10.2.1",
        "mqtt_port": "1883",
        "mqtt_username": "",
        "mqtt_password": "",
        "mqtt_qos": "0",
        "tls": "",
        "usetls": false,
        "base_topic": "zigbee2mqtt"
    }
]
3 Likes

Amazing, thanks! The global variable part was the missing piece for me :wink:

1 Like

Basically “AND” logic can be achieved with chained switch nodes.

In my example when the contact sensor reports an occupancy change that isn’t null (you can leave that out its leftover from testing and i forgot to remove it, though it does show a three part AND chain) and sees that the global override isnt on it proceeds to turn the light on or off based on if the motion was true or not.

1 Like