I confirm that the WiFi Dimmer working fine after flash Sonoff-Tasmota 6.6.0.9 with tuya-convert
I flashed my dimmer switch OTA with Tasmota, set up in HA as an MQTT dimmer light. I have the HA cloud subscription, but for some reason this light does not show up for me in Alexa as a device.
Is it show up for you Guys in Alexa?
The device works and can be controller properly via the HA interface and my similar Tasmota power strip shows up in Alexa as a device.
Thank you!
I ended up resoldering a header and flashing again with your image. The wifi AP shows up in my list but when I connect it won’t load the web GUI. I flashed back to tasmota latest and it allowed me to hop back on the AP and modify it. I used the Martin Jerry C revision bin.
I wish this would just work on tasmota but it doesn’t seem to turn the power on when changing brightness… and the LEDs don’t look synced properly.
Maybe it will work better when the code is in HA.
Flash any 8.x minimal then flashed the fork bin. Or you can flash that dimmer via serial without any soldering.
@digiblur the problem is your forked bin starts an AP but I cannot get into the web GUI with any of my devices… not sure why. I already have a header resoldered, so I can flash again as needed.
That sounds like a bad flash possibly as the fork doesn’t modify that part of Tasmota. Plug up the wires with no soldering and call it a day. Pics are here. https://www.digiblur.com/2019/08/tuya-convert-whats-next-solderless.html
Only two of the 6 holes on my board are through holed. The rest are only on the top layer of the PCB. This was just ordered last week so I am not sure if it has changed. They are surface only pads, that I had to solder. There was no other through holes on the PCB either. I will snap a photo tonight.
I’ll try the flash again, but I did it twice with the same result. Maybe something else has changed in the chipset.
Multiple flashes of the “C” revision bin today resulted in the same thing. I connected to the Access Point, but the WEBGUI will not load. I cannot ping the gateway at all (192.168.4.1)
I tried the “B” revision as well, with no luck. While looking at the github and tasmota resources I noticed the MODEL on their screenshots was some long number. The Tuya chip on my dimmer says SD0X but the part number is the same TYWE3S.
Also, on the back of the chip the online screenshots say 1809 but this one is 1934. It’s a different revision of the PCB and the AP mode isn’t working right.
I have the WF-DS01. Really solid, well made. Good for tinkering because the mcu board unplugs from the power board. Power it separately for safe tinkering, then plug back in.
I custom modified it to control a bedside lamp with a TTP223 touch sensor on GPIO13 connected to the metalwork. Can now set 4 levels of brightness with instant touch, or use the up/down buttons on the WF-DS01.
I tried tasmota for a while but found it to be too slow to respond to touch (cpu load too high?). Really happy with the eventual ESPHome solution:
# ESPHome config for TuyaMCU based dimmer WF-DS01
# Dave T 2020-10-31
# Includes:
# - full control of dimmer through home assistant
# - green LED visible under '+' touch input for status/error indication
# - secondary touch input for use with TTP233 style touch sensor
# (e.g. connected to metalwork of table lamp), with 4 level instant
# dimmer levels.
# - auto full-off of lamp if brightness set to very low value.
#
esphome:
name: lampd2
platform: ESP8266
board: esp01_1m
wifi:
domain: .local
ssid: "redacted"
password: "redacted"
# Enable logging
logger:
baud_rate: 0
level: DEBUG
logs:
sensor: ERROR
duty_cycle: ERROR
binary_sensor: ERROR
light: ERROR
# Enable Home Assistant API
api:
ota:
web_server:
tuya:
time:
- platform: homeassistant
substitutions:
lamp_id: "Lamp D2"
# Uart definition to talk to MCU dimmer
uart:
tx_pin: GPIO1
rx_pin: GPIO3
stop_bits: 1
baud_rate: 9600
sensor:
# wifi Signal strength
- platform: wifi_signal
name: "${lamp_id} WiFi Signal Sensor"
update_interval: 60s
# Internal measure of brightness to allow switch to full off when v low.
- platform: template
name: "Brightness sensor"
id: "brightness_internal"
update_interval: 5s
internal: True
lambda: |-
float brightness;
id(light_main).current_values_as_brightness( &brightness );
return brightness;
on_value_range:
below: 0.1
then:
- light.turn_off: light_main
# Status indicator using green LED (slow on warning, fast on error)
status_led:
pin: GPIO14
# Uncomment if you wnat full control of the built in green LED
# output:
# - platform: esp8266_pwm
# pin: GPIO14
# frequency: 800 Hz
# id: dummy_pwm
# Primary Light object exposed to HA
light:
- platform: tuya
id: light_main
name: "${lamp_id} Light"
dimmer_datapoint: 2
switch_datapoint: 1
# Uncomment for full brightness control of green LED
# - platform: monochromatic
# default_transition_length: 500ms
# name: "${lamp_id} Green LED"
# output: dummy_pwm
# id: light_green
# internal: True
# effects:
# # Experimental throbbing effect for green LED
# - lambda:
# name: Throb
# update_interval: 1s
# lambda: |-
# static int state = 0;
# auto call = id(light_green).turn_on();
# // Transtion of 1000ms = 1s
# call.set_transition_length(1000);
# if (state == 0) {
# call.set_brightness(1.0);
# } else if (state == 1) {
# call.set_brightness(0.0);
# }
# call.perform();
# state += 1;
# if (state >= 2)
# state = 0;
# touch input switch e.g. TTP223 to set specific brightness levels.
binary_sensor:
- platform: gpio
pin: GPIO13
id: touch_switch
name: "${lamp_id} Touch Switch"
internal: True
on_press:
then:
- lambda: |-
const float L0 = 0.02f;
const float L1 = 0.2f;
const float L2 = 0.5f;
const float L3 = 1.0f;
float brightness;
auto call = id(light_main).turn_on();
id(light_main).current_values_as_brightness( &brightness );
if( brightness < (L1-0.02))
{
ESP_LOGD("test", "L1");
brightness = L1;
}
else if(brightness < L2-0.02)
{
ESP_LOGD("test", "L2");
brightness = L2;
}
else if (brightness < L3-0.02)
{
ESP_LOGD("test", "L3");
brightness = L3;
}
else
{
ESP_LOGD("test", "L0");
brightness = L0;
}
call.set_brightness( brightness );
call.perform();
# A HA accessible reboot switch if wanted.
# switch:
# - platform: restart
# name: "${lamp_id} Restart"
A slight weirdness (so far seems unavoidable) is that the TuyaMCU has a built in slow fade when you turn the device off. This seems to ignore the HA or esphome instruction. But I can live with that.