Send value to other HA

Hi All,

Can you send value’s to a other HA running system on same network?
Or read a entity value from a other HA system
I was searching but didn’t find it.

Thanks
Peter

state_stream and event_stream integrations

This is based on MQTT? (googled it) any other way?

Yes, mqtt
In Hacs there is a custom integration to link 2 HA instances, I think called remote homeassistant or something like that

thanks. Let me dig into this

1 Like

I am using curl POST to update the sensor state on the remote instance. I am doing that just to update solar production (power and energy) so that it can be compared.

1 Like

I checked the remote harmony integration. Its to big and not needed.

Do you have a curl example how you did it?
I think this is better… Its just to get the state of a entity into my other HA

Sure. So in configuration.yaml I have this rest command:

rest_command:
  whatevernameofcommand:
    url: http://ipofremoteinstance:8123/api/states/sensor.name_of_sensor_on_remote_instance
    method: POST
    headers:
      Authorization: !secret rest_auth
    payload: '{{ payload }}'
    content_type: 'application/json'

In secrets.yaml I have entry:

rest_auth: Bearer bearertokenfromremoteinstance

I have both instances connected via vpn so I have access to the remote one via http.
Then I have automation to update remote sensor whenever local changes state:

service: rest_command.whatevernameofcommand
data:
  payload: >
    {"state": "{{states('sensor.active_power')}}", "attributes":
    {"unit_of_measurement": "W", "device_class": "power"}}

This works great. only what I needed!