How to deal with strange light control (brightness translation)

Hello,

I have a light fixture (LED retrofits but with the old transformers still in place) integrated via MQTT into my Home Assistant instance that has a very specific oddity regarding brightness control.
I can send a value from 0 to 100 to the light, but it stays turned off with values below 61. I now want to “emulate” a standard light (brightness from 1 to 100) in the HA frontend and backend so all my existing automations work for this light.

I need to translate the state (current brightness, can be from 61 to 100) I get from the light into 1-100 for HA display, manipulation and storage, then translate commands to the light’s brightness scale (61 to 100) again before sending them.

I have Node-RED running and currently use that for the light control over MQTT so I could wire in any node between the MQTT topics and HA.

Best wishes
Aaron

You should take a look at Template Light. It allows you to create a light entity in HA.

It takes some work (I just looked at the doc page I linked and it really hits you in the face before you even try to read it), but I think it will do what you need, based on your description. Happy to try to help you get it up and running.

I already tried that and the problem is that my light only supports the brightness command, no dedicated on/off command, and is turned off by sending a 0 as brightness…
I do however have an on/off state that I can use…