How to make HA notify an HA at a different location

Let’s say there is HA running on HAOS at House #1, and HA running on HAOS at House #2. House #2 has audio notifications configured in HA via sonos or squeezelite, etc.

How can the HA in House #1 notify the HA in House #2 if there is some event (like motion is detected) so House #2 can play a notification on the audio system? Perhaps there is a free cloud-based MQTT service others have used for this? Are there any other ideas that would be very reliable (and hopefully free)?

I think you could do it with Webhooks triggers.

I actually do this with a webhook.

I’m pulling the stuff from the not public repo for the calling process.
A bunch of triggers based on reolink triggers that calls a script:


    - action: script.person_detected
      data:
        message: "{{ trigger.id }}"

and the script action specific to the webhook:


    - action: shell_command.person_detected
      data: { "message": "{{message}}" }

Then the shell_command:

person_detected: curl -X POST -H 'Content-type:application/json' --data '{"message":"I spy a {{message}} person"}' https://hooks.nabu.casa/TheGiantWebHookBasw64StringSameThingIsHere

The message tells me what camera saw it.

1 Like

Do you use a shell command action to “send” or something else?

Yup, I was in the middle of adding that from a private repo.

Webhooks seem great. How can they be used when the HA instances are not on the same network?

These are not eve in the same county. 350 miles apart.

When you set up the trigger there is a configuration variable, local_only, that you can set to false; as shown in SG’s example.

Thank you. Yes, I see that, but I’m assuming some sort of cloud service would still be required, wouldn’t it? House #1 cannot access a URL hosted by the HA at House #2 without port forwarding or a VPN tunnel, correct?

Perhaps you have not read all of this in the docs…

As long as House #2’s HA is accessible from the internet, then you don’t need anything else.

Do make sure to read the “Webhook Security” section in the link I posted previously.

Indeed I have read the docs, and I understand how to set it to local_only: false. What I don’t understand is how an external device can trigger the webhook. Let’s say my HA is hosted at House #2 with an ISP IP of 111.222.333.444 and the HA is hosted at 192.168.0.200:8123. There are no forwarded ports on the router. Is there a way for the external device to trigger the webhook?

I think this is the cause of my confusion. Are you forwarding port 8123 on your router to your HA local IP?

The webhook is generated in the Ha instance that you want to receive the message. It is a webpage at nabu casa with a secret address that you MUST not share to anyone else.
When anything else in the world uses that web address, it does the webhook trigger in your instance and like in my case, passes along some data (if you want it to) and your local HA has to be programmed to do something with the trigger and possibly the data.
So read the docs again with that in mind.

Local only is highly suggested if you can get away with it. It does sorta put a hole in your firewall if you can guess the like 128 character randomly generated address, or if you leak it out…

Oh, so you use Nabu Casa. Ok.

I don’t think the webhook issue has been properly explained, but I think I understand it better now and will do my best, for others who might read this thread.

The docs state that “By default, webhook triggers can only be accessed from devices on the same network as Home Assistant or via Nabu Casa Cloud webhooks.”

It then states that by setting the local_only option to false the webhook can be triggered “directly via the internet.” I interpret this as, by changing the local_only setting from true to false, you have changed the default setting. And, thereby, the true default setting would have allowed access “from devices on the same network as Home Assistant or via Nabu Casa Cloud webhooks.”

This leads me to believe that “directly via the internet” means, directly, with no go-between. So, I suspect that if one were to forward port 8123 to their HA instance (and use SSL, ideally), they could use webhooks.

So, for those who would like to use webhooks between two HA instances on separate networks, they should leave the default setting (local_only: true) and use Nabu Casa webhooks, or they should change local_only to false and expose their HA to the internet via port forwarding.

I do not know how else one could use webhooks between two locations but if someone knows how, please chime in.

If anyone is looking for a free option, cloud-based MQTT brokers seem like a good alternative. HiveMQ looks to be worth a try.

Nabu Casa is a very worthwhile project and might the be the best option overall. It is a paid service, but is supports HA, and that’s a great thing.

Well I used mine for a couple of years before I turned NC on on the remote site, so You can believe what you want to believe.
I have another webhook that I use to ping a streamer in the US Southwest while he is streaming to alert him of a problem during the stream. It turns on a light on his desk… I am in Wisconsin.

With the webhook set up on a HA instance and not set to local only and the HA instance has external access, anyone with the web address can trigger it.

You can set up a VPN peering link between two instances. They can talk to each other. For example, with wireguard.

The webhook can be set up to communicate through the VPN; it is encrypted.

Only one of the VPN endpoints needs to be exposed. I expose WireGuard out of my own home.

I don’t understand why this thread has taken on an argumentative tone. I’m just looking for some help.

If there is a way to use webhooks without Nabu Casa, please let me know. I’d really like to know more.

How do you set up the WireGuard client?