How to get Node Red to see a switch change in HE as it happens?

I'm just getting started with Node Red to do some things that have been kind of kludgy with HE (like trying to get Xbox on/off control, and some other device that I haven't had much luck with using community made drivers like my LG TV).

I seem to have both sides working on their own but not sure how to flip a virtual switch in HE and have Node Red just see it as it happens and then inject that into a node.

I have Maker API configured using the recommended settings for use with Node Red. And I have the virtual switches I want to get the states from checked in Maker API (and they show up on Node Red in the HE device node).

I have Node Red server running on a Raspberry Pi and I've installed and configured the nodes for Hubitat and Xbox. I can make a flow that injects commands to the Xbox and it works within Node Red. I can add Hubitat nodes like device and get the current states of switches.

But whenever I flip a virtual switch I don't see the state change in Node Red. My HE setup is to use Virtual Switches that have 2sec return to default set as I use them like buttons. So I just need to figure out how to get Node Red to pickup the state change as it happens so I can turn that into an "on" or "off" string depending on the switch that was flipped in HE.

How do I set that part up? Preferably in laymans terms since I've only got a days experience with Node Red.

Send events is what tells the device node to start a flow.

2 Likes

Also, there will be an indicator below the node to show whether that check box is checked. The blue box is solid if checked, hollow if not checked:
image

I can't tell you how many times I have had that checked when it shouldn't be or not checked when it should be.

I am pretty sure that checkbox was checked by default when Device Node was created but has changed but I could be crazy.

3 Likes

Correct. I hate that change and complained at the time, but I lost that battle. :slight_smile: Not the end of the world though.

3 Likes

I love that change now that I noticed it. :grin:

1 Like

Also make sure your HE configuration in Node-RED is set up properly.. particularly the webhook bit..

1 Like

I hate it when ANY default changes after I'm already used to it being a certain way.

2 Likes

Did that happen with 1.6.2? I'm still on 1.6.1 and the default is checked.

So when I wrote this post it wasn't working and I was using my HE phone app to flip the switches while looking at the Node Red screen and they wouldn't change.

Came back from lunch, checked out everyones reponses and I did have everything set as suggested. Tried it again and the button states are changing as I flip them in my HE devices screen. Either I was spacing something out or it worked itself out while I was at lunch.

I'm pretty sure I had the webhook configuration done the first time since I was getting the initial states to show up. But I did click it a 2nd time to double check I got the green checkmark.

3 Likes

No, thought it was way before then.

I'm using the same maker api instance. Wonder if it only applies to new instances.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.