Clash between Hubitat and Lovelace

I started having problems with node red and Hubitat recently. I noticed that when I restarted the HA core, node red was broken.

After experimenting a bit I discover that when the core is restarted the Maker API Post URL was getting set to a seemingly random port number. Simultaneously I was trying to figure out why Lovelace dashboards were working fine upon the restart and would misbehave if I restored the webhook for node red.

Turns out that I confirmed that lovelace is using the Maker API Post for its own purposes and is overwriting the node red URL. I can readily use either but not both.

I suppose the simplest solution from a Home Assistant point of view would be for the Hubitat Maker API to accept multiple URLs. I'm currently thinking about making a flow that "discovers" this problem and restores the URL for node red and to receive and forward all events to the lovelace URL in the same format they are received from Hubitat. I suppose the first issue is whether the event objects received by node red are exactly as sent by Hubitat or have been manipulated before the application gets them.

I'll be experimenting because I would like a working lovelace interface without breaking my automations in node red. The sticky point at the moment is uncertainty about whether there is a race condition for multiple integrations initializing the URL or if it is deterministic. Currently it SEEMS deterministic, and that I can use the existing URL to forward all events to lovelace.

Any suggestions or solutions already implemented?

If I understand correctly, you're using Node-Red and Home Assistant from the same instantiation of the Maker API? That is, both applications are using the same Maker API application?

If so, you need to have multiple Maker API Apps on your Hubitat, one for each dependent system. They'll each get their own unique application number. Here's a view of mine:

2 Likes

Thanks! I'll give that a go.

Having a separate maker api instance for each consumer is good advice.

2 Likes

That solved my problem.

Thanks!

3 Likes

I saw your previous comment. Your comment didn't really address my issue, as it would have still been an issue with two clients talking to the Hubitat hub.

I hadn't really considered trying to run node-red standalone as my focus was on Home Assistant and working from instructions I had available and previously working.

Given your comment, I revisited and confirmed that I can install Node Red without HA and access the hub the same as before. I'm considering moving to this approach.

I deleted the comment as it was somewhat off topic, and to your point the real fix was multiple maker api instances.

NR inside of HA can work, and often works, but I help people all the time work around issues in that install. It just isn't worth it in my OPINION versus a normal/supported NR install outside of HA.

Download the Hubitat app