Best way to use 2 different switches to turn on a third device without HA automations

Hello,

I’m trying to turn on a light with a relay from 2 different rooms using esphome with HA API.
So I have 3 devices, one with the light bulb that i might toggle and other 2 devices (switches) in different rooms with binary_sensor connected that act as a button.

I was wondering what could be the best practice to use to turn on the light from each different device, without using HA automation, but esphome.

As far as I understand, I must use the homeassistant.service. Is that correct or are there other ways?
thank you!

If you activate the web server on the light device, you get a rest api, which you can activate with a http request on the button device.

1 Like

and

1 Like

That’s interesting and could be a solution if

homeassistant.service would not let the light turn on if HA os is off.
What will be their behaviour with HA offline?

Dunno, it wasn’t what I was suggesting.

1 Like

yup but I should disable SSL because of esp01 devices used for the button input.
It’s still a good workaround.