Use an entity from home assistant instance 2 to another instance

Hi, I’ve got 2 home assistant instances running and are accessible by the Internet.
Is it possible to expose one entity and automation by the other instance?

So for instance I’ve got an entity named ‘remote.22_philips_uhd_android_tv’ on home assistant instance 2
I would like to control that entity on a card in home assistant instance 1.

Thanks for any suggestions

I do not think it is possible directly (perhaps using some MQTT trick). So I’d go for webhooks integration. E.g. on instance 1 pressing the button on card would trigger webhook send to instance 2. On instance 2 there would be automation responding to this webhook, that would interact with your remote.

Look at Remote Home-Assistant in HACS.

For a single entity I would recreate it in second HA instance using the HA API and template integration

All other methods will try to access everything on the other instance and be more complex ultimately.

EDIT

Command line not template

A webhook might work. The automation can pass data and a variable to a webhook that can be recievec by the other instance.
MY vacation home informs me when there is something on the camera to look at, for instance. It pings me, I go to the camera feed. That’s driven by a webhook along with the camera to look at.

person_detected:
  description: "Person Detected so Notify Home"
  trace:
    stored_traces: 10
  fields:
    message:
      name: Message
      description: This will set the message
      required: false
      example: "My person's lost"
      selector:
        text:
          multiline: true
          type: text
  variables:
    # Define variable data and provide defaults 4 your system)
    message: "My person's lost"
  sequence:
    - action: shell_command.person_detected
      data: { "message": "{{message}}" }
    - action: notify.message_dad
      data:
        message: "{{ message }} movement"

This is the shell command:

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