Brilliant Smart Fan Controller

Brilliant Smart WiFI Ceiling Fan controller Model 99333

Recently I purchased a Briliant Smart WiFI Ceiling Fan controller, like many smart home devices on the market at the moment this is a rebranded device from the manufacturer Tuya. Now I need to point out that I am talking specifically about the Model 99333 this is not the same as the BrilliantSmart 99111 Fan.

The instructions are similar, but there are a couple of subtle differences. If you have the model 99111, then I recommend checking out this page https://neon.ninja/2019/12/taking-the-old-ceiling-fan-for-a-smart-spin/ or https://newadventuresinwi-fi.blogspot.com/2019/12/brilliant-smart-ceiling-fan-remote-in-home-assistant.html .

First up, there are two processes you can follow to flash this unit, you can use the Tuya Convert approach, or you can flash the module by directly connecting to the pins on the WIFI module. The first one is by far the easiest and up until recently was still possible.

There may still be some old stock which will enable you to use the Tuya Convert method. In this tutorial, I will be talking mainly about the TuyaConvert method, but in the interests of helping out those of you who have stumbled onto my page looking for instructions how to flash using the Non-Tuya convert method. Please take a look here

Before I get into the specifics, let me first suggest you take a look at this page, this will explain the process we will be following when flashing our device, specifically in this tutorial shows you how to set up a Raspberry Pi and a Wemo Mini to work together for the flashing process. It is effortless and straightforward.

Once you have your environment setup (its all explained in the video I linked to above) then you are ready to go. But to get started you need to put the controller into flash mode. Believe it or not this is probably the hardest part of this process and that's not really hard!

All you need to do is turn to power off for 3 seconds, then turn it on for 3 seconds and then off for 3 seconds etc. for a total of 5 cycles.

Once you're in pair mode, then all you need to do is flash the unit using the method on Digiblur. Now comes the fun bit. If you go to https://templates.blakadder.com/ you will find a template for the 99111 fan, but this template won't work with the 99333, that's because the Tuya tx and RX positions have been changed, so the correct template is

{“NAME”:“Brilliant Fan”,“GPIO”:[0,0,0,0,0,0,0,0,0,108,0,107,0],“FLAG”:0,“BASE”:54}

You also need to send some backlog commands to configure the switch to talk between the Wifi module and the MCU, now there is a lot to this topic, and if your anything like me you probably hate just issuing commands without understanding what they do. So here is a link to all things TuyaMCU as it pertains to Tasmota

Another great resource which explains the following commands can be found here information about Setoptions, and other commands can be found here But for now, this is what you need to get the unit working.

Open the console on the fan/switch and issue the following commands

  • TuyaMCU 11,1 # set Switch1 (fnId 11) to dpId 1 (light on/off)

  • TuyaMCU 12,9 # set Switch2 (fnId 12) to dpId 9 (fan on/off)

  • TuyaMCU 21,10 # set Dimmer (fnId 21) to dpId 10 (light dimmer)

  • DimmerRange 0,255 # set dimmer range (if you have a dimmable light)

  • DimmerRange 100,100 # set dimmer range to Null (if you are NONE dimmable light, i.e a fluro)

  • SetOption59 1 # publish state via MQTT on power command

  • SetOption66 1 # publish TuyaReceived via MQTT

So far so good. Now if you want to control this with an automation system, then you need to configure that system to issue MQTT commands. I personally use Home Assitant, so the MQTT settings below would be used with HAS, it is possible to use MQTT discovery by setting SetOption19 1 in the console. However, this will not give you all you need to control the fan, all that discover will give you is binary on-off for both Light and fan (and Dimmer if you have that setup)

Do get control of the fan in a more granular fashion and to be able to set different fan speeds then you need to add some additional settings with MQTT. In-Home assistant in your configuration.yaml set the following for Fan

fan:- platform: mqtt name: "Fan Lounge" command_topic: "cmnd/fan/POWER1" state_topic: "tele/fan/STATE" state_value_template: "{{ value_json.POWER1 }}" speed_command_topic: "cmnd/fan/Backlog" speed_state_topic: "tele/fan/RESULT" speed_value_template: > {% if value_json.TuyaReceived.Data == "55AA03070005030400010016" %} Power1 1; TuyaSend4 3,0 {% elif value_json.TuyaReceived.Data == "55AA03070005030400010117" %} Power1 1; TuyaSend4 3,1 {% elif value_json.TuyaReceived.Data == "55AA03070005030400010218" %} Power1 1; TuyaSend4 3,2 {% endif %} availability_topic: tele/fan/LWT payload_available: Online payload_not_available: Offline payload_low_speed: "Power1 1; TuyaSend4 3,0" payload_medium_speed: "Power1 1; TuyaSend4 3,1" payload_high_speed: "Power1 1; TuyaSend4 3,2" payload_off: "OFF" payload_on: "ON" qos: 1 retain: false speeds: - low - medium - high

Now let's break this down so you can understand what it's doing. The first four lines are very straight forward, but then you see the following.


state_value_template: "{{ value_json.POWER1 }}" speed_command_topic: "cmnd/fan/Backlog" speed_state_topic: "tele/fan/RESULT" speed_value_template: > {% if value_json.TuyaReceived.Data == "55AA03070005030400010016" %} Power1 1; TuyaSend4 3,0 {% elif value_json.TuyaReceived.Data == "55AA03070005030400010117" %} Power1 1; TuyaSend4 3,1 {% elif value_json.TuyaReceived.Data == "55AA03070005030400010218" %} Power1 1; TuyaSend4 3,2 {% endif %}

Now depending on if you have been able to figure out the commands that the RF module is sending to the MCU or not (I have not yet been able to get this to work) you use this section to tell the automation platform the state of the fan speeds etc. so basically what this block does is tells Home Assistant (in this case) that when the RF module sends the code 55AA03070005030400010016, that means that on the rf remote the fan speed has been set to low. We then send the backlog command

Power1 1; TuyaSend4 3,0

which in effect then sets the Wifi module to confirm the fan speed is low in this case and synchronises Home Assistant of the fan status.

Now if you have the time and inclination, you can try and work out what messages the RF module is sending to the MCU, on this page, thecubical explains how to read the data received from the RF receiver. Basically what you need to do is set weblog to a more verbose mode and then press the buttons on the RF module. As the RF module in my device appears to be faulty (it doesn't make the fan do anything) I am unable to conduct any test.

Now I have an alternative suggestion for integrating the RF remote to control the fan, just in case, like me, you are not able to get the RF module to work with Tasmota. If you happen to be using an RTL-SDR, then you can use this to read the remote control and then send messages via Home Assitant to the Light and fan.

If you don't have home assistant but are using a different platform, then you can set up the RTL-SDR with MQTT and just transmit the MQTT commands directly to the fan, this has several other benefits because it means that you are able to separate the connection between the remote and the fan. You could therefore use this remote or even other remotes to turn things on and off.

I am working on a tutorial for setting up the RTL-SDR, sure there are a couple already, but like most tutorials I have found (except for Dr zZz) they are generally overly complicated and hard to understand, this is problematic when things don't work.

Back to our regulalrly scheduled program.

The next 3 lines are standard MQTT commands but then we come to the following.

payload_low_speed: "Power1 1; TuyaSend4 3,0" payload_medium_speed: "Power1 1; TuyaSend4 3,1" payload_high_speed: "Power1 1; TuyaSend4 3,2" payload_off: "OFF" payload_on: "ON" qos: 1 retain: false speeds: - low - medium - high

I copied this from the New Adventures in wifi webpage, the link is here. To explain this a bit further, basically dpId 3 is an enum data type which corresponds to the fan speed, and takes values of 0, 1 or 2, corresponding to low, medium and high speeds. To set the fan speed configure Home Assistant to send a Backlog command which turns on the fan, and uses the TuyaSend4 command to send a value to dpId 3. This works pretty well.

That's it. I hope you have had success.

Thanks for visiting.