Generic ESPHome Sensor

My use case is as follows:

ESP8266 with four buttons connected (up, down, left, right) and an LED screen. One light in a room.

I want to somehow create three sensors in ESPHome ([int]brightness, [int]colour temp and [bool]on/off) which can be sent to Home Assistant as entities. There will be an automation in Home Assistant which will update the lights when those entity values change.

It could be done by connecting Five buttons (on/off, brightness up, brightness down, colour temp up and colour temp down,) but I don’t want to do this because

  1. It doesn’t allow for me to add or remove entities to the config and display as required.
  2. There will be a lag from when I press a button to when the display is updated (has to go via Home Assistant and get the lights entity values).

This seems like a really basic and useful feature. Is there a way of doing it?

Yes. Start here:

Have your sensors set up as template sensors, exporting global variables that are adjusted via automations on the buttons. You’ll probably want a variable to record what state you’re in (e.g. which variable is being adjusted).

Start basic, and build from there. Good luck! Pics and code when you’ve finished.