Value from another home assistant instance

Hello Every Body
I have two instance onf Home assistant one on Raspberry pi4 (server 1 10.0.0.72)and one other on docker Nas Synology (serveur 2 10.0.0.70)
My goal is to get the information about sensor (Zigbee on Deconz) on server 1 to the server 2. I found this integration :

I have make 3 tests
On server 1 i have this sensor : sensor.couloir_temp zigbee device xiami Temperatur and Humidity in this case sensor for temperatur
On Server 2 I have add this code in the Configuration.yaml

   ############################################################
   ##                                                                                                                ##
   ##                     Sensor rest home assitant Pi                                             ##
   ##                                                                                                                ##
   ############################################################ 
    
  - platform: rest
    resource: http://10.0.0.72:8123/api/states/sensor.couloir_temp
    username: (login of session on server1)
    password:  (password of session on server1)
    name: test1
    value_template: '{{ value_json.state }}'
    unit_of_measurement: "°C"
    
  - platform: rest
    resource: http://10.0.0.72:8123/api/states/sensor.couloir_temp
    name: test2
    value_template: '{{ value_json.state }}'
    unit_of_measurement: "°C"   

  - platform: rest
    resource: http://10.0.0.72:5000/sensor
    username: (login of session on server1)
    password: (password of session on server1)
    authentication: basic
    headers:
      User-Agent: Home Assistant
      Content-Type: application/json

On server 2 I have two sensor (sensor.test1 and sensor.test2 with value unknow)

On server1 I have this notify :
Login attempt failed
Login attempt or request with invalid authentication from 10.0.0.70

When I restart server 1 value of sensor in server 2 change from “unknow” to “unavailable”

Some one can help me ?

I went down this path a few years ago, there is event stream and statestream. To be frank I run around 3 instances plus a few stand alone at my place and the best tool for syncing data across them is Node-Red.

I think you need something like this, where LLAT, where LLAT is your Long lived Access Token

- platform: rest
    resource: http://10.0.0.72:8123/api/states/sensor.couloir_temp
    name: test1
    value_template: '{{ value_json.state }}'
    unit_of_measurement: "°C"
   headers:
      Authorization: 'Bearer LLAT'
      Content-Type: application/json

image

2 Likes

Hello Thank you very much FrancisP
It’s Wirking with sensor T° Pression and Humidit, but i don’t find now how to use binary_sensor and light

Find for motion just add
device_class: motion
and place it in binary sensor for motion

Hello Can you explain how to do? do ,you have 1 node red server or more how data is send frome one server to an other ? Thanks

You can connect multiple ha to one node-red instance. From there it’s up to you how you wish to get the data I use mqtt but there are many options to do it.

on the web do you know a good how to ?