Node-RED nodes for hubitat

Thank you @fblackburn!!!!

My mind was already overwhelmed with the possibilities of NR HE nodes but now you've taken it even further... wow.

Could you share the flow please? Have others created flows that use the Request Node already? I am struggling thinking of use cases and want to be able to play with the new toy.

I assume he followed @fblackburn example in that github thread, and added them to a dashboard table, as that is what the bottom path of that example flow does.

I'm not a fan of doing devices/all queries, as it is really slow and hammers the hub horribly, but as an initial population of a table, and then updating only via events, it could be ok.

1 Like

Which door lock are you using?

I updated both my hub (to version 2.2.0.121) and node-RED (node-red-contrib-hubitat version 0.0.31) but my Yale zigbee lock (YRD226-HA2-619) is still not reporting the type as "digital "when I enter the code on the screen. The only type I am getting is "physical" for both manual unlock and keying in the code on the screen.

Wondering if the zigbee lock driver was not updated to add this?

As a few people already PMed me, here are more details on how I made this table, Note that the table does NOT auto-sort by temperature. I just touch/click the header when I want to sort it. That could be done automatically, though, with ui_control.

I use this node:

(Sorted by temp in the pic below):

I have 2 hubs I collect events from, so I needed a way to ensure the device id were unique. So I prepend the hub name (last part of IP address) to the deviceId. If you only have 1 hub then one of the initial 'swim lanes' would go away as well as the 1st change node, and you would just use id=deviceId in the remaining change node.

'make table update' change node:

And the 'table recorder' node is taken straight from example 4 of that node palette.

table node column config:

3 Likes

I assume this was directed at me? If it was, I'm using a Yale YRD256 TSDB zigbee lock. Below, I've pasted the sequence I use to distinguish between locking with the thumbturn or by pushing the button on the outside.

Note: although both of these are physical events, they can be distinguished by the descriptionText. Using the key is the same as "thumbturn". Using the keypad will show up as a button event. At least it does on my lock.

Untitled

You can import the sequence and edit it for your needs.

Exported sequence
[
{
    "id": "1103db7d.65d045",
    "type": "switch",
    "z": "6c94d65d.665268",
    "name": "Front door lock",
    "property": "payload.deviceId",
    "propertyType": "msg",
    "rules": [
        {
            "t": "eq",
            "v": "1219",
            "vt": "str"
        }
    ],
    "checkall": "true",
    "repair": false,
    "outputs": 1,
    "x": 440,
    "y": 360,
    "wires": [
        [
            "b35eed31.c19718"
        ]
    ]
},
{
    "id": "863f4a4f.481ee8",
    "type": "hubitat event",
    "z": "6c94d65d.665268",
    "name": "Events",
    "server": "8b31fd80.869848",
    "x": 270,
    "y": 360,
    "wires": [
        [
            "1103db7d.65d045"
        ]
    ]
},
{
    "id": "b35eed31.c19718",
    "type": "switch",
    "z": "6c94d65d.665268",
    "name": "locked",
    "property": "payload.value",
    "propertyType": "msg",
    "rules": [
        {
            "t": "eq",
            "v": "locked",
            "vt": "str"
        }
    ],
    "checkall": "true",
    "repair": false,
    "outputs": 1,
    "x": 610,
    "y": 360,
    "wires": [
        [
            "b90761bc.814868"
        ]
    ]
},
{
    "id": "b90761bc.814868",
    "type": "switch",
    "z": "6c94d65d.665268",
    "name": "button or thumbturn",
    "property": "payload.descriptionText",
    "propertyType": "msg",
    "rules": [
        {
            "t": "cont",
            "v": "button",
            "vt": "str"
        },
        {
            "t": "cont",
            "v": "thumbturn",
            "vt": "str"
        }
    ],
    "checkall": "true",
    "repair": false,
    "outputs": 2,
    "x": 800,
    "y": 360,
    "wires": [
        [],
        []
    ]
},
{
    "id": "8b31fd80.869848",
    "type": "hubitat config",
    "z": "",
    "name": "HubitatES",
    "usetls": false,
    "host": "192.168.1.46",
    "port": "8080",
    "token": "d04f665b-4ae2-4bbd-8c51-7d9d7fff7331",
    "appId": "1906",
    "nodeRedServer": "http://192.168.1.4:1880",
    "webhookPath": "/hubitat/webhook3"
}

]

2 Likes

Thanks, that is exactly what I needed!

Great Tip...thanks Geoff!

And just for reference, here is what the events look like on Kwikset zigbee locks:

2 Likes

I think this is correct in concept. Triggering a Lutron light from a physical switch will show as physical. Triggering the same light from Home Assistant will also show as physical as Hubitat sees but did not trigger that action. But if one uses a Hubitat-connected Lutron Pico to trigger the light the light event will show as either digital or blank (as the Hubitat driver for Lutron lights does not always fill the field for digital events).

Were you looking at the button device or the light that the button is controlling? For Lutron Picos the press shows as physical for the Pico device, but will show as digital for the lighting load device that it is controlling (as the on/off commands go through a Hubitat button controller app).

But as stated by others, it's up to the driver to correctly populated the field. One of the changes to Hubitat v 2.2.0 was to add a Leviton DZ6HD Dimmer driver. It previously used the Generic driver. About the only thing I see different is that the Generic driver reported all events as digital and now the new driver correctly reports physical events.

FYI, you can use device node too. With the new version all event properties received are added to the message

At the button device directly. But I have no use for now, it was only to test

1 Like

:+1: Device node w/"All" works as advertised. Thanks!

2 Likes

An illustration of a peeve of mine. People, please cite the pertinent part of whichever post you're referring to. It's really hard, at least for me, to follow this (and most other) topic without it.

Thanks

I’m sorry, that was my fault​:nauseated_face: I was tryng to multitask while babysitting my granddaughter and she accidentally hit the reply button before I could reference the message. Lesson learned, keep the iPad far away from curious little fingers!:grin:

Idle thought of the day. 3 node Atomic Pi docker swarm....

How adorable! Getting her into STEM early! :+1: :+1:

Get you some of these. They're flexible and very thin.

Ordered. Will be like a month before it gets here, but oh well. lol

In the meantime I'll play with the 1 atomic pi I've had collecting dust in a drawer for a year. Only 16GB emmc storage, so not a lot of room to play with.

I really like my rpi cluster I made, but.... I neglected to consider that I have some x86 only containers I run.... :confused: Oops.

1 Like

The flow is the one linked in the update post. It's not mine.

Summary

[{"id":"45d2924b.0eca5c","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"2ebe5c49.1fb89c","type":"hubitat event","z":"45d2924b.0eca5c","name":"","server":"aeaecfe5.e3c678","x":290,"y":80,"wires":[["2c595ae4.72a4b6"]]},{"id":"4e3a65e.cead49c","type":"hubitat request","z":"45d2924b.0eca5c","name":"Get Devices","server":"aeaecfe5.e3c678","path":"/devices/all","x":270,"y":140,"wires":[["b821bd7b.0d9d3"]]},{"id":"d72f2565.13b258","type":"inject","z":"45d2924b.0eca5c","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":110,"y":140,"wires":[["4e3a65e.cead49c"]]},{"id":"b821bd7b.0d9d3","type":"split","z":"45d2924b.0eca5c","name":"Split","splt":"\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":430,"y":140,"wires":[["2c534ea5.d8a5da"]]},{"id":"2c534ea5.d8a5da","type":"switch","z":"45d2924b.0eca5c","name":"","property":"payload.attributes","propertyType":"msg","rules":[{"t":"hask","v":"battery","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":570,"y":140,"wires":[["63468155.01ed"]]},{"id":"63468155.01ed","type":"change","z":"45d2924b.0eca5c","name":"set value","rules":[{"t":"set","p":"topic","pt":"msg","to":"payload.label","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.attributes.battery","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":140,"wires":[["5bf745e9.61a30c"]]},{"id":"5bf745e9.61a30c","type":"ui_chart","z":"45d2924b.0eca5c","name":"","group":"9ad6e619.cdab7","order":1,"width":0,"height":0,"label":"{{msg.topic}}","chartType":"horizontalBar","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"100","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":true,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":910,"y":100,"wires":[]},{"id":"6ecf5c98.00a87c","type":"change","z":"45d2924b.0eca5c","name":"set value","rules":[{"t":"set","p":"topic","pt":"msg","to":"payload.displayName","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":80,"wires":[["5bf745e9.61a30c"]]},{"id":"2c595ae4.72a4b6","type":"switch","z":"45d2924b.0eca5c","name":"","property":"payload.name","propertyType":"msg","rules":[{"t":"eq","v":"battery","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":570,"y":80,"wires":[["6ecf5c98.00a87c"]]},{"id":"9ad6e619.cdab7","type":"ui_group","z":"","name":"Default","tab":"68d5add8.ad02a4","disp":true,"width":"6","collapse":false},{"id":"68d5add8.ad02a4","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

This is a partial list of what it produces..
image

Anyone know why the heading DS - Balcony appears under the title? I presume it's the first/last device to report. If I do a manual refresh of the dashboard, it disappears.

As for other use cases, I was thinking about doing it for switches (getting all my light switches onto the dashboard in one go), but it didnt work. Maybe I'd have to use a template node first. Not sure.

After your posting about it, I made a temperature and battery one. I am boring, though, so left it as numbers.

Although 0-100% bars looks kind of cool on bettery, too I guess.