Http api actions to devices in HA

Hi All,

is it possible to do a http request to enable a boolean switch for example?
I want send from a ESP Device rule a action when the ESP is turn on

Then it will turn on the boolean also in HA

If you were using ESPHome then you would get this behaviour with the status sensor which appears as a binary sensor in HA - on when connected, off when disconnected:

https://developers.home-assistant.io/docs/en/external_api_rest.html

But there Is not a http link thats it? always must use the curl?

this is example how domoticz do it. Everything in 1 http url:
http://127.0.0.1:8123/json.htm?type=command&param=switchlight&idx=99&switchcmd=On

or how about:

Publish domoticz/in,{“command”: “switchlight”, “idx”: 880, “switchcmd”: “On” }

this is example of Domoticz, can I do something like this?

In your original post you did not say which firmware/code you’re using on your ESP, so I was just suggesting that ESPHome has this capability built in.

Have you read the doco that @flamingm0e linked above? It’s all explained there.

Yes read everything. But seems there is no single HTTP link that can be used to turn on a boolean switch, or turn on a device (entity_id)

I think you maybe missed this

https://developers.home-assistant.io/docs/en/external_api_rest.html#post-api-services-lt-domain-lt-service

Seems like you didn’t read my link at all. It’s literally on that page.

I read your link… also new in this.

Im now created MQTT Switches and from ESPeasy module i do publish action in rules now.
Work. So you helped me the right way