Best Way to Configure Entity For RF Light using MQTT via Sonoff RF Bridge?

Hey All,

I’ve recently picked up a Novostella Good Night Light (https://www.novostella.net/pages/good-night-light) for my young daughter, she frequently wakes up at some point in the night, and gets a little scared when traversing the landing to our bedroom in the dark.

It has an RF remote, so I figured I could use my Sonoff RF Bridge that has been flashed with the Portish firmware to grab the remote codes, and control it with Home Assitant via MQTT.

I’ve managed to grab all of the relevant remote codes, and confirmed them working via MQTT.

The next step was to attempt to bind these to an entity.

I quickly managed to get a basic Light ON/OFF entity in HA by using the MQTT Light integration, and only setting a command topic with the payload_on and payload_off attributes:

light:
  - platform: mqtt
    name: "Landing Night light"
    command_topic: "cmnd/SONOFF-RF-BRIDGE-1/Backlog"
    qos: 0
    payload_on: "RfRaw AA B0 21 03 08 01CC 0474 2F30 28181909081818190908181818190818181818181818181908 55; RfRaw 0"
    payload_off: "RfRaw AA B0 21 03 08 01CC 0474 2F30 28181909081818190908181818190818181818181818181908 55; RfRaw 0"
    optimistic: true
    retain: true

This covers turning on and off the light ok, but I’ve been unsure how I could go about utilising the rest of the functions of the light (brightness up/down and color cycle are the main ones I’d like).

I had a look at the rest of the available attributes when configuring an MQTT light, and couldn’t marry up the way HA expects those attributes to be configured to the MQTT/RF payloads I have available for each function.

I also took a look at the Template Light integration, as it should be possible to call the MQTT Service to send specific commands with that, but I reckon there’s probably quite a bit of boilerplate required to get it to work, along with a few number/boolean helpers (as the light will essentially be stateless) and I got a bit lost trying to visualise all the moving pieces.

Would anybody be able to give me a shove in the right direction and help me hit the ground running a bit?

For reference, here’s all the codes I managed to grab from the remote, they all publish to the same MQTT topic:

Novostella Good Night Light RF Commands
=======================================

MQTT Topic
------------------
cmnd/SONOFF-RF-BRIDGE-1/Backlog


Light On/Off
-------------
RfRaw AA B0 21 03 08 01CC 0474 2F30 28181909081818190908181818190818181818181818181908 55; RfRaw 0

Cycle Color
-------------
RfRaw AA B0 21 03 08 01CC 0474 2F1C 28181909081818190908181818190818181818181819081908 55; RfRaw 0

Brightness Down (There are 10 Levels of Brightness)
---------------
RfRaw AA B0 21 03 08 019A 04BA 2F30 28181909081818190908181818190818181818181819090908 55; RfRaw 0

Brightness Up (There are 10 Levels of Brightness)
-------------
RfRaw AA B0 21 03 08 019A 04B0 2F30 28181909081818190908181818190818181818181818190908 55; RfRaw 0


Music On/Off
-------------
RfRaw AA B0 21 03 08 01B8 0492 2F26 28181909081818190908181818190818181818181818190818 55; RfRaw 0

Music Prev
-------------
RfRaw AA B0 21 03 08 01CC 0474 2F26 28181909081818190908181818190818181818181908181818 55; RfRaw 0

Music Prev
-------------
RfRaw AA B0 21 03 08 019A 04A6 2F30 28181909081818190908181818190818181818181908181908 55; RfRaw 0

Volume Down
-------------
RfRaw AA B0 21 03 08 01CC 0474 2F26 28181909081818190908181818190818181818181819081818 55; RfRaw 0

Volume Up
-------------
RfRaw AA B0 21 03 08 01CC 0474 2F26 28181909081818190908181818190818181818181819090818 55; RfRaw 0

TIA!

Hi @flexage - were you ever able to solve this issue? I’m in the exact same boat with some Neewer videoconferencing lights - same 10 levels of brightness and everything - and would really like to be able to control the brightness through HA.

Thanks!

Hi @joncknott I believe I did get an entity configured in the end, I’m away from a computer for the next several hours so can’t check and provide code examples.

I was quite some time ago when I set this up, but I first had captured the codes, and tested that they worked by making service calls from the developer tools panel. l think I may have ultimately configured a couple of scripts to make the service calls, and potentially used the “light template” component to utilise these scripts as an entity.

Without checking, I may be wrong about the above, but I am happy to check later upon returning home, and share any snippets I can :ok_hand:

I have a similar thing going on with a light with different brightness levels and such. Are you able to share your config?