Costco Feit Smart Dimmer Tuya Convert Tasmota

Picked up a couple Wi-Fi dimmers at Costco for $24.99 on sale. These will control my outside lights which currently are Zigbee Sengled bulbs. The Sengled bulbs are not rated for outside use and I have Zigbee coverage issues. I plan to replace my existing switches with these and use dimmable LED bulbs in the outdoor fixtures. On the back is Intertek 5014010 FCC ID: BYW-DIMWIFI IC:20416-DIMWIFI

image

1 Like

Note: Tuya released a patch a while back, the patched dimmers must be flashed by un-soldering the chip to flash it. Patch info here.

Flashing these to Tasmota and configuring in Home Assistant involve reading the guides and following instructions. All the information below is in the tuya-convert and Tasmota wiki’s.

  • Used the Raspberry Pi 3B / 3B+ with Raspbian Stretch and its internal Wifi chip method at tuya-convert
  • Dimmer configuration after flashing at Tasmota Docs
  • Dimmer config in Home Assistant at Tasmota wiki

The version 0f tuya-convert used was v2.3.0. This version gives the choice between Tasmota v7.0.0.3 or ESPurna 1.13.5 firmware images. (Others can be added) Having no experience with either after a bit of research picked Tasmota.

After running tuya-convert and configuring the Wi-Fi on the dimmer, select Module Type 54.

Configure MQTT

Go to the terminal page and watch for fnId to dpId mapping. After selecting Module Type 54 we get a mapping for the switch by default:

Nov 28 14:45:20 dimmer2-4837 ESP-TYA: fnId=11 is set for dpId=1

but we see the dimmer is not mapped:

Nov 28 14:44:56 dimmer2-4837 ESP-TYA: fnId=0 is set for dpId=2

According to the Tasmota docs we use fnId 21 for the dimmer. Run this command in the console to set that mapping.

TuyaMCU 21,2

Verify the mapping shows in the logs:

Nov 28 15:08:04 dimmer2-4837 ESP-TYA: fnId=21 is set for dpId=2

Now run the dimmer to min and max ranges using the buttons while watching the log.

Nov 28 15:14:56 dimmer2-4837 ESP-TYA: RX Dim State=10
Nov 28 15:15:51 dimmer2-4837 ESP-TYA: RX Dim State=1000

Run this command to set min/max dim

DimmerRange 10,1000

Configure sending of state and power MQTT messages:

SetOption59 1

I am still configuring Home Assistant via the yaml files so my switches.yaml file looks like this:

- platform: mqtt
  name: "Dimmer 2"
  command_topic: "cmnd/dimmer2/POWER"
  state_topic: "tele/dimmer2/STATE"
  state_value_template: "{{value_json.POWER}}"
  availability_topic: "tele/dimmer2/LWT"
  brightness_command_topic: "cmnd/dimmer2/Dimmer"
  brightness_state_topic: "tele/dimmer2/STATE"
  brightness_scale: 100
  on_command_type: "brightness"
  brightness_value_template: "{{value_json.Dimmer}}"
  payload_on: "ON"
  payload_off: "OFF"
  payload_available: "Online"
  payload_not_available: "Offline"
  qos: 1
  retain: false

Andy

3 Likes

I also bought these and your post helped me identify the GPIOs used for RX and TX between the tuya chip and the MCU. Thanks.

I used ESPHome which requires disabling logging and specifying the uart thusly:

esphome:
  name: dining_room_dimmer
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "YOUR_WIFI_SSID"
  password: "YOUR DOUBLE SECRET PASSWORD"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Dining Room Dimmer"
    password: "4eza0diuQE6s"

captive_portal:

# Make sure logging is not using the serial port

## EDIT: baud rate 0 still seems to cause issues with
## flickering lights and checksum errors in the logs
## I'm now using level: NONE
logger:
  baud_rate: 0
  level: NONE
  
# Enable Home Assistant API
api:

# Make sure you can upload new firmware OTA
ota:

# My dimmer used this hardware serial port
uart:
  rx_pin: GPIO3
  tx_pin: GPIO1
  baud_rate: 9600

# Register the Tuya MCU connection
tuya:

# Make the light
# Not sure about the minimum dimming range here, 0 might be too low
light:
  - platform: "tuya"
    name: "dining_dimmer"
    dimmer_datapoint: 2
    switch_datapoint: 1
    min_value: 0
    max_value: 1000
2 Likes

Thanks, that worked perfectly for me. I haven’t put the dimmer into service, but so far It’s not bad. The quality of the dimming seems good.

I haven’t liked any of the other Tuya based dimmers so far. The problems with the others are mostly what I consider to be user interface defects, such as not being able to turn the switch off blindly (behind a door, for instance) without changing the dimmer level, non-intuitive buttons, and too many brightly colored LEDs.

This one isn’t perfect, but, I hope, might be a little better than the others.

Hi @mxr662, great guide! I picked these switches up and was about halfway though the same process when I found your write up so its good to know im on the right track. One thing I was curious about, did you ever run into the issue where you would see the switch status (i.e. On/Off) in the Tasmota webpage but you could not command the switch via the toggle button there? I seem to have status flowing from the MCU but none of my commands are going out (or they are being ignored…).

Yes saw that, could never pin down what had happened enough to open an issue with tasmota.

Put the weblog in debug with “weblog 4”

16:19:00 MQT: stat/dimmer2/RESULT = {"WebLog":4}

Run the TuyaMCU cmd with no options to see the mapping.

16:08:24 MQT: stat/dimmer2/RESULT = {"TuyaMCU":[{"fnId":11,"dpId":1},{"fnId":21,"dpId":2}]}

When I started out configuring the dimmers I would run the “TuyaMCU 11,1” command even though 11 was already mapped to 1. Then would end up where the toggle did not work. Not saying that this is why, but just how it ended up. Also it seemed like when it was unplugged for a while and came back to work on it, the toggle would work. Configured the remaining 3 dimmers following the steps in my original post with no problems.

Andy

Thanks @mxr662, you were right, if you let it sit or power cycle the whole unit the control comes back. I’m wondering if the MCU gets some garbage in its input buffer that puts it in a bad state when we are playing with the ESP pins during configuration. Anyhow, with that fixed I was able to get everything connected to HASS and even Google Assistant so thanks.

I am noticing another issue with either the MCU or the Tasmota FW. It seems the FW does not update with every press of the switch button and thus HASS and Google do not either. Instead it takes two cycles to get the FW to update and trigger an update in HASS. For example:

  1. Press Button -> Switch lights On, FW updates to On
  2. Press Button -> Switch lights Off, FW stays On
  3. Press Button -> Switch lights On, FW stays On
  4. Press Button -> Switch lights Off, FW updates to Off

A little annotated console output:

********** NOTE: About 00:48:34 First Button Press to turn ON 
00:48:34 MQT: Device-Dimmer-MasterBedroom/tele/HASS_STATE = {"Version":"7.1.2(tasmota)","BuildDateTime":"2019-12-06T11:22:22","Core":"2_6_1","SDK":"2.2.2-dev(38a443e)","Module":"Tuya MCU","RestartReason":"Power on","Uptime":"0T00:10:02","WiFi LinkCount":1,"WiFi Downtime":"0T00:00:07","MqttCount":1,"BootCount":21,"SaveCount":246,"IPAddress":"172.16.1.107","RSSI":"80","LoadAvg":19}
00:48:36 {"TuyaReceived":{"Data":"55AA03070005010100010112","Cmnd":7,"CmndData":"0101000101","DpId":1,"DpIdType":1,"DpIdData":"01"}}
00:48:36 TYA: fnId=11 is set for dpId=1
00:48:36 TYA: RX Relay-1 --> MCU State: On Current State:Off
00:48:36 SRC: Switch
00:48:36 TYA: Send dim value=329 (id=2)
00:48:36 TYA: Send "55aa0006000802020004000001495f"
00:48:36 MQT: Device-Dimmer-MasterBedroom/tele/STATE = {"Time":"2019-12-12T00:48:36","Uptime":"0T00:10:04","UptimeSec":604,"Heap":27,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":25,"MqttCount":1,"POWER":"ON","Dimmer":33,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"Jingleheimer-IoT","BSSId":"00:16:B6:EB:8F:68","Channel":1,"RSSI":80,"LinkCount":1,"Downtime":"0T00:00:07"}}
00:48:36 MQT: Device-Dimmer-MasterBedroom/stat/RESULT = {"POWER":"ON"}
00:48:36 MQT: Device-Dimmer-MasterBedroom/stat/POWER = ON
00:48:36 {"TuyaReceived":{"Data":"55AA03070008020200040000014963","Cmnd":7,"CmndData":"0202000400000149","DpId":2,"DpIdType":2,"DpIdData":"00000149"}}
00:48:36 TYA: fnId=21 is set for dpId=2
00:48:36 TYA: RX Dim State=329
00:48:36 CFG: Saved to flash at F6, Count 247, Bytes 4096
00:48:37 TYA: Send "55aa00000000ff"
00:48:37 {"TuyaReceived":{"Data":"55AA030000010104","Cmnd":0,"CmndData":"01"}}
00:48:37 TYA: Heartbeat
00:48:40 WIF: Checking connection...
00:48:40 WIF: Connected
********** NOTE: About 00:48:40 Second Button Press to turn OFF
********** NOTE: About 00:48:45 Third Button Press to turn ON
00:48:45 MQT: Device-Dimmer-MasterBedroom/tele/STATE = {"Time":"2019-12-12T00:48:45","Uptime":"0T00:10:13","UptimeSec":613,"Heap":27,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":67,"MqttCount":1,"POWER":"ON","Dimmer":33,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"Jingleheimer-IoT","BSSId":"00:16:B6:EB:8F:68","Channel":1,"RSSI":74,"LinkCount":1,"Downtime":"0T00:00:07"}}
00:48:45 {"TuyaReceived":{"Data":"55AA03070008020200040000014A64","Cmnd":7,"CmndData":"020200040000014A","DpId":2,"DpIdType":2,"DpIdData":"0000014A"}}
00:48:45 TYA: fnId=21 is set for dpId=2
00:48:45 TYA: RX Dim State=330
00:48:48 TYA: Send "55aa00000000ff"
00:48:48 {"TuyaReceived":{"Data":"55AA030000010104","Cmnd":0,"CmndData":"01"}}
00:48:48 TYA: Heartbeat
********** NOTE: About 00:48:50 Fourth Button Press to turn OFF
00:48:50 {"TuyaReceived":{"Data":"55AA03070005010100010011","Cmnd":7,"CmndData":"0101000100","DpId":1,"DpIdType":1,"DpIdData":"00"}}
00:48:50 TYA: fnId=11 is set for dpId=1
00:48:50 TYA: RX Relay-1 --> MCU State: Off Current State:On
00:48:50 SRC: Switch
00:48:50 TYA: Send dim skipped value=0
00:48:50 MQT: Device-Dimmer-MasterBedroom/tele/STATE = {"Time":"2019-12-12T00:48:50","Uptime":"0T00:10:18","UptimeSec":618,"Heap":27,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":87,"MqttCount":1,"POWER":"OFF","Dimmer":33,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"Jingleheimer-IoT","BSSId":"00:16:B6:EB:8F:68","Channel":1,"RSSI":70,"LinkCount":1,"Downtime":"0T00:00:07"}}
00:48:50 MQT: Device-Dimmer-MasterBedroom/stat/RESULT = {"POWER":"OFF"}
00:48:50 MQT: Device-Dimmer-MasterBedroom/stat/POWER = OFF
00:48:51 CFG: Saved to flash at F5, Count 248, Bytes 4096

Given this Im going to try ESPHome and see if its an MCU issue or Tasmota issue (before filing a defect).

@backcountrymountains in setting up ESPHome, what did you select for the board type? I’ve got this as my current configuration but figured I’d ask before flashing:

esphome:
  name: maser_bedroom_dimmer
  platform: ESP8266
  board: esp8285

wifi:
  ssid: 
  password: 

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: 
    password: 

captive_portal:

# Make sure logging is not using the serial port
logger:
  baud_rate: 0
  level: VERBOSE

# Enable Home Assistant API
api:
  password: 

ota:
  password: 

# My dimmer used the hardware serial port on the alternate pins
uart:
  rx_pin: GPIO3
  tx_pin: GPIO1
  baud_rate: 9600

# Register the Tuya MCU connection
tuya:

# Make the light
light:
  - platform: "tuya"
    name: "Dimmer"
    dimmer_datapoint: 2
    switch_datapoint: 1
    min_value: 10
    max_value: 1000

Thanks all again!

Just bought these. Thanks for the info

Went back and got a couple more dimmers, can’t get the serial connection to the MCU working. More info here.

Heartbeat response – working

00:12:26 TYA: Send "55aa00000000ff"
00:12:26 {"TuyaReceived":{"Data":"55AA030000010104","Cmnd":0,"CmndData":"01"}}
00:12:26 TYA: Heartbeat

No heartbeat response – not working

00:13:44 TYA: Send "55aa00000000ff"
00:13:55 TYA: Send "55aa00000000ff"
00:13:56 WIF: Checking connection...
00:13:56 WIF: Connected
00:14:06 TYA: Send "55aa00000000ff"
00:14:16 WIF: Checking connection...
00:14:16 WIF: Connected

@Jingleheimer Yes I see the missed updates on my dimmers also. Tried Tasmota 7.1.2 and have the same results. Is ESP Home working better?

@Brenton Do not like the delay of the ZWave dimmer I have. At least the lighted circle reminds me to push the bottom of the switch to turn it on.

I flashed another dimmer to Tasmota and fully configured it. It stayed in the odd state where the MCU was not communication like @Jingleheimer reported. Tried upgrading Tasmota to 7.1.2, resetting, and downgrading. Had to power cycle to get it working.
Andy

@mxr662, yea I transitioned over to ESPHome and it seems much more stable on these dimmers. Everything seems pretty rock solid, the only issue I have seen is that if you command a dimmer value when the switch is off occasionally it wont turn on automatically. I picked up a few more dimmers as well and will be flashing them soon hopefully.

Migrating to ESPHome was pretty easy but a little more confusing than Tasmota. You wind up defining your YAML config then compiling that into a firmware .bin file and using their command-line tools to upload (if you have hass.io there is an alternate upgrade path that is easier from what I read)

I was pretty happy with the way ESPHome integrated with HASS as well, it was pretty seamless when you use the ESPHome API and discovery was painless, plus when using the API, you dont have any delay from MQTT so its very responsive.

For reference, here is the ESPHome configuration I have been using based off of @backcountrymountains post above:

esphome:
  name: dimmer
  platform: ESP8266
  board: esp8285

wifi:
  ssid: "Wifi Name"
  password: "wifi password"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Dimmer Fallback Hotspot"
    password: "password"

captive_portal:

# Make sure logging is not using the serial port
logger:
  baud_rate: 0
  level: VERBOSE

# Enable Home Assistant API
api:
  password: "Password to access node from HASS"

ota:
  safe_mode: True
  password: "Password to upgrade firmware"

# My dimmer used the hardware serial port on the alternate pins
uart:
  rx_pin: GPIO3
  tx_pin: GPIO1
  baud_rate: 9600

# Register the Tuya MCU connection
tuya:

# Make the light
light:
  - platform: "tuya"
    name: "Dimmer"
    dimmer_datapoint: 2
    switch_datapoint: 1
    min_value: 10
    max_value: 1000

2 Likes

Hi,

I edited my post to actually have my whole esphome config, which I should’ve posted in the first place.

One thing that I have noticed is that when setting logger to

level: VERBOSE

the logs showed some checksum errors in communications between the esp device and the MCU and the lights would occasionally flicker. Not sure if those are related but I think setting the logger to

level: NONE

seems to have solved both issues. Maybe.

1 Like

I found I had to cycle power on my switches after major config changes before anything would work as expected — just rebooting the device didn’t seem to do it. I was going a little crazy before I started doing that — flashing different versions of tasmota, for instance, thinking that the version was the cause of the flakiness.

I still haven’t put my switches into service, so I don’t know if they are reliable yet. They seem to work fine in home assistant using mqtt in my tests.

I like the white circle on the button face, although I’d like to find a way to turn it off when the switch is off for nighttime bedroom use.

1 Like

I just randomly picked up 2 of these today as well. I really would like to figure out of to turn the led off. Let me know if you guys figure anything out.

1 Like

@backcountrymountains Thank you so much for sharing your ESPHome configuration for these. I got one set up today and it was quick and painless.

I would echo @Jsweet2176’s question around whether anyone has figured out how the circular LED is controlled in order to selectively turn it off, but not a huge deal.

So is this a buy now price? They need the firmware changed? I’ve never changed firmware and I’m running Hassio. Can I change the firmware from a Ubuntu computer?

At my Costco today, I saw some more of these, @Matronek - they are not on sale for $24 anymore but the regular price is $29.99 which is still extremely good for a two-pack of smart dimmer switches.

You can change the firmware using any computer where the Wi-Fi adapter can be used to create a network rather than connect to one. I am using the same Raspberry Pi I use for Hassio, and just using a second SD card with Raspbian on it to temporarily take Hassio down and use Raspbian to flash new firmware using Tuya-Convert. Once you’ve done that you’re free to do whatever you want with the device. In my case, I initially flashed Tasmota using Tuya-Convert and then created a configuration in ESPHome to flash over that.

I’d definitely recommend starting at https://github.com/ct-Open-Source/tuya-convert to get the full instructions on how to get started.

Still using Tasmota. The dimmer that controls the outside lights is stable, but it is controlled but HA and not user operated. The state of the office lights is often not correct due to button presses.

Hi guys,

I flashed two of these with tasmota 8.1.0 and cant seem to get them to work, no dimmer or relay on/off. I follow the guide in the original post by @mxr662 also in conjuncture with this youtube video https://www.youtube.com/watch?v=_3WW4NVYHrU&feature=youtu.be&t=381

My log shows:

09:43:54 TYA: Send “55aa00000000ff”
09:44:05 TYA: Send “55aa00000000ff”
09:44:07 WIF: Checking connection…
09:44:07 WIF: Connected
09:44:16 TYA: Send “55aa00000000ff”
09:44:27 WIF: Checking connection…
09:44:27 WIF: Connected
09:44:27 TYA: Send “55aa00000000ff”
09:44:38 TYA: Send “55aa00000000ff”
09:44:47 WIF: Checking connection…
09:44:47 WIF: Connected
09:44:49 TYA: Send “55aa00000000ff”

I am not getting the “heart beat” communication response like in the video. Seem like without the heart beat receive reply it doesnt work at all. I also tried to remap the pins in the module configuration too without success.

Any suggestions? I think i did everything correctly. Thanks.

Did you power cycle by disconnecting the power from the dimmer? That is what solved the issue for me.

I upgraded a dimmer to 8.1, but the status is still not always reported when the dimmer is operated manually.

Andy

2 Likes