Node-RED nodes for hubitat

I like the "virtual guest presence".. seems like a handy addition.

I use the guest virtual presence when I have guests. That way if I have someone in the house, and the kids are at school / wife and I at work - weird things don't happen in the house to the unsuspecting visitors. :slight_smile:

3 Likes

I started down the "presence" path - trying to forego any 3rd party services like Life365. Tried opentracks OwnTracks but have not really had success yet - I know @aaiyar has. Haven't spent too much time on it though.

1 Like

I use Life360 and OwnTracks.

I had envisioned getting rid of Life360 and just using OwnTracks, but I haven't quite got around to that yet. OwnTracks seems to work fine for me, though - I've been tracking it's performance for months.

I pay $5/month for my cloud MQTT instance in Linode (for OwnTracks)... I should probably start using it, or kill it and quit paying $5/mo...

2 Likes

I've had the opposite experience with owntracks. I find the location jumps around quite often throughout the day by 500-700m. This is often enough to jump from inside and outside of zones. I'm often sitting home and looking at the map and it shows me completely around the corner. Battery drain was also massive compared to the rest. Ultimately after 2-3 months I got fed up with it and took it out.

One solution that has been pretty solid for me has been google maps. I don't think anybody has integrated it into HE yet, but you can share your location to a central account and link that account to your system. It's been as solid as life360 with literally no additional battery drain since google is already doing it in the background if you have maps installed.

2 Likes

I looked into that before... I don't think I am OK with syncing everyone in my family to a single account. But I admit I didn't dig that deep to see how secure/how much segregation between accounts I could have in that model.

I don't know, maybe I'll just stick with Life360 in the end - it would really well for my family. Wish it had a better API / Node-RED integration though. But can always pull it in via HE or HA.

All I am using now for presence is having NR ping my phones every 10 seconds. Super easy, super reliable.
[{"id":"de1eecdb.897b1","type":"ping","z":"84f62daf.d6aa9","g":"106b159d.8621ba","mode":"timed","name":"Dan Phone","host":"192.168.4.206","timer":"10","inputs":0,"x":110,"y":540,"wires":[["3fe6a1b9.9037de"]]},{"id":"3fe6a1b9.9037de","type":"switch","z":"84f62daf.d6aa9","g":"106b159d.8621ba","name":"","property":"payload","propertyType":"msg","rules":[{"t":"false"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":540,"wires":[["1b66d720.a3adc9"],["3092cc34.f83304"]]},{"id":"3092cc34.f83304","type":"change","z":"84f62daf.d6aa9","g":"106b159d.8621ba","name":"true","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":560,"wires":[["1b66d720.a3adc9"]]},{"id":"1b66d720.a3adc9","type":"rbe","z":"84f62daf.d6aa9","g":"106b159d.8621ba","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":510,"y":520,"wires":[["2d1fa2ec.edd39e"]]},{"id":"2d1fa2ec.edd39e","type":"switch","z":"84f62daf.d6aa9","g":"106b159d.8621ba","name":"","property":"payload","propertyType":"msg","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":520,"wires":[["d20da9cb.81af28"],["76aa18ca.74bce8"]]},{"id":"76aa18ca.74bce8","type":"change","z":"84f62daf.d6aa9","g":"106b159d.8621ba","name":"stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":560,"wires":[["d20da9cb.81af28","ab655b0c.07a3f8"]]},{"id":"d20da9cb.81af28","type":"stoptimer-varidelay","z":"84f62daf.d6aa9","g":"106b159d.8621ba","duration":"2","durationType":"num","units":"Minute","payloadtype":"num","payloadval":"0","name":"","x":820,"y":500,"wires":[["3577bc14.405f04"],,]},{"id":"3577bc14.405f04","type":"hubitat command","z":"84f62daf.d6aa9","g":"106b159d.8621ba","name":"Dan departed","server":"83c9a93c.3e4bf8","deviceId":"3030","command":"departed","commandArgs":"","x":1020,"y":500,"wires":[]},{"id":"ab655b0c.07a3f8","type":"hubitat command","z":"84f62daf.d6aa9","g":"106b159d.8621ba","name":"Dan arrived","server":"83c9a93c.3e4bf8","deviceId":"3030","command":"arrived","commandArgs":"","x":1010,"y":540,"wires":[],"icon":"font-awesome/fa-male"},{"id":"83c9a93c.3e4bf8","type":"hubitat config","z":"","name":"Hubitat 1","usetls":false,"host":"192.168.4.40","port":"80","appId":"4988","nodeRedServer":"http://192.168.4.198:1880","webhookPath":"/hubitat/webhook_","autoRefresh":true}]

1 Like

That won't work for me - half the time my wife or kids have WiFi turned off.

Since we have androids at our house we can use Tasker - have just set up a "Send Intent" task to change OwnTracks mode to "Move" and wait a minute then switch back to "Quiet". Can then set up a profile to detect things like WiFi near etc...

https://owntracks.org/booklet/features/android/

But of course now just discovered the "MQTT Publisher Plugin" for tasker so maybe that's even better simpler / more fun.

All I really need is home/away detection..

1 Like

That's nice to add presence logic on device that you don't want to install apps (guest, family, friends) and come often to your place. Thanks :+1:

2 Likes

.
Oh the battle with Alexa rages on! Looks like they killed off the ability to authenticate with a cookie value option that the alexa2 palette offered

Trying to use the "Proxy" method fails as well

I really like this idea. I'd really like to "ping" for MAC address instead of IP for I don't want to set static IPs for all the phones. Is there an easy way to search the subnet for MAC addresses?

Do you have 2fa turned on? I know of some alexa integrations that won't connect properly without 2fa

1 Like

I do not have TFA turned on and it's never been an issue until today

Advanced IP scanner

Another way to slice this is to use DHCP reservations at the router instead of static IPs at the device. I gave up on Static IPs a while back and opted for DHCP for many reasons....

Set it up in one spot and your done.
See all reservation in one spot.
Easily swap out device as they are replaced.
Some devices (phones) can be a PIA to configure, + it messes them up when they leave and cannot connect.
Devices fail and I can never keep all the open/used IPs

just to name a few off the top.

2 Likes

if anyone needs a macOS app to do said scan:
https://debookee.com/

1 Like

I'm just now getting around to setting this up and having the same thing happen to me.

You guys are awesome. I guess we really do need a Node Red section in here @bravenel so we can keep these out of this thread.

Here is what I came up with. Also, very glad I have a spare device to test this on as I'd get lots of looks if I did this in production.

Top(ish) flow is the "not present" flow. If everyone is "not present" then it flows on through and notifies the person who just left that the alarm is on (with a timestamp).

Bottom(ish) flow is "present" flow. If one person is present, then it flows through and notifies the person who just arrived that the alarm is off (with a timestamp). Of course you can add in other things here like unlocking of doors, etc.

The selective notification is what makes this messy - so the more folks you have to selectively notify, the messier. If you are OK with everyone getting Arm/Disarm, then easy enough to strip out.

3 Likes

This also looks promising; presence via ARP (which I was doing on my router using Maker API, but not anymore!). Won’t work for you if folks turn off WiFi, but if you use Combined Presence app, it could be a one-of-many inputs to presence.

https://flows.nodered.org/flow/280e9b116d7fea84ade5

3 Likes

I have a question I'm hoping some folks will have some input on.
I have most of my automations built into custom groovy code in Hubitat but am looking at moving some things to node-red. One thing I've realized is that when you have a dimmable light, if you want to be able to react to the light being switched on and also to a change in that lights brightness, you will always get 2 messages generated from the Hubitat device node. If you just issue the switch on, you get one and if the light is on and you change levels you only get one. But if the light is off and you issue a setLevel to the device, you get 2, one for the switch and one for the level.

How are folks dealing with this? I'm looking at syncing a Hubitat virtual device with a device that I have connected to Node-Red through another system. There are other ways I might be able to integrate with Hubitat but I wanted to explore this one a little deeper before giving up. Thanks!