Node-RED nodes for hubitat

@Guffman Can you post example of node? I am not following. Thank you.

Use the ‘change’ node from the palette section ‘function’. That node allows you to set a msg property to a value. I’d screenshot this but can’t access my home stuff now.

I thought that is what I was doing. I must be making another newbie mistake.

Hi Guys,

can I please get help with this?

Thanks

Edited: I was already on 0.0.14 when I installed the pallet.

Doesn't really matter right now. Once there is a location/mode block type it will be useful, though.

Status events would come out of the DEVICE node, not the COMMAND node. Assuming that the device in question is in Maker API and that the Maker API events are successfully making it to your node-red instance, of course.

So add a hubitat device node to your flow for that device.

thanks @JasonJoel,
I've done the following and I'm still not seeing any output on the debug for the device.

image

I've also tried ticked and unticked on the send events under the device, still a no go.

I've checked and the device in question does exist in Maker API and has device ID.

How can I see/check if the events have successfully making it to my node-red instance?

The only way to tell if events are making it is that they will start spitting out from the device node.

Are you sure your Maker API post url is configured correctly on the Hubitat side?

Edit: looks like it is based on your screenshot.

Is this a full node-red install, docker, other? Anything else running on the box you are running node-red on that could block it (firewall?)?

Hi Jason, it's docker version of Node-red. I can turn devices on or off which I believe that tell us that the comms is okay, correct?

maybe I got the wrong end of the stick here.....since I'm quite new with node-red.
the way that this flow work in my head is that, if I stick a debug at the end of the device, once the timestamp is clicked, I should be getting the "output value" of what the device has received.
so if I specify to turn a device off, that I should see somewhere within the payload that it has "off" in the value.

What I'm trying to achieve is a simple device toggle. (as I cannot see an option to toggle). I was trying to create a flow/logic where if the device is off, to turn it on and vice versa.
if you have an example for this, it'd be great if you can share it out?

Edited:

I'm trying to get my head around node-red, eventually, what I am trying to aim for is to use node-red to get power value of one of my tasmota power plug, to then send a notification via google hub.

by the way, I'm getting this in the logs when restarting node-red

I couldn’t get it working with a Docker version of NodeRED either. The POST command wasn’t received. I am not sure if this is a code or NodeRED problem. Maybe the code is binding to the Docker internal network IP ?

I successfully use the docker version of Node-Red on my unraid server..

But I do think that some environments may not let direct container traffic without proper/additional configuration.

It all depends on how it does the docker network setup and any ip tables config...

I directly bridge my container network adapter to a physical nic, so have fewer connectivity issues than using the host bridge networking would have.

Well that’s good news Jason, I haven’t played much as I have a non Docker NodeRED install too. My Docker version has (I believe) the hosts option set. Any idea what else I could tweak ?

Ahh you added some extra info above.. thanks. I’ll probably stay with non Docker at the moment as I’ve got another project that takes a lot of time :wink:

Thank you, is very nice to see the community to contribute !! :smile:
For others, we are discussing on the PR thread and there are no real blockers. It should be available soon

Sure, my production installation is on docker behind a nginx proxy and Hubitat is also behind this nginx proxy. My Hubitat and NodeRED talk to each other only with their DNS name (and with a Let's Encrypt wildcart certificate) :grin:

Otherwise when I develop, I use this simple docker setup:

docker run --name nodered-hubitat -d -v /<your-path>/node-red-contrib-hubitat:/tmp/hubitat -p 1880:1880 nodered/node-red
docker exec -it nodered-hubitat bash -c 'npm install /tmp/hubitat'
docker restart nodered-hubitat  # When I update the code

On my Hubitat I have set the post URL to : http://<ip-of-the-docker-host>:1880/hubitat/webhook
I also have ip forwarding enabled (net.ipv4.ip_forward) which I'm not 100% sure if it impact for this case.
And I'm running on ubuntu

Can you post the command you use to start the container and your environment (OS)?
If you use docker without host option, you need to set the IP of the docker host and don't forget to forward the port between the container and the host (option -p)

You can set as string if you want, the node should not care. If you have two arguments, you will need to have string

Do you have enabled NodeRED authentication?
I still have not tested how to configure Hubitat with a password protected NodeRED
If you run on docker, you should see a lot of output about all initialization and callback from webhook events

This is exactly the example of the first post :slight_smile:

1 Like

Here's a quick example of what you should be seeing in your debug window.


This assumes you have your command configured correctly.

05%20PM

Yes I have set it with a credential secret and I have also disabled SSL for now --> is this what could be causing the issue?
Did you set node-red docker in bridge or host mode?

yeah, that's what I'm trying to implement. but failing so far :laughing:
I can't seems to get the expected output based on your first example. Feel like chasing my tail here, but looks like the node-red secret credential could be the culprit here.

Yeah try to disable it. In your screenshot if the 401 is the response, then it's a unauthorized error
I use docker in bridge mode only

1 Like

Thanks @vettester, that's what I'm trying to get.
I did the same as what you have on my device but I'm not getting much on the output payload.

I'm going to create another node-red container based on @fblackburn recommendation. will let you guys know how I go. Cheers

Thanks @fblackburn, I've disabled the secret credentials and I can now see lots of output of webhooks on the logs container. :clap: thanks to you!

However, I'm still not seeing anything on the payload.
any ideas?

oh wait a sec!...
I can see it now!!!!

how come?!?!?! :thinking:

EDITED: BLOODY SEND EVENTS box wasn't Ticked!

3 Likes

Glad you got it all working!