Controlling ZHA lock on one Home Assistant instance from another using MQTT

Hi,

Apologies if this has been brought up before, but I can’t seem to figure this one out.

I recently picked up a Yale YRD220 lock with a Zigbee module and Raspbee hat that I want to add to my Home Assistant setup. Due to Bluetooth constraints and my main Pi having its hands full, I thought to add the Raspbee hat to a separate Home Assistant instance on a second Pi.

I set up the lock with the second Pi using the ZHA component, all of which went smoothly.

Now I wish to control the lock from the main Pi. It seems that this is best done though MQTT, so I have set up a broker and both Home Assistant instances have their integrations set up with it.

Now for the part I can’t quite figure out. I want to send a command message from the main Pi to lock or unlock the door. Something to the tune of:

home/frontdoor/set -m "LOCK"

What I can’t figure out is how to set up Home Assistant on the second Pi to act on this message and map home/frontdoor to the Home Assistant entity of lock.yale_cap_xxxxxxxx_x_xxx.

Any help will be much appreciated.

Thanks,
Michael

To answer my own question:

Set up MQTT automations on the Home Assistant instance connected to the Zigbee lock.

  • home/frontdoor/set with payload lock calls the lock.lock service on the lock.yale_cap_xxxxxxxx_x_xxx entity
  • home/frontdoor/set with payload unlock calls the lock.unlock service on the lock.yale_cap_xxxxxxxx_x_xxx entity

Then set up an MQTT Lock on the main Home Assistant instance with command topic home/frontdoor/set.

Works pretty well!