Fan/Light only working partially

I have a couple of these devices installed in my ceiling fans: Lucci Connect Remote (Beacon) and I was able to flash them over the air to the latest version of Tasmota and I can see they are automatically discovered in MQTT when SetOption19 1 is given.

I can turn the light on and off from HA, but I can no longer get the Fan to work. If I don’t add anything to my configuration.yaml it displays as a button, but can only turn the fan on and off. I have tried to use the button controller entity, but I have to add this to my configuration.yaml to get it to display:

fan:
    - platform: mqtt
      name: "Main Fan Controller"
      state_topic: "stat/Main_Lucci/POWER1"
      command_topic: "cmnd/Main_Lucci/POWER1"
      payload_on: "ON"
      payload_off: "OFF"
      availability_topic: "tele/Main_Lucci/LWT"
      payload_available: "Online"
      payload_not_available: "Offline"
      preset_mode_state_topic: "stat/Main_Lucci/speed"
      preset_mode_value_template: >
        {%- if value == '2,0' %}low
        {%- elif value == '2,1' %}medium
        {%- elif value == '2,2' %}high
        {%- endif -%}
      preset_mode_command_topic: "cmnd/Main_Lucci/TuyaSend4"
      preset_mode_command_template: >
        {%- if value == "low" %}2.0
        {%- elif value == "medium" %}2,1
        {%- elif value == "high" %}2,2
        {%- endif -%}
      qos: 0
      preset_modes:
        - "low"
        - "medium"
        - "high"

And whilst the button row displays it doesn’t work.

Apart from not being able to control the fan, updates from the remote itself and not being sent back to HA, even though I followed the code suggestion in the template that hasn’t work.

Can anyone help point me in the right direction on how to get my fan to work and also how to get updates from the remote in HA?

Thanks

Girkers.

Which “button controller entity” are you using?

When I use this one:

type: custom:fan-mode-button-row
entity: fan.main_fan_controller

Med and High work, but Low and Off don’t

When I try this one:

type: custom:fan-control-entity-row
entity: fan.main_fan_controller

it doesn’t work at all.

Have you confirmed Home Assistant is receiving the payloads published to the topic stat/Main_Lucci/POWER1 ?

Use an MQTT client (like MQTT Explorer) to confirm the topic is receiving payloads. Then use Home Assistant to confirm it as well (Configuration > Integration > Mosquitto Broker > Configure > Listen to a topic).

Screenshot from 2021-07-01 22-34-22

OK, I have tried both of those and when I use the remote NOTHING is being published to the topic.

I get nothing on HA when looking at the broker, and here is what I see when looking at MQTT Explorer:

So how do I go about getting my device to publish to the topic when the state changes at the remote end?

Thanks @123 for the heads up.

My first instinct is to go to the Tasmota web interface and see what is happening when I interact directly with the firmware on the fan.

Are you able to control the fans correctly from the tasmota web interface page?

If so, look in the console to see what the MQT message is when you choose each speed option.

This always give me the structure and clues I have needed to then make the connection from the HA end.

If the fan is not being controlled correctly from the web interface check then the issue may be in the configuration/ template being used.

Good luck.

There appears to be some confusion here.

  • You manually defined an MQTT Fan and set its state_topic to stat/Main_Lucci/POWER1.

  • In the MQTT Explorer screenshot, there is no topic named stat/Main_Lucci/POWER1.

  • The screenshot shows several other topics related to Milko and Main fans, including an MQTT Discovery topic (homeassistant/switch/66AFB2_RL_2) which automatically creates an entity.

  • There’s also a Tasmota topic which might contain more autodiscovery information (based on Tasmota’s own style of discovery).

  • The topic named Main_Lucci appears to contain telemetry information but doesn’t correspond to any topic defined by the MQTT Discovery topic.

Based on what I see, it seems like you have been trying several different ways to get this to work. For someone trying to help you, it’s difficult to understand which one of the many similar topics belongs to the device and represents its true configuration and state.

Which one of those many topics is the one that the device is actually using?

I was able to delete the device from the integration and before I add it back, here is what it looks like from the Tasmota interface:


Toggle 1 is the fan and Toggle 2 is the light. I always wondered that the fan is just a toggle???

Here is the information on the device:

And is the template:

Here is a copy of the console when I issue TuyaMCU 12,102

00:00:00.001 HDW: ESP8266EX
00:00:00.050 CFG: Loaded from flash at F5, Count 223
00:00:00.055 QPC: Count 1
00:00:00.107 SNS: Hardware Serial
00:00:00.144 Project tasmota Main Lucci Version 9.5.0(tasmota)-2_7_4_9(2021-06-17T08:26:35)
00:00:00.531 WIF: Connecting to AP1 IoT_2GHz Channel 6 BSSId F2:63:DA:A1:73:65 in mode 11n as Main_Lucci...
00:00:02.754 WIF: Connected
13:22:41.080 RUL: TUYARECEIVED#DATA=55AA00070005020400010113 performs "publish2 stat/Main_Ceiling_Fan/speed 2,1"
13:22:41.084 RSL: speed = 2,1
13:22:42.035 HTP: Web server active on Main_Lucci with IP address 192.168.72.105
13:22:43.015 MQT: Attempting connection...
13:22:43.028 MQT: Connected
13:22:43.031 MQT: tele/Main_Lucci/LWT = Online (retained)
13:22:43.033 MQT: cmnd/Main_Lucci/POWER = 
13:22:43.046 MQT: tele/Main_Lucci/INFO1 = {"Info1":{"Module":"Lucci Fan","Version":"9.5.0(tasmota)","FallbackTopic":"cmnd/DVES_66AFB2_fb/","GroupTopic":"cmnd/tasmotas/"}}
13:22:43.061 MQT: tele/Main_Lucci/INFO2 = {"Info2":{"WebServerMode":"Admin","Hostname":"Main_Lucci","IPAddress":"192.168.72.105"}}
13:22:43.075 MQT: tele/Main_Lucci/INFO3 = {"Info3":{"RestartReason":"Software/System restart"}}
13:22:43.088 MQT: stat/Main_Lucci/RESULT = {"POWER1":"OFF"}
13:22:43.089 MQT: stat/Main_Lucci/POWER1 = OFF
13:22:43.091 MQT: stat/Main_Lucci/RESULT = {"POWER2":"OFF"}
13:22:43.093 MQT: stat/Main_Lucci/POWER2 = OFF
13:22:43.288 MQT: tele/Main_Lucci/STATE = {"Time":"2021-07-03T13:22:43","Uptime":"0T00:00:06","UptimeSec":6,"Heap":28,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","Wifi":{"AP":1,"SSId":"IoT_2GHz","BSSId":"F2:63:DA:A1:73:65","Channel":5,"Mode":"11n","RSSI":56,"Signal":-72,"LinkCount":1,"Downtime":"0T00:00:03"}}
13:22:45.782 MQT: stat/Main_Lucci/STATUS = {"Status":{"Module":0,"DeviceName":"Main Lucci","FriendlyName":["Main Fan","Main Light"],"Topic":"Main_Lucci","ButtonTopic":"0","Power":0,"PowerOnState":0,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0}}
13:22:45.801 MQT: stat/Main_Lucci/STATUS1 = {"StatusPRM":{"Baudrate":9600,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://192.168.72.15:9541/data/firmwares/tasmota.bin","RestartReason":"Software/System restart","Uptime":"0T00:00:08","StartupUTC":"2021-07-03T03:22:37","Sleep":50,"CfgHolder":4617,"BootCount":47,"BCResetTime":"2021-04-07T12:39:30","SaveCount":224,"SaveAddress":"F4000"}}
13:22:45.817 MQT: stat/Main_Lucci/STATUS2 = {"StatusFWR":{"Version":"9.5.0(tasmota)","BuildDateTime":"2021-06-17T08:26:35","Boot":31,"Core":"2_7_4_9","SDK":"2.2.2-dev(38a443e)","CpuFrequency":80,"Hardware":"ESP8266EX","CR":"349/699"}}
13:22:45.834 MQT: stat/Main_Lucci/STATUS3 = {"StatusLOG":{"SerialLog":0,"WebLog":2,"MqttLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["IoT_2GHz",""],"TelePeriod":300,"Resolution":"558180C0","SetOption":["000A8009","2805C8000100060000005A0A000000000000","00000280","00006000","00000000"]}}
13:22:45.854 MQT: stat/Main_Lucci/STATUS4 = {"StatusMEM":{"ProgramSize":607,"Free":396,"Heap":27,"ProgramFlashSize":1024,"FlashSize":2048,"FlashChipId":"1540C8","FlashFrequency":40,"FlashMode":3,"Features":["00000809","8FDAC787","04368001","000000CF","010013C0","C000F981","00004004","00001000","00000020"],"Drivers":"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37,45","Sensors":"1,2,3,4,5,6"}}
13:22:45.875 MQT: stat/Main_Lucci/STATUS5 = {"StatusNET":{"Hostname":"Main_Lucci","IPAddress":"192.168.72.105","Gateway":"192.168.72.1","Subnetmask":"255.255.255.0","DNSServer":"192.168.72.1","Mac":"B4:E6:2D:66:AF:B2","Webserver":2,"WifiConfig":4,"WifiPower":17.0}}
13:22:45.892 MQT: stat/Main_Lucci/STATUS6 = {"StatusMQT":{"MqttHost":"192.168.72.15","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_66AFB2","MqttUser":"mozzie","MqttCount":1,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":4}}
13:22:45.912 MQT: stat/Main_Lucci/STATUS7 = {"StatusTIM":{"UTC":"2021-07-03T03:22:45","Local":"2021-07-03T13:22:45","StartDST":"2021-03-28T02:00:00","EndDST":"2021-10-31T03:00:00","Timezone":"+10:00","Sunrise":"13:52","Sunset":"05:56"}}
13:22:45.930 MQT: stat/Main_Lucci/STATUS10 = {"StatusSNS":{"Time":"2021-07-03T13:22:45"}}
13:22:45.950 MQT: stat/Main_Lucci/STATUS11 = {"StatusSTS":{"Time":"2021-07-03T13:22:45","Uptime":"0T00:00:08","UptimeSec":8,"Heap":27,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","Wifi":{"AP":1,"SSId":"IoT_2GHz","BSSId":"F2:63:DA:A1:73:65","Channel":5,"Mode":"11n","RSSI":56,"Signal":-72,"LinkCount":1,"Downtime":"0T00:00:03"}}}
13:22:45.029 QPC: Reset
13:22:47.812 MQT: tele/Main_Lucci/STATE = {"Time":"2021-07-03T13:22:47","Uptime":"0T00:00:10","UptimeSec":10,"Heap":28,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","Wifi":{"AP":1,"SSId":"IoT_2GHz","BSSId":"F2:63:DA:A1:73:65","Channel":5,"Mode":"11n","RSSI":54,"Signal":-73,"LinkCount":1,"Downtime":"0T00:00:03"}}
13:22:52.950 MQT: homeassistant/switch/66AFB2_RL_2/config = {"name":"Main Light","stat_t":"tele/Main_Lucci/STATE","avty_t":"tele/Main_Lucci/LWT","pl_avail":"Online","pl_not_avail":"Offline","cmd_t":"cmnd/Main_Lucci/POWER2","pl_off":"OFF","pl_on":"ON","val_tpl":"{{value_json.POWER2}}","uniq_id":"66AFB2_RL_2","dev":{"ids":["66AFB2"]}} (retained)
13:22:52.962 MQT: homeassistant/sensor/66AFB2_status/config = {"name":"Main Lucci status","stat_t":"tele/Main_Lucci/HASS_STATE","avty_t":"tele/Main_Lucci/LWT","pl_avail":"Online","pl_not_avail":"Offline","json_attr_t":"tele/Main_Lucci/HASS_STATE","unit_of_meas":"%","val_tpl":"{{value_json['RSSI']}}","ic":"mdi:information-outline","uniq_id":"66AFB2_status","dev":{"ids":["66AFB2"],"name":"Main Lucci","mdl":"Lucci Fan","sw":"9.5.0(tasmota)","mf":"Tasmota"}} (retained)
13:22:53.982 MQT: stat/Main_Lucci/STATUS = {"Status":{"Module":0,"DeviceName":"Main Lucci","FriendlyName":["Main Fan","Main Light"],"Topic":"Main_Lucci","ButtonTopic":"0","Power":0,"PowerOnState":0,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0}}
13:22:54.002 MQT: stat/Main_Lucci/STATUS1 = {"StatusPRM":{"Baudrate":9600,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://192.168.72.15:9541/data/firmwares/tasmota.bin","RestartReason":"Software/System restart","Uptime":"0T00:00:16","StartupUTC":"2021-07-03T03:22:37","Sleep":50,"CfgHolder":4617,"BootCount":48,"BCResetTime":"2021-04-07T12:39:30","SaveCount":225,"SaveAddress":"FB000"}}
13:22:54.019 MQT: stat/Main_Lucci/STATUS2 = {"StatusFWR":{"Version":"9.5.0(tasmota)","BuildDateTime":"2021-06-17T08:26:35","Boot":31,"Core":"2_7_4_9","SDK":"2.2.2-dev(38a443e)","CpuFrequency":80,"Hardware":"ESP8266EX","CR":"349/699"}}
13:22:54.036 MQT: stat/Main_Lucci/STATUS3 = {"StatusLOG":{"SerialLog":0,"WebLog":2,"MqttLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["IoT_2GHz",""],"TelePeriod":300,"Resolution":"558180C0","SetOption":["000A8009","2805C8000100060000005A0A000000000000","00000280","00006000","00000000"]}}
13:22:54.060 MQT: stat/Main_Lucci/STATUS4 = {"StatusMEM":{"ProgramSize":607,"Free":396,"Heap":27,"ProgramFlashSize":1024,"FlashSize":2048,"FlashChipId":"1540C8","FlashFrequency":40,"FlashMode":3,"Features":["00000809","8FDAC787","04368001","000000CF","010013C0","C000F981","00004004","00001000","00000020"],"Drivers":"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37,45","Sensors":"1,2,3,4,5,6"}}
13:22:54.080 MQT: stat/Main_Lucci/STATUS5 = {"StatusNET":{"Hostname":"Main_Lucci","IPAddress":"192.168.72.105","Gateway":"192.168.72.1","Subnetmask":"255.255.255.0","DNSServer":"192.168.72.1","Mac":"B4:E6:2D:66:AF:B2","Webserver":2,"WifiConfig":4,"WifiPower":17.0}}
13:22:54.097 MQT: stat/Main_Lucci/STATUS6 = {"StatusMQT":{"MqttHost":"192.168.72.15","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_66AFB2","MqttUser":"mozzie","MqttCount":1,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":4}}
13:22:54.115 MQT: stat/Main_Lucci/STATUS7 = {"StatusTIM":{"UTC":"2021-07-03T03:22:54","Local":"2021-07-03T13:22:54","StartDST":"2021-03-28T02:00:00","EndDST":"2021-10-31T03:00:00","Timezone":"+10:00","Sunrise":"13:52","Sunset":"05:56"}}
13:22:54.134 MQT: stat/Main_Lucci/STATUS10 = {"StatusSNS":{"Time":"2021-07-03T13:22:54"}}
13:22:54.152 MQT: stat/Main_Lucci/STATUS11 = {"StatusSTS":{"Time":"2021-07-03T13:22:54","Uptime":"0T00:00:17","UptimeSec":17,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","Wifi":{"AP":1,"SSId":"IoT_2GHz","BSSId":"F2:63:DA:A1:73:65","Channel":5,"Mode":"11n","RSSI":58,"Signal":-71,"LinkCount":1,"Downtime":"0T00:00:03"}}}
13:23:01.739 MQT: stat/Main_Lucci/STATUS = {"Status":{"Module":0,"DeviceName":"Main Lucci","FriendlyName":["Main Fan","Main Light"],"Topic":"Main_Lucci","ButtonTopic":"0","Power":0,"PowerOnState":0,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0}}
13:23:01.759 MQT: stat/Main_Lucci/STATUS1 = {"StatusPRM":{"Baudrate":9600,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://192.168.72.15:9541/data/firmwares/tasmota.bin","RestartReason":"Software/System restart","Uptime":"0T00:00:24","StartupUTC":"2021-07-03T03:22:37","Sleep":50,"CfgHolder":4617,"BootCount":48,"BCResetTime":"2021-04-07T12:39:30","SaveCount":225,"SaveAddress":"FB000"}}
13:23:01.776 MQT: stat/Main_Lucci/STATUS2 = {"StatusFWR":{"Version":"9.5.0(tasmota)","BuildDateTime":"2021-06-17T08:26:35","Boot":31,"Core":"2_7_4_9","SDK":"2.2.2-dev(38a443e)","CpuFrequency":80,"Hardware":"ESP8266EX","CR":"349/699"}}
13:23:01.794 MQT: stat/Main_Lucci/STATUS3 = {"StatusLOG":{"SerialLog":0,"WebLog":2,"MqttLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["IoT_2GHz",""],"TelePeriod":300,"Resolution":"558180C0","SetOption":["000A8009","2805C8000100060000005A0A000000000000","00000280","00006000","00000000"]}}
13:23:01.817 MQT: stat/Main_Lucci/STATUS4 = {"StatusMEM":{"ProgramSize":607,"Free":396,"Heap":27,"ProgramFlashSize":1024,"FlashSize":2048,"FlashChipId":"1540C8","FlashFrequency":40,"FlashMode":3,"Features":["00000809","8FDAC787","04368001","000000CF","010013C0","C000F981","00004004","00001000","00000020"],"Drivers":"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37,45","Sensors":"1,2,3,4,5,6"}}
13:23:01.839 MQT: stat/Main_Lucci/STATUS5 = {"StatusNET":{"Hostname":"Main_Lucci","IPAddress":"192.168.72.105","Gateway":"192.168.72.1","Subnetmask":"255.255.255.0","DNSServer":"192.168.72.1","Mac":"B4:E6:2D:66:AF:B2","Webserver":2,"WifiConfig":4,"WifiPower":17.0}}
13:23:01.854 MQT: stat/Main_Lucci/STATUS6 = {"StatusMQT":{"MqttHost":"192.168.72.15","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_66AFB2","MqttUser":"mozzie","MqttCount":1,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":4}}
13:23:01.872 MQT: stat/Main_Lucci/STATUS7 = {"StatusTIM":{"UTC":"2021-07-03T03:23:01","Local":"2021-07-03T13:23:01","StartDST":"2021-03-28T02:00:00","EndDST":"2021-10-31T03:00:00","Timezone":"+10:00","Sunrise":"13:52","Sunset":"05:56"}}
13:23:01.887 MQT: stat/Main_Lucci/STATUS10 = {"StatusSNS":{"Time":"2021-07-03T13:23:01"}}
13:23:01.907 MQT: stat/Main_Lucci/STATUS11 = {"StatusSTS":{"Time":"2021-07-03T13:23:01","Uptime":"0T00:00:24","UptimeSec":24,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","Wifi":{"AP":1,"SSId":"IoT_2GHz","BSSId":"F2:63:DA:A1:73:65","Channel":5,"Mode":"11n","RSSI":56,"Signal":-72,"LinkCount":1,"Downtime":"0T00:00:03"}}}
13:23:09.757 MQT: stat/Main_Lucci/STATUS = {"Status":{"Module":0,"DeviceName":"Main Lucci","FriendlyName":["Main Fan","Main Light"],"Topic":"Main_Lucci","ButtonTopic":"0","Power":0,"PowerOnState":0,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0}}
13:23:09.777 MQT: stat/Main_Lucci/STATUS1 = {"StatusPRM":{"Baudrate":9600,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://192.168.72.15:9541/data/firmwares/tasmota.bin","RestartReason":"Software/System restart","Uptime":"0T00:00:32","StartupUTC":"2021-07-03T03:22:37","Sleep":50,"CfgHolder":4617,"BootCount":48,"BCResetTime":"2021-04-07T12:39:30","SaveCount":225,"SaveAddress":"FB000"}}
13:23:09.794 MQT: stat/Main_Lucci/STATUS2 = {"StatusFWR":{"Version":"9.5.0(tasmota)","BuildDateTime":"2021-06-17T08:26:35","Boot":31,"Core":"2_7_4_9","SDK":"2.2.2-dev(38a443e)","CpuFrequency":80,"Hardware":"ESP8266EX","CR":"349/699"}}
13:23:09.812 MQT: stat/Main_Lucci/STATUS3 = {"StatusLOG":{"SerialLog":0,"WebLog":2,"MqttLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["IoT_2GHz",""],"TelePeriod":300,"Resolution":"558180C0","SetOption":["000A8009","2805C8000100060000005A0A000000000000","00000280","00006000","00000000"]}}
13:23:09.837 MQT: stat/Main_Lucci/STATUS4 = {"StatusMEM":{"ProgramSize":607,"Free":396,"Heap":27,"ProgramFlashSize":1024,"FlashSize":2048,"FlashChipId":"1540C8","FlashFrequency":40,"FlashMode":3,"Features":["00000809","8FDAC787","04368001","000000CF","010013C0","C000F981","00004004","00001000","00000020"],"Drivers":"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37,45","Sensors":"1,2,3,4,5,6"}}
13:23:09.857 MQT: stat/Main_Lucci/STATUS5 = {"StatusNET":{"Hostname":"Main_Lucci","IPAddress":"192.168.72.105","Gateway":"192.168.72.1","Subnetmask":"255.255.255.0","DNSServer":"192.168.72.1","Mac":"B4:E6:2D:66:AF:B2","Webserver":2,"WifiConfig":4,"WifiPower":17.0}}
13:23:09.872 MQT: stat/Main_Lucci/STATUS6 = {"StatusMQT":{"MqttHost":"192.168.72.15","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_66AFB2","MqttUser":"mozzie","MqttCount":1,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":4}}
13:23:09.890 MQT: stat/Main_Lucci/STATUS7 = {"StatusTIM":{"UTC":"2021-07-03T03:23:09","Local":"2021-07-03T13:23:09","StartDST":"2021-03-28T02:00:00","EndDST":"2021-10-31T03:00:00","Timezone":"+10:00","Sunrise":"13:52","Sunset":"05:56"}}
13:23:09.908 MQT: stat/Main_Lucci/STATUS10 = {"StatusSNS":{"Time":"2021-07-03T13:23:09"}}
13:23:09.926 MQT: stat/Main_Lucci/STATUS11 = {"StatusSTS":{"Time":"2021-07-03T13:23:09","Uptime":"0T00:00:32","UptimeSec":32,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":25,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","Wifi":{"AP":1,"SSId":"IoT_2GHz","BSSId":"F2:63:DA:A1:73:65","Channel":5,"Mode":"11n","RSSI":56,"Signal":-72,"LinkCount":1,"Downtime":"0T00:00:03"}}}
13:23:17.937 MQT: stat/Main_Lucci/STATUS = {"Status":{"Module":0,"DeviceName":"Main Lucci","FriendlyName":["Main Fan","Main Light"],"Topic":"Main_Lucci","ButtonTopic":"0","Power":0,"PowerOnState":0,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0}}
13:23:17.957 MQT: stat/Main_Lucci/STATUS1 = {"StatusPRM":{"Baudrate":9600,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://192.168.72.15:9541/data/firmwares/tasmota.bin","RestartReason":"Software/System restart","Uptime":"0T00:00:40","StartupUTC":"2021-07-03T03:22:37","Sleep":50,"CfgHolder":4617,"BootCount":48,"BCResetTime":"2021-04-07T12:39:30","SaveCount":225,"SaveAddress":"FB000"}}
13:23:17.974 MQT: stat/Main_Lucci/STATUS2 = {"StatusFWR":{"Version":"9.5.0(tasmota)","BuildDateTime":"2021-06-17T08:26:35","Boot":31,"Core":"2_7_4_9","SDK":"2.2.2-dev(38a443e)","CpuFrequency":80,"Hardware":"ESP8266EX","CR":"349/699"}}
13:23:17.991 MQT: stat/Main_Lucci/STATUS3 = {"StatusLOG":{"SerialLog":0,"WebLog":2,"MqttLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["IoT_2GHz",""],"TelePeriod":300,"Resolution":"558180C0","SetOption":["000A8009","2805C8000100060000005A0A000000000000","00000280","00006000","00000000"]}}
13:23:18.001 MQT: stat/Main_Lucci/STATUS4 = {"StatusMEM":{"ProgramSize":607,"Free":396,"Heap":27,"ProgramFlashSize":1024,"FlashSize":2048,"FlashChipId":"1540C8","FlashFrequency":40,"FlashMode":3,"Features":["00000809","8FDAC787","04368001","000000CF","010013C0","C000F981","00004004","00001000","00000020"],"Drivers":"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37,45","Sensors":"1,2,3,4,5,6"}}
13:23:18.021 MQT: stat/Main_Lucci/STATUS5 = {"StatusNET":{"Hostname":"Main_Lucci","IPAddress":"192.168.72.105","Gateway":"192.168.72.1","Subnetmask":"255.255.255.0","DNSServer":"192.168.72.1","Mac":"B4:E6:2D:66:AF:B2","Webserver":2,"WifiConfig":4,"WifiPower":17.0}}
13:23:18.038 MQT: stat/Main_Lucci/STATUS6 = {"StatusMQT":{"MqttHost":"192.168.72.15","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_66AFB2","MqttUser":"mozzie","MqttCount":1,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":4}}
13:23:18.056 MQT: stat/Main_Lucci/STATUS7 = {"StatusTIM":{"UTC":"2021-07-03T03:23:18","Local":"2021-07-03T13:23:18","StartDST":"2021-03-28T02:00:00","EndDST":"2021-10-31T03:00:00","Timezone":"+10:00","Sunrise":"13:52","Sunset":"05:56"}}
13:23:18.073 MQT: stat/Main_Lucci/STATUS10 = {"StatusSNS":{"Time":"2021-07-03T13:23:18"}}
13:23:18.094 MQT: stat/Main_Lucci/STATUS11 = {"StatusSTS":{"Time":"2021-07-03T13:23:18","Uptime":"0T00:00:41","UptimeSec":41,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","Wifi":{"AP":1,"SSId":"IoT_2GHz","BSSId":"F2:63:DA:A1:73:65","Channel":5,"Mode":"11n","RSSI":50,"Signal":-75,"LinkCount":1,"Downtime":"0T00:00:03"}}}

Help me Obi-Wan Kenobi your my only hope.

According to this line:

homeassistant/switch/66AFB2_RL_2/config = {“name”:“Main Light”,“stat_t”:“tele/Main_Lucci/STATE”,“avty_t”:“tele/Main_Lucci/LWT”,“pl_avail”:“Online”,“pl_not_avail”:“Offline”,“cmd_t”:“cmnd/Main_Lucci/POWER2”,“pl_off”:“OFF”,“pl_on”:“ON”,“val_tpl”:“{{value_json.POWER2}}”,“uniq_id”:“66AFB2_RL_2”,“dev”:{“ids”:[“66AFB2”]}}

Your device is using Home Assistant’s MQTT Discovery to create an entity named switch.main_light. You should be able to see it in Developer Tools > States.

Yes it is there:

I believe this is because the fan speed is controlled by the mcu chip and not by by the 8266/Tasmota

Trying to check that fan speed can be controlled other than from the remote:

  1. Have you set-up and enabled the two rules from the blackadder template page?

  2. Are you control the fan from HA by calling a service from Developer tools>Services?
    Try:

service: mqtt.publish
data:
  topic: cmnd/Main_Lucci/TuyaSend4
  payload: 2,0

Does changing the payload also change the speed?:
2,1
2,2

If these work then the fan would appear to be flashed correctly and it would then be down to mqtt/HA setup. If these service calls don’t work then go through the initial template configuration set-up again.

Then that’s how Tasmota represents the device to Home Assistant (a switch).

Looking at the screenshot of Tasmota’s UI, there is nothing shown to control speed. In other words, given the way the device is configured within Tasmota, it isn’t offering a means of controlling anything other than power (on/off).

Hi all,

Finally got back to this and found this service call works and the different figures give different speeds as you explained.

So how do I firstly get this in a configure that works and then configure a card, like a sliders, button bar, etc to work?

Almost certainly not the most elegant/ efficient way to do this - but for the single external fan where I needed to use this method, I found it easiest to just create a switch for each speed (within switch.yaml file).

Here is the yaml for the switches I created - which you can tailor to your needs.

  - platform: mqtt
    name: "DeckFan Speed Low"
    state_topic: "stat/Deckfan/speed"
    command_topic: "cmnd/Deckfan/TuyaSend2"
    qos: 0
    payload_on: '3,3'
    payload_off: '3,3OFF'

  - platform: mqtt
    name: "DeckFan Speed Medium"
    state_topic: "stat/Deckfan/speed"
    command_topic: "cmnd/Deckfan/TuyaSend2"
    qos: 0
    payload_on: '3,5'
    payload_off: '3,5OFF'

  - platform: mqtt
    name: "DeckFan Speed High"
    state_topic: "stat/Deckfan/speed"
    command_topic: "cmnd/Deckfan/TuyaSend2"
    qos: 0
    payload_on: '3,8'
    payload_off: '3,8OFF'

This created 3 switches -
switch.deckfan_speed_low
switch.deckfan_speed_medium
switch.deckfan_speed_high

I then just used these switches as buttons within a grid card in lovelace.

Thanks @rob1303, no good.

I changed the topics to the appropriate ones for my fan, however nothing happens. Switches turn on and then after a moment turn off.

The fan doesn’t receive any command and the HA log shows nothing.

Is there a way to debug things, for example when I change the state of this switch what actually happens?

@girkers

Sorry, not sure why it would turn off after sending the command.

Not sure what you can do to resolve.

Maybe have a look at what is going on in the Tasmota console whilst also using this tool which shows they tuya commands and settings: GitHub - sillyfrog/Tasmota-Tuya-Helper: Bookmarklet for Tasmota to assist configuring Tuya devices

There is a short video on youtube showing what this actually does: Tuya helper for Tasmota - YouTube

This can also be used in combination with the Tasmota Tuya dpid tables here: TuyaMCU - Tasmota

Sorry I am not able to add any more insights - as I don’t actually have the fan/controller you are using.

I finally cracked it.

Firstly there was a fault in the HA Template, it had a . instead of a , and that is why the Low speed never worked.

The other issue I found was on my end, CaSe is important. With the Main fan, I reset it back to defaults and went back through the configuration of the device being very cautious of my case. Also ‘reset’ the template in my configuration.yaml and restarted HA.

Now working as expected.

Thanks everyone for your help.

Glad you got it working.

Good spot on the ‘.’ rather than the ‘,’