Node-RED nodes for hubitat

Me too. All is working still with the latest hub ver for me.

Thanks @JBrown, I'll give it a go when I'm in front of my laptop later. Cheers

This should be straightforward but I’m doing something wrong.

I’m trying to do Boolean logic using node-red-contrib-boolean-logic-ultimate.

This is the flow I'm using:

I want to get a message based on the state of two lights (Attic and Kitchen Wall). I’m using AND. So if they’re both on, I should see true in the debug node connected to the Boolean node (I'm using the AND gate).

I’m converting the light state using this function into a Boolean true/false.

49%20PM

When I connect a debug node directly to the function nodes, I see msg.payload.boolean is set to true or false based on when the light is on or off.

15%20PM

But I see no output in the debug node connected the Boolean node. I think the Boolean node is configured correctly (below):

Why am I seeing nothing? Is my true/false conversion wrong? Should I be using 1/0 instead?

Your not seeing any thing because the Hubitat node does not produce a topic.

1 Like

I thought choosing "All topics" covered that because it works when I use an inject node that has a topic of "". But I guess it needs the topic field to be populated?

When you look at the debug is there a topic?
You can add a topic with the function node.


Here is another way of doing it.

1 Like

@JBrown

Thank you so much. I used the first method before I saw the second. It works really well!

1 Like

It would be nice if the Hubitat node produced a topic name that is same as the device name.

1 Like

Agreed. Using your help, I'm just using the generic topic of "Hubitat", which works fine for the case at hand.

For anyone else who needs to add a topic, here's what I used:

msg.payload = (msg.payload.currentValue === "on")  ?  true  :  false
var newmsg = { topic: "Hubitat", payload:msg.payload};
return newmsg;

I have a change for exactly that in my repo (a fork) and I am going to submit a PR on it in a while to get it back into the main branch

3 Likes

Hi All,

in regards to http request, I know that you can send commands with it. But you can get device status with it too right? or am I wrong?
sorry for the newbie questions, that's because I am :rofl:

Is this what you are looking for?

Or a change node. I am fighting ever using a function node. :grinning:

image

1 Like

@aaiyar you need to get this incorporated into one of your flows lol.

1 Like

Presence detection based on vehicle license plate that is parked in the driveway!

2 Likes

Hi @JBrown

Thanks and yes!
I re-read the makerAPI page within hubitat and it is now making more sense. (not sure how I missed that!)
Now, how can I then get the information of the currentvalue of the power using http get request?

Put this into the http request node
http://YourIP/apps/api/YourAPI#//attribute/power?access_token=YourToken
You can test this with your web browser.

Am I correct that the Mode node only reads mode; it can't change it?

I have not tried it, but if I’m reading this right you can.

MakerAPI supports it but the mode node of the NR plugin currently only supports querying and not setting

1 Like