Possible to make a "dummy" light entity?

I’m looking for a way to control the backlight value of a Nextion display connected to an ESP via ESPHome.
I think I can do it with something like:

it.send_command_printf("dim=%f",id(screen_backlight_value).state);

But I need the entity “screen_backlight_value” to exist in HA before I can do that.
I assume Template Light is the way to go but I see that turn_on/turn_off actions are required and I don’t know what those would be.

Any thoughts?

turn_on/turn_off can just be a dummy script.

I do it with these:

3 Likes

Or you could use an input_number if all you need is a value for brightness

In esphome config for that nextion I used:

switch:
  - platform: uart
    name: "nextion.dim1"
    data: 'dim=1'
  - platform: uart
    name: "nextion.dim20"
    data: 'dim=20'
  - platform: uart
    name: "nextion.dim100"
    data: 'dim=100'
  - platform: uart
    name: "nextion.dimsave"
    data: [0xFF, 0xFF, 0xFF]

This way I have 4 switches in hass and via node red I set (just a example):

Dummy light