Node-RED nodes for hubitat

For those who use the alexa.remote2 node...
Does that mean, you no longer need the Amazon echo skill app in HE as everything is handled via the NR nodes?

so a basic flow would be:
On device activity > Switch node to listen for phrase > HE command node..

I have finally got this working for Australian accounts (for now) so have lots to play with now
Cheers

Even the developer has two warnings.. and hasn't updated in over a year so yes... looks bad.

When a broker connection node is configured to persist incoming messages, the messages can be corrupted. We recommend only configuring outgoing persistence for now.

I expect it can only run so long storing messages before it runs into trouble.

Correct...

I will look at this closer.

Really starting with the standard mqtt nodes, it shouldn't be THAT hard to add initialization and caching. There are plenty of caching nodes out there (up to and including Francois' excellent Hubitat ones) that can be used as a reference.

I might take a stab at it. I have no doubt that I could do it and "get it to work"... Where my skills falter is doing it "properly", implementing unit tests (no idea how to do that in this environment), etc.

Oh, and I can confirm that. lol. With high message and topic count it completely dies after a while.

1 Like

Thanks :+1:

I may quote this again later !

Thinking about this it's likely only a few incoming payloads need caching - either at connect or on event. If the solution handled individual or wildcarded topic subscriptions that would cut down the data. Probably the existing solutions implemented this anyway.

Fair enough - and you are likely right. :slight_smile:

99% of the work is in the config node to make a list of all topics used in all mqtt-in nodes, fetch retained value/build cache on initialization, and update cache on topic updates.

Would need to update the mqtt-in node as well to allow for incoming msgs to send out cached value. This is actually where it could get tricky... Support wildcards, for instance?

I'll add it to my future to-do list to at least make a quick hacky attempt to see what things I hadn't thought of that may make it a royal pain in the arse..

As all of the MQTT connections and topic handling mechanics are already handled in the base node, that helps a lot.

Wouldn't your 'professional' use of Node-RED make this something your company would sponsor ? I can see it being very useful to them.

Maybe. Good point, as it has come up before in that context... The rub there is they don't like me to open source internal development (usually). Might be worth an internal discussion, though.

Linking to a post on the Developer section. I was looking for feedback on my first Node Red endeavor... TIA

You could request device event history from the Maker API.. and maybe parse/store those. Might have to play around with deduping.

http://[HE url]/apps/api/[maker instance id]/devices?access_token=[the access token]
http://[HE url]/apps/api/[maker instance id]/devices/[Device ID]/events?access_token=[the access token]

To do a dump just http request a list of devices then a split node which creates separate messages for each device then another http request to grab each devices event list...

Something like this maybe:

Not something you want to run too often.. note the "random" delay node is a random delay per request so as not to spam the HE hub. The devices you want to record history for should be added to the Maker instance.

1 Like

@erktrek - is this any better than just subscribing to the events using the Node-Red/Hubitat API?(node-red-contrib-hubitat (node) - Node-RED)[node-red-contrib-hubitat (node) - Node-RED]

I have that working and am able to filter out the events that I want to log and discard those that I don't need...just curious as to why the http request would be needed.

I would probably do it the way you are doing it, or something pretty similar. There are lots of ways to do it, though.

2 Likes

Yeah I think you are correct that seems like a better approach. I had just been working on parsing some info from Maker outside of the Nodes when you posted so was in that frame of mind :laughing:- when you have a hammer ... :hammer:

1 Like

Alright folks I have jumped in both feet! I am desperately looking for examples to do advance lighting control. Either here or examples on other community sites. Can someone direct me?

1 Like

There are a ton of examples posted in this very thread.

If you give some specifics on what you are trying to do, someone may have something close to post as an example.

on a thread with 2700+ posts, it is nearly impossible to find anything on this topic at this point

Someone should probably start a new thread for flow sharing.

1 Like

Agreed. Thus the request that they just explain what they are trying to do. :slight_smile:

Last week I spent like 45 mins hunting for one of your examples and came up empty... i can't even remember what it was at this point but I found a different route to take