Brilliant Bahama Smart DC Ceiling Fan (Australia)

Hi All,

I’m in progress for flashing and integrating the Bahama Smart DC ceiling fan into HA.

My intent is that this is a little bit of a running blog until its all done.

Purchased October 2020, this seemingly came with a newer firmware than Tuya convert to handle.

The controller has an TYWE2S so using the same serial flashing instructions as the Deta 4/Quad gang light switch from @IamDan I was able to get tasmota on:
Australia - Electrically Certified Hardware

Note that GPIO0 is hidden behind a capacitor. I used from blutac to hold a jumper on there for the 5 seconds during initial boot.

I’m currently working on the integration using a few more general guides and @exxamalte’s write up about the same fan but using esp home.

I’m hoping to purely stick with Tasmota, not sure why really and i’m also a bit of a Tasmota noob so bare with me. (I also dont yet know how to transition from 1 to another :stuck_out_tongue:)

Tasmota Setup So Far:
(CURRENTLY MY MQTT SETUP IS ‘BACKWARDS’. I’ll likely fix this)
image

# enable TuyaMCU module
Module 54            

# Configure Power1 (fnId=11) as Fan power (dpId=1)
TuyaMCU 11,1

# Configure Power2 (fnId=12) as Light (dpId=9)
TuyaMCU 12,9

# Set HA auto discover.
SetOption19 1

# publish state via MQTT on power command
SetOption59 1         

# publish TuyaReceived via MQTT
SetOption66 1

Rule to publish speeds (from the remote only perhaps?)

Rule1 on TuyaReceived#Data=55AA03070005030400010016 DO Publish bedroom_ceiling_fan/stat/RESULT {"Speed":1} endon on TuyaReceived#Data=55AA03070005030400010117 DO Publish bedroom_ceiling_fan/stat/RESULT {"Speed":1} endon on TuyaReceived#Data=55AA03070005030400010218 DO Publish bedroom_ceiling_fan/stat/RESULT {"Speed":2} endon on TuyaReceived#Data=55AA03070005030400010319 DO Publish bedroom_ceiling_fan/stat/RESULT {"Speed":2} endon on TuyaReceived#Data=55AA0307000503040001041A DO Publish bedroom_ceiling_fan/stat/RESULT {"Speed":3} endon
Rule1 ON

Rule: Set speed when commands arrive from HA via MQTT.

Rule2 on Event#speed=1 DO Backlog Power1 1; TuyaSend4 3,0 endon on Event#speed=2 DO Backlog Power1 1; TuyaSend4 3,2 endon on Event#speed=3 DO Backlog Power1 1; TuyaSend4 3,4 endon
Rule2 ON
fan:

  - platform: mqtt
    name: "Bedroom Ceiling Fan"
    availability_topic: "bedroom_ceiling_fan/tele/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
    state_topic: "bedroom_ceiling_fan/stat/POWER1"
    command_topic: "bedroom_ceiling_fan/cmnd/POWER1"
    payload_on: "ON"
    payload_off: "OFF"
    speed_state_topic: "bedroom_ceiling_fan/stat/RESULT"
    speed_value_template: "{% if value_json is defined and value_json.Speed is defined %}speed={{ value_json.Speed }}{% endif %}"
    speed_command_topic: "bedroom_ceiling_fan/cmnd/Event"
    payload_low_speed: "speed=1"
    payload_medium_speed: "speed=2"
    payload_high_speed: "speed=3"
    qos: 1
    speeds:
      - "off"
      - low
      - medium
      - high

Forward and reverse button scripts (i think I have this orientated correctly)

bedroom_fan_forward:
  alias: Bedroom Fan - Forward
  sequence:
    - service: mqtt.publish
      data_template:
        topic: 'bedroom_ceiling_fan/cmnd/TuyaSend4'
        payload: '4,0'

bedroom_fan_reverse:
  alias: Bedroom Fan - Reverse
  sequence:
    - service: mqtt.publish
      data_template:
        topic: 'bedroom_ceiling_fan/cmnd/TuyaSend4'
        payload: '4,1'

Also a startup status sync automation:

- alias: Update fan power state on start-up
  trigger:
    platform: homeassistant
    event: start
  action:
  - service: mqtt.publish
    data:
      topic: bedroom_ceiling_fan/cmnd/POWER1
      payload: ''
  - service: mqtt.publish
    data:
      topic: bedroom_ceiling_fan/cmnd/Event/speed
      payload: ''

All the basic functionality is working. Currently trying to do more than low/med/high speeds and have it retain in the UI

This should be interesting so come along for the ride :slight_smile: let us give thanks to the sacrifice my dining table has made for a little while :stuck_out_tongue:

Special thanks also to:
David G for some MQTT fan code i’ll take a crack at too as I get going better.
@ozvave for much of the starting information as he has the same fan but is still battling with some things himself.

Linton

3 Likes

Congrats, well done getting it flashed and configured!

esphome is pretty easy to convert to, if you’re interested. I like that it integrates directly with HA so I don’t need to run an MQTT server (and do all the config glue between it and the device and HA).

Flashing another firmware can be done directly from the tasmota web UI, but you first need to Setoption78 1 to allow it to load non-tasmota images.

1 Like

Big edit and progress!

All the basic functionality is working.
I’m still battling with speed selection more than low/med/high that will sync and stick in the UI

image

1 Like

Did you get the speed working? I am having similar issues with a Deta Fan / Light switch. I can control the speed from home assistant but home assistant does not know what speed it is running. I assume it has something to do with the speed_value_template.

Hey mate,

So my setup currently stands with HA can set 3 speeds, remote can set 5.
I have speed 2 and speed 4 setup to read as low and medium in HA just as a something which is rule1 above.
Ultimately I think i’ll have to wait until HA does more than 3 speeds natively because I can finalize that.

You would be listening for speed ‘feedback’ on speed_state_topic i believe.

One thing I might reiterate to you is that my MQTT topic is backwards to you just incase you’ve tried to replicate it. I’m planning to fix this when my second fan arrives.

Thanks for the reply mate. I have the
speed_state_topic: “stat/mblightfan/RESULT”
and when subscribing to the topic in mqtt i can see the relays it turns on such as power 3 on , power 4 on (which are the speed relays) and the last is the rule which sets the speed as “VAR1”: “3” (each speed has "VAR1: “2” , “VAR1”: “1”). Just not sure how to set that out for home assistant to read what speed it is going.

this might be really simple.
My config has

    payload_low_speed: "speed=1"
    payload_medium_speed: "speed=2"
    payload_high_speed: "speed=3"

what if your config was set to:

    payload_low_speed: "VAR1=1"
    payload_medium_speed: "VAR1=2"
    payload_high_speed: "VAR1=3"

Can you post your whole HA side config? I’m really not great with tasmota myself and mqtt can also mess me up pretty easily however it might be something obvious

Thanks again mate for your assistance.
I don’t think I have explained my issue very well. I will try again.
Everything works fine in home assistant where I can turn fan on and I can change the speeds and the fan actually changes speeds fine from low, med and high. My issue is the speed attribute in home assistant for the fan always shows off so in other words home assistant doesn’t know what speed the fan is running at. This is where I think the issue comes from my speed_value_template in config being incorrect. Just cant figure out what it should be. This is my config.

fan:
  - platform: mqtt
    name: "Master Bedroom Fan"
    availability_topic: "tele/mblightfan/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
    state_topic: "stat/mblightfan/POWER2"
    command_topic: "cmnd/mblightfan/POWER2"
    payload_on: "ON"
    payload_off: "OFF"
    speed_state_topic: "stat/mblightfan/RESULT"
    speed_value_template: "{% if value_json is defined and value_json.Speed is defined %}speed={{ value_json.Speed }}{% endif %}"
    speed_command_topic: "cmnd/mblightfan/Event"
    payload_low_speed: "SetSpeed=1"
    payload_medium_speed: "SetSpeed=2"
    payload_high_speed: "SetSpeed=3"
    qos: 1
    speeds:
      - "off"
      - low
      - medium
      - high

I ran into the same thing. In the end it was the tasmota log result not aligning with payload speed. So if you can get the two align you should be ok.

You should be able to look at my rule2 and make adjustments.

You also have setspeed=x in your payload commands so you would need to make an adjustment.
For giggles I’d try

Rule2 on Event#SetSpeed=1 DO Backlog…

Thanks again for your help. Unfortunately I did try adding the rule2 but I see no difference. I do see it apply the rule when watching the console in tasmota. Not sure what I can do from here. Hopefully some other people will start to use these Deta light fan switches which will hopefully result in more info.

i too am using tasmota for a fan that used to have a tuya board in it

the HA UI does not keep the speed either… drops back to display off after a few seconds but i can change the speed

of note the tuya addon for HA allowed to the fan to use all 6 speeds… so i need to look into the new tasmota changes for enums etc

after see this post i think i know what to do now:)

Any luck getting the speeds to work?

Yup… but only 3 speeds… I selected 1 for low, 3 for med and 6 for high

seems that there are changes

now I have to work on my code to future proof it beyond 2021 :frowning:

Did you have any luck with this?

Just wondering if anyone with this fan notices a humming noise from the controller during operation after flashing tasmota? Any ideas what this could be?

anyone knows where i can buy this controller? im from israel.