Node-RED nodes for hubitat

So I'm running out of things to do - I might actually need to do some... work!!! Argh.

  • Moved all zigbee from Hubitat to zigbee2mqtt. Not trivial, and not without some code modifications (all submitted back to the devs), sniffing, and testing
  • Finished functional testing on core zwave devices for possible migration to zwave2mqtt
  • Implemented OwnTracks for location/presence detection. Still tweaking some settings there - not 100% sure yet that this can replace Life360 for my needs... We'll see - the devs made some more setting recommendations last night. Testing has slowed down dramatically now that no one is leaving the house. :man_shrugging:
  • Moved all dashboards from Hubitat to Node-RED
  • Moved all rules from Hubitat to Node-RED (except 5 that need event type)
  • Moved 7 apps from Hubitat to Node-RED (HVAC temp balancing, device mirroring, and a few others)
  • Testing retiring my HubConnect-like custom Hubitat app, and just do the data passing between hubs in Node-RED. Looks like it is working very well, with only minimal increased latency. So this is probably a "go" later this week.
  • Implemented Google Home integration in Node-RED via NORA. Removed all Google Home integration from Hubitat. Actually works better since NORA knows what fans are, and you can explicitly specify switch vs dimmer. :wink:

Getting all the stuff off my hub, it is faster than I've ever seen it. Go figure.

3 Likes

What's your take/opinion on zigbee2mqtt vs deCONZ? I've used deCONZ quite a bit and I have a zigbee stick for zigbee2mqtt but didn't do much with it as the device support at the time was mostly light bulbs which I didn't care much about.

Interesting. I'm currently using Traccar running in a EC2 instance that accepts my GPS data (units and phones) and that is sending only geoFence events back to my system which is parsed by a NR flow to then trigger my automations. I'm using webhookrelay with NR to provide the external access without using port forwarding as well. So far working great but I'd like to hear more of your OwnTracks adventure.

I'm confused and not understanding the intent. Typo?

Me too! My wife and kids got stuck under quarantine at her parents 1300 miles away so it's just me & the dogs at home.

Interesting. I am not ready to go there yet. I find that Node Red is better in a monitoring &/or graphing type situation but I am actually growing to like Hubitat's dashboards now that I am slowly learning to tweak CSS. How do you access your Node Red dashboards remotely?

Thanks for the heads up. I will have to take a look. I only have one Google Mini and typically only cast messages to it. I usually use one of our 4 Echo devices.
EDIT: Is NORA local? Faster than HE app?

No 1st hand experience with deCONZ. I've looked at it a few times, but never used it.

Working pretty well. Very accurate in 'high accuracy' mode, but uses more battery on phones than I like (GPS used all the time). Lower power mode is great on battery, but is proving to take a lot of experimentation on settings to get it reliable enough to replace Life360. For me, Life360 works well because it sits in low accuracy mode until movement/driving detected and then flips itself to high accuracy. Owntracks does not do that out of the box, but could technically be done with Tasker. I'm trying to avoid that though.

Here is a fun guide on doing owntracks via webhook relay if you aren't an MQTT guy (that said, I do integrate mine with MQTT):

Oops. typo. it is faster. Fixed.

I don't. I always-on VPN to my house when remote.

Well, local and Google Assistant don't mix (other than for casting, which I don't need). No, like most other Google Home/Google Assistant integration services, NORA requires internet connectivity.

If all you want is casting from Node-RED, there are other google cast integrations that can do that. I don't have much experience with them though.

As for owntracks I'm happy with Traccar :slight_smile: I just was interested as I've not used that one. Seems interesting.

I'm using WebHookRelay with Node-RED with Traccar currently :slight_smile:

I may have to play around with zigbee2mqtt a little while I have nothing but time....

I was pretty amazed that I was able to get 100% of my zigbee devices working on zigbee2mqtt. Now, some devices don't report every single variable yet, but the core function works. Example, my NYCE ceiling motion can report humidity and temperature - it doesn't in zigbee2mqtt, just motion.

The dev is very engaged in adding support where it is missing though. If I ever pull my ceiling motion sensor off the ceiling to facilitate troubleshooting, I'm sure we could get that one resolved.

Things that I have installed in z2m:

  • Kwikset locks
  • SmartThings leak sensors
  • SmartThings outlets
  • Pretty much any contact sensor, tried various Iris and Visonic models
  • Konke Humidity/Temp sensors
  • Xiaomi Humidity/Temp sensors
  • Ikea repeaters and outlet (including OTA firmware updates)
  • Sengled RGB bulbs
  • Osram bulbs (including OTA firmware updates). I removed these, though, as they destroy my zigbee mesh as they are ■■■■ repeaters. I just wanted to see if they would work, and they do.
1 Like

Can someone help me convert this rule to a sequence? I'm stuck - thanks!

IF (Power level of Samsung - washer(0) is >= 10.0(F) [FALSE]) THEN
	Cancel Delayed Actions
	Stop Repeating Actions
ELSE-IF (Power level of Samsung - washer(0) is < 10.0(T) [TRUE]) THEN
	Delay 0:10:00 (cancelable)
	Repeat 2 times every 0:10:00 (stopable)
		Set tts_payload to 'Washer is done at %now%. Move clothes to the dryer.'
	END-REP
END-IF

What's the channel number? Out of curiosity.

  1. I only use 15, 20, 25.
1 Like

Which part is tripping you up? The triggers, or the repeating tts?

Also, how does the tts ever stop on the last load of laundry, when you won't have another washer power > 10 event to stop the tts?

The triggers. Repeating is easy.

Actually - I think I know how to do it. Just put a switch on the power and use msg.reset where necessary (for a delay timer) (or stop for a stoptimer).

You made me look at the rule with fresh eyes. Thanks!!

1 Like

Change payload from string to number:
Screenshot 2020-03-31 at 11.05.40 AM

1 Like

I have a general question.. not necessarily related to your stuff where would you use msg.reset?

The only reason I'm curious is because I have already converted a bunch of RM rules and I want to make sure I'm not missing something.

Hi Eric -

Here's an example that I use in my garage door open/close rule. I have the door close automatically and do a repeated TTS while the door is open.

In this case, I use msg.reset to reset all three delay nodes. This prevents the sequence from running past those points any more. The key thing to remember is that if you insert msg.reset into a sequence, you have delete it immediately after the delay timer that is reset.

1 Like

Wow okay thanks.. I need some time to parse that. I am not using reset anywhere but I do have a subflow that reports a contact sensor being open for 5 minutes (up to a specified # of times) with intermediate msgs going out "output 1" and final msg going out "output 2".. wonder if it could be made more efficient...

1 Like

Here's a second practical example (with the code) for how I plan to use it for my "washer is done sequence" (depending on whether the power > 10 or power = 0.

Sequence
[
{
    "id": "9ebbdc63.09ac",
    "type": "switch",
    "z": "1d722e3f.ef985a",
    "name": "3-2-1",
    "property": "count",
    "propertyType": "msg",
    "rules": [
        {
            "t": "btwn",
            "v": "3",
            "vt": "num",
            "v2": "1",
            "v2t": "num"
        }
    ],
    "checkall": "true",
    "repair": false,
    "outputs": 1,
    "x": 3030,
    "y": 1600,
    "wires": [
        [
            "f188c306.ce484",
            "576e047.81b677c"
        ]
    ]
},
{
    "id": "1a56ae27.378b82",
    "type": "change",
    "z": "1d722e3f.ef985a",
    "name": "",
    "rules": [
        {
            "t": "delete",
            "p": "reset",
            "pt": "msg"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 2915,
    "y": 1600,
    "wires": [
        [
            "9ebbdc63.09ac"
        ]
    ],
    "l": false
},
{
    "id": "f188c306.ce484",
    "type": "debug",
    "z": "1d722e3f.ef985a",
    "name": "",
    "active": true,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "count",
    "targetType": "msg",
    "x": 3190,
    "y": 1600,
    "wires": []
},
{
    "id": "576e047.81b677c",
    "type": "delay",
    "z": "1d722e3f.ef985a",
    "name": "1 sec",
    "pauseType": "delay",
    "timeout": "1",
    "timeoutUnits": "seconds",
    "rate": "1",
    "nbRateUnits": "1",
    "rateUnits": "second",
    "randomFirst": "1",
    "randomLast": "5",
    "randomUnits": "seconds",
    "drop": false,
    "x": 2410,
    "y": 1600,
    "wires": [
        [
            "3000decb.e70c42"
        ]
    ]
},
{
    "id": "b2b242d8.a3bcd",
    "type": "counter",
    "z": "1d722e3f.ef985a",
    "name": "3-1",
    "init": "4",
    "step": "1",
    "lower": "0",
    "upper": "4",
    "mode": "decrement",
    "outputs": "1",
    "x": 2810,
    "y": 1600,
    "wires": [
        [
            "1a56ae27.378b82"
        ]
    ]
},
{
    "id": "3d561eae.03a35a",
    "type": "change",
    "z": "1d722e3f.ef985a",
    "name": "",
    "rules": [
        {
            "t": "set",
            "p": "reset",
            "pt": "msg",
            "to": "4",
            "tot": "num"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 2695,
    "y": 1540,
    "wires": [
        [
            "576e047.81b677c",
            "b2b242d8.a3bcd"
        ]
    ],
    "l": false
},
{
    "id": "3000decb.e70c42",
    "type": "change",
    "z": "1d722e3f.ef985a",
    "name": "",
    "rules": [
        {
            "t": "delete",
            "p": "reset",
            "pt": "msg"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 2515,
    "y": 1600,
    "wires": [
        [
            "e2304571.2a12c"
        ]
    ],
    "l": false
},
{
    "id": "636089b1.3542a8",
    "type": "inject",
    "z": "1d722e3f.ef985a",
    "name": "power = 0",
    "topic": "",
    "payload": "",
    "payloadType": "date",
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": 0.1,
    "x": 2240,
    "y": 1600,
    "wires": [
        [
            "576e047.81b677c"
        ]
    ]
},
{
    "id": "e2304571.2a12c",
    "type": "change",
    "z": "1d722e3f.ef985a",
    "name": "decrement (1)",
    "rules": [
        {
            "t": "set",
            "p": "decrement",
            "pt": "msg",
            "to": "1",
            "tot": "num"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 2640,
    "y": 1600,
    "wires": [
        [
            "b2b242d8.a3bcd"
        ]
    ]
},
{
    "id": "ef9c361d.e3f6d8",
    "type": "inject",
    "z": "1d722e3f.ef985a",
    "name": "power > 10",
    "topic": "",
    "payload": "",
    "payloadType": "date",
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": 0.1,
    "x": 2230,
    "y": 1540,
    "wires": [
        [
            "3d561eae.03a35a"
        ]
    ]
}

]

Here the same msg.reset node is being to reset a delay timer and a counter - so kind of illustrating the utility of msg.reset depending on the situation.

2 Likes

Thank you for the examples!
Clearly I have so much more to learn.. :exploding_head:

1 Like

You're welcome. Thanks to you, I use sendmail for all my notifications (SMS) even with NR. Would never have installed sendmail if you hadn't written a Hubitat integration

1 Like