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 )
Tasmota Setup So Far:
(CURRENTLY MY MQTT SETUP IS ‘BACKWARDS’. I’ll likely fix this)
# 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 let us give thanks to the sacrifice my dining table has made for a little while
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