I have a master instance of home assistant running on Ubuntu and another instance running on a raspberry pi that is used to control my garage doors.
I’d like to connect these together so I could control everything in one place, but have been unsuccessful so far. I’ve tried the master/slave setup found here and in a few posts with no luck. I’ve read some about using mqtt to talk between the two instances but have not found examples complete enough to put this together.
Is there anyone out there that has two instances talking that could share your config with me?
I used the Eventstream Component to connect using MQTT. This works OK but sensors only show for short period.
I am currently looking for a better method.
I have HA running on RPi and inside docker container.
I use a seperate MQTT broker to ensure broker availability.(if it runs on HA server connections problems happen when rebooting)
I can share component and broker config details later.
I have a Mqtt broker running for my smart things bridge, so I think I’m good there. Seeing how you configured the mqtt components between the two instances would be great.
I found that when I brought up the web interface, my motion and door contacts connected to GPIO on Raspberry pi didn’t show. Same for 1wire temp sensor. Motion/Door sensors only show after being tripped and would disappear afer about 5-10minutes if no change. This is good enough for automation but not idea for checking status or history.
I decided to use Template Sensor to make eventstream sensors persistant. I named Template Sensor on Synology, same as eventstream sensor coming from RasPI.
- platform: template
sensors:
###################### LIVING ROOM MOTION #############################
living_room_motion:
value_template: >-
{% if is_state("binary_sensor.living_room_motion", "off") %}
off
{% elif is_state("binary_sensor.living_room_motion", "on") %}
on
{% endif %}
friendly_name: 'Living Room Motion'
sensor_class: motion
entity_id:
- binary_sensor.living_room_motion
######################### ROOM MOTION #############################
room_motion:
value_template: >-
{% if is_state("binary_sensor.room_motion", "off") %}
off
{% elif is_state("binary_sensor.room_motion", "on") %}
on
{% endif %}
#friendly_name: 'Room Motion'
#sensor_class: motion
entity_id:
- binary_sensor.room_motion
you will notice Friendly name and sensor class commented out for second sensor. I previously set these sensors up in customize.yaml and friendly name is passed from RasPi, so I decided to verify if that would be enough. It was. It is slightly cleaner to add this on template sensor but I preferred the icons i used for motions
NOTE:
I did not intend to name sensors on both RasPi and Synology the same. After trying to get it work other ways I found out by accident that this works and was kind of nice. I am not sure if this is idea or correct so I am currenly looking to verify that .