Combine switch with brightness into light object

I have a treatlife combo light and fan switch that I’ve flashed ESPHome onto. It has a switch that controls the light, and a number value that controls the brightness setting.

How can I combine these two separate items into a single light object so I can use the standard light card to control both the light being on/off along with its brightness setting?

You should be able to do this in ESPHome with the Monochromatic Light component rather than using a switch and a number.

I think I’m missing something here, it looks like the monochromatic light is always on but varies the brightness so 0 has the light “off” by being to dim to see and it becomes brighter the larger the number.

I still need to use switch to turn it on/off and then a separate brightness value. For some reason I hadn’t thought about looking at the ESPhome side of things, I’ll read more on that side to see what obvious thing I’m missing, lol.

It’s in the light domain. it will also have a switch associated with it.

1 Like

I found it, thanks. I don’t know why I had a complete and utter brain fart there :man_facepalming:

This is for the treatlife DS03 for those interested. I’ve seen some existing config files for the DS03 and ESPhome, but for whatever reason I noticed that my pinout information is different. It could be things changed, I’m not 100% sure, but here’s my relevant ESPhome section for the light and the fan.

light:
  - platform: tuya
    name: $friendly_name Light
    dimmer_datapoint: 6
    min_value_datapoint: 105
    min_value: 10
    max_value: 1000
    switch_datapoint: 101

fan:
  - platform: tuya
    name: $friendly_name Fan
    switch_datapoint: 1
    speed_datapoint: 3
    speed_count: 4