Change Switch to Light?

I am a bit confused about the difference between lights & switches.

I have a BN-SZ01 light which I can trigger with a URL from a browser like this:
http://192.168.1.14/control?cmd=PWM,12,0 - this turns the light on.
http://192.168.1.14/control?cmd=PWM,12,100 - this turns the light on dimly
http://192.168.1.14/control?cmd=PWM,12,1024 - this turns the light on full

I can get ths working fine as a switch with on & off:

- platform: command_line
  switches:
    office_light:
      command_on: "/usr/bin/curl -X GET http://192.168.1.14/control?cmd=PWM,12,1024"
      command_off: "/usr/bin/curl -X GET http://192.168.1.14/control?cmd=PWM,12,0"
      friendly_name: Office Light

but there is no dimmer capability.

Is there a way I can change a command line switch to a command line light instead?
What I would like is a dimmer slider & on/off capability.

1 Like

Have a look at the template light, I’m pretty sure it’s possible, but I don’t have any example for your specific lamp:

1 Like

A switch is On / Off - if you want anything else like brightness, color, etc - you’ll want to use a light.

Hi kylerw, do you know any way to do that with command_line feature?