Maker API with multiple Node-Red installs

I have two Node-Red servers and I want Maker API to post events to both instances but can only make one instance active at a time.

Is there a way to make Maker API to post to more than just one?

On the Node-red server(s) I am using node-red-contrib-hubitat v1.9.0

I've tried entering "http://xxx.xxx.x.1:1880/hubitat/webhook, http://xxx.xxx.x.2:1880/hubitat/webhook" for the URL

and also tried;

Two installs of Maker API with the unique URL for each Node-Red server

The recommendation is normally

The normal recommendation is one Maker instance per destination, so this :point_up:.

1 Like

I installed two Maker API as a test but it didn't work so I am back to one. Thanks

Is each instance of Node-RED on a separate server or on the same server with different ports?

EDIT:
I used to run to different servers when I was starting with Node-RED (one live and one test) but have since shut the test instance down. It used to work perfectly

2 Likes

Two separate servers, two unique IP address running Node-Red but on the same port.

FWIW, I used to have 2 MakerAPI integrations from each of two hubs going to the same Node-RED installation. Everything worked.

1 Like

Out of curiosity, and if you remember, were you using the same access token on each instance of maker API, or did you create a new token on the second one?

For the 2 separate instances of Node-RED, separate access tokens for each instance.

EDIT: Does each of your configurations work when the other is disabled? (eg. MakerAPI instance A -> Node-RED instance A works when MakerAPI instance B -> Node-RED instance B is disabled and vice versa)

1 Like

Did you have 2 different HE configuration nodes on the Node-RED side and 2 different MakerAPI access tokens?

1 Like

I am running both together but was using the same access tokens. I really didn't like the idea of running two Maker API apps and only did so thinking that I could pass events to two separate Node-Red servers. It looks like Maker API was only designed to work with one. Because I am running two Node-Red servers I can accomplish what I need to do by using one server getting passed the hub event and then use node to forward that event to the other server using the http in node.

Yup

1 Like

The configuration in MakerAPI has the IP address of the server that the events are posted to, so the message is sent to a specific IP address. If you need to have messages published to different IP addresses, then you need to have separate instances of MakerAPI.

I'm not sure what the downside is. I run 2 instances (1 for HomeBridge and 1 for Node-RED) and have not seen any issues. When I was running another instance of Node-RED, having 2 MakerAPI instances allowed me to publish events for different selected devices to different Node-RED instances.

That is one way of doing, I guess. Though two instances of MakerAPI are essentially doing the same (posting to two different URLs).

2 Likes

I'll revisit the idea of two Maker API at a future point in time. It sounds like my problem was related to using the same Access Token on both apps that confuses the code. Thanks

1 Like

I've been trying to follow along because I also have two Node Red instances, although I only have one connected via Maker API and node-red-contrib-hubitat. After re-reading the thread I'm confused.

If you're not using two Maker API instances, then what are the two apps that were using the same access token, but are now using different access tokens? Were you connecting one hub to two different Node Red instances, or two hubs to one Node Red instance?

One hub to two separate Node-Red servers on two computers all at the same time. I have not verified that having two Access Tokens on two running copies of Maker API will work, but others claim they have made it work. I had made several attempts but couldn't get it to work, but, I had not tried assigning seperate Access Tokens. That may work, or may not.

The reason I am trying to do this is there are unique command setting on each PC that cannot be done remotely hence using Node-Red on those local PC's to perform those functions.

Why are you assigning access tokens? A token should be generated automatically for each MakerAPI instance. That token is specific for that instance of MakerAPI. Changing the token to the token created for another instance of MakerAPI will lead to situations where the two instances cannot be distinguished.

Looking at the two installs of Maker API do have separate Access Tokens. when I looked at the tokens I mistakenly thought they were the same but looking closer they are, in fact, different. Thank you for pointing that out. I had been screwing around trying different things but never got it to work sending events to two separate Node-Red servers. It's either one or the other.

At any rate, I have accomplished what I set out to do only a different way. Thanks to all that provided feedback. For those that have accomplished what I originally was trying to do, maybe post the steps you took to achieve it so others can learn from it. Thanks

2 Likes

To all that helped me try and figure this out, Thank You!

Trying to figure this out has had my wheels spinning and I finally figured out what the problem was. On the second Node-Red server I had neglected to change the application ID to the second copy of Maker API. I had it set to the first copy. Duh! Brain fart!

Anyway for others looking to do what I attempted, make sure you properly set the Access Token, and also the Application ID to Node-Red's Hubitat Node. :blush:

5 Likes

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