How do actors communicate with HA

Hello there,

I hooked up an ESP via a proprietary protocol to an actor to be able to control it from HA. The ESP is online in my IoT network via WiFi.
Now I don’t have the slightest idea how to communicate with HA, i.e. let the user send commands and get back status messages. If possible I don’t want to come up with an own protocol and writing my own integration.

Regards,
Reah

I am not familiar with the actor programming model. HA has esphome as a way to configure esp devices. If the actor model supports mqtt that may be a way to go.

Generally the pattern is that you add entities (switches, PWMs, et cetera) to your ESPHome device, and then you may also program the on_X events on the ESPHome entities, to cause diverse outputs in the ESPHome device.

E.g. you have an LED output pin and you want this to appear as a variable intensity light in the HA interface:

output:
  - platform: ledc
    pin: GPIO4
    id: gpio_4
    channel: 2
  - platform: gpio
    pin:
      number: GPIO33
      inverted: true
    id: gpio_33

light:
  - platform: monochromatic
    output: gpio_4
    name: Camera LED
    icon: mdi:flash
  - platform: binary
    output: gpio_33
    name: Status LED

That’s all that is needed for the GPIO pin to appear as a dimmable light.