Mine flashed fine, problem is that Tasmota firmware has a ghost switching issue that makes the unit too unreliable for most of us. Maybe hang off if you can?
I concluded it wasnât the RF circuitry after all, although the undersized antenna probably doesnât help reliability. The most reliable solution to ghost switching is to pair an RF remote, then de-pair it and then re-pair it again. Sounds nuts, I know, but it sorta works. Mostly it works on the second re-pair, but a few folks have taken another attempt, and I seem to have the record with one taking 17 attempts IIRC. One guy didnât have an RF remote as he wasnât planning to use one, but borrowed one and successfully eliminated ghost switching. The only conclusion Iâve reached is that there is some poor initialisation in the next micro-controller in the chain - which I assume must be decoding the signals from the remote, interpreting the message, and holding the RF remote ID in flash. Unfortunately I donât have the tools to debug whats going on or reverse engineer whats coded into that one - it has the capability to operate in so many different modes, it defeated me! I guess Tasmota only loads onto the ESP8285 (U5), and no-one has got inside either U1 or U3(?)
The only final piece of advice I can offer, is that powering down the device can, sometimes but not always, lead to the RF pairing being lost, so you have to go through the pair, de-pair, repair fiasco again. Once its working, it seems pretty reliable. Fresh out of the box, its a PITA
ola ressussitando o grupo
estou tentando flasche aqui com o D1 dimmer com tasmosta nao estou conseguindo, alguem tem algum tutorial de como faz, tentei de tudo com o usb conversor e nao vaiâŚ
Just for the record, if you have one of these units and are suffering the ghost switching issue, and you also have no plans to buy or use the RF remote, you can do what I did, and carefully cut (or desolder) the chip that does the RF/serial translation from the board. Mines been working flawlessly for 5 weeks now.
Consegui fazer o D1 sonoff Dimmer com Tasmota na fw 3.5 com a fw do tasmota 8.40âŚ
obrigado a todos
e onde fica voce consegue mostrar pra gente onde fica, em foto por favor?
I also experienced the ghost switching of SONOFF D1 dimmers. Pairing-unpairing of the SONOFF RM433 did not work for one of the dimmers that was located in a not so convenient place to open-up again. Therefore, I implemented a software workaround in HA to set the dimmer to the latest correct dimmer level in case of ghost switching that seems to work pretty well:
Config.yaml:
In the config.yaml file I defined a dimmer that does not listen to the mqtt state topics of the D1; but the dimmer can be used to switch the dimmer on/off and set the dimlevel
light:
- platform: mqtt
name: âDimmer keukentafel - alleen cmndâ
# state_topic: âtele/tasmota_CF20A5/STATEâ
command_topic: âcmnd/tasmota_CF20A5/POWERâ
value_template: â{{value_json.POWER}}â
brightness_command_topic: âcmnd/tasmota_CF20A5/Dimmerâ
# brightness_state_topic: âtele/tasmota_CF20A5/STATEâ
brightness_scale: 100
on_command_type: âbrightnessâ
brightness_value_template: â{{value_json.Dimmer}}â
payload_on: âONâ
payload_off: âOFFâ
qos: 0
I added two sensors: one that tracks the dimmer level according to the Home Assistant dimmer we just defined; and one that listens to the state topic of the D1 device:
sensor:
#sensor to listen to D1 dimmer and track dimmer level (according to D1 dimmer itself)
- platform: mqtt
name: âDimwaarde volgens D1 dimmerâ
state_topic: âtele/tasmota_CF20A5/STATEâ
value_template: â{{value_json.Dimmer}}â
unit_of_measurement: â%â
qos: 0
#sensor to listen to HA dim level
- platform: template
sensors:
ha_dimlevel:
friendly_name: âDimwaarde volgens HAâ
value_template: â{{(state_attr(âlight.dimmer_keukentafel_alleen_cmndâ,âbrightnessâ)/2.55)|round(0)}}â
unit_of_measurement: â%â
I also defined a binary sensor that compares both sensor values
binary_sensor:
- platform: template
sensors:
d1_diff:
friendly_name: âD1 differenceâ
value_template: â{{states(âsensor.dimwaarde_volgens_d1_dimmerâ)| float == states(âsensor.ha_dimlevelâ)| float}}â
Automations.yaml
I defined an automation that is triggered if the D1 dimlevel changes outside of HA. For example, by changing the dimlevel in the Tasmota user interface (console); or due to a ghost switching event.
- id: â1607420694074â
alias: Bijstellen D1 dimstatus na ghost switching
description: ââ
trigger:- platform: state
entity_id: binary_sensor.d1_diff
to: âoffâ
condition: []
action: - service: mqtt.publish
data:
topic: cmnd/tasmota_CF20A5/Dimmer
payload_template: â{{(state_attr(âlight.dimmer_keukentafel_alleen_cmndâ,âbrightnessâ)/2.55)|round(0)}}â
mode: single
- platform: state
If I simulate a ghost switching event (by changing the dimlevel in the Tasmota UI to 11, while in HA itâs still 10), HA setâs the desired dimlevel (10) instantly:
16:39:04 CMD: dimmer 11
16:39:04 MQT: tele/tasmota_CF20A5/STATE = {âTimeâ:â2020-12-08T16:39:04â,âUptimeâ:â3T01:37:25â,âUptimeSecâ:265045,âHeapâ:26,âSleepModeâ:âDynamicâ,âSleepâ:10,âLoadAvgâ:99,âMqttCountâ:1,âPOWERâ:âONâ,âDimmerâ:11,âFadeâ:âOFFâ,âSpeedâ:1,âLedTableâ:âONâ,âWifiâ:{âAPâ:1,âSSIdâ:âZiggo8005069â,âBSSIdâ:â48:D3:43:FC:0E:09â,âChannelâ:11,âRSSIâ:78,âSignalâ:-61,âLinkCountâ:1,âDowntimeâ:â0T00:00:05â}}
16:39:04 MQT: stat/tasmota_CF20A5/RESULT = {âPOWERâ:âONâ,âDimmerâ:11}
16:39:04 MQT: tele/tasmota_CF20A5/STATE = {âTimeâ:â2020-12-08T16:39:04â,âUptimeâ:â3T01:37:25â,âUptimeSecâ:265045,âHeapâ:26,âSleepModeâ:âDynamicâ,âSleepâ:10,âLoadAvgâ:99,âMqttCountâ:1,âPOWERâ:âONâ,âDimmerâ:10,âFadeâ:âOFFâ,âSpeedâ:1,âLedTableâ:âONâ,âWifiâ:{âAPâ:1,âSSIdâ:âZiggo8005069â,âBSSIdâ:â48:D3:43:FC:0E:09â,âChannelâ:11,âRSSIâ:78,âSignalâ:-61,âLinkCountâ:1,âDowntimeâ:â0T00:00:05â}}
16:39:04 MQT: stat/tasmota_CF20A5/RESULT = {âPOWERâ:âONâ,âDimmerâ:10}
I just realized this helps to correct ghost switch events that change the dimlevel; but does not correct for undesired on/off events.
update: for those interested, I made some modifications such that also unwanted on/off ghost switching events are corrected by HA:
configuration.yaml
#sensor to listen to D1 dimmer and track dimmer level (according to D1 dimmer itself)
-
platform: mqtt
name: âDimwaarde volgens D1 dimmerâ
state_topic: âtele/tasmota_CF20A5/STATEâ
value_template: â{{value_json.Dimmer}}â
unit_of_measurement: â%â
qos: 0 -
platform: mqtt
name: âAanUit volgens D1 dimmerâ
state_topic: âtele/tasmota_CF20A5/STATEâ
value_template: â{{value_json.POWER}}â
qos: 0
#sensor to listen to HA dim level
- platform: template
sensors:
ha_dimlevel:
friendly_name: âDimwaarde volgens HAâ
value_template: â{{(state_attr(âlight.dimmer_keukentafel_alleen_cmndâ,âbrightnessâ)/2.55)|round(0)}}â
unit_of_measurement: â%â
ha_aanuit:
friendly_name: âAanUit volgens HAâ
value_template: â{{states(âlight.dimmer_keukentafel_alleen_cmndâ)}}â
binary_sensor:
- platform: template
sensors:
d1_diff:
friendly_name: âD1 differenceâ
value_template: â{{states(âsensor.dimwaarde_volgens_d1_dimmerâ)| float == states(âsensor.ha_dimlevelâ)| float}}â
d1_power_ha:
friendly_name: âD1 power state - volgens haâ
value_template: â{{is_state(âsensor.ha_aanuitâ,âonâ)}}â
d1_power_d1:
friendly_name: âD1 power state - volgens D1â
value_template: â{{states(âsensor.aanuit_volgens_d1_dimmerâ) == âONâ}}â
automations.yaml
-
id: â1607504275725â
alias: Bijstellen D1 powerstatus na ghost switching
description: ââ
trigger:- platform: state
entity_id: binary_sensor.d1_power_d1
condition: []
action: - choose:
- conditions:
- condition: state
entity_id: binary_sensor.d1_power_d1
state: âonâ - condition: state
entity_id: binary_sensor.d1_power_ha
state: âoffâ
sequence: - service: light.turn_off
data: {}
entity_id: light.dimmer_keukentafel_alleen_cmnd
- condition: state
- conditions:
- condition: state
entity_id: binary_sensor.d1_power_d1
state: âoffâ - condition: state
entity_id: binary_sensor.d1_power_ha
state: âonâ
sequence: - service: light.turn_on
data: {}
entity_id: light.dimmer_keukentafel_alleen_cmnd
default: []
mode: single
- condition: state
- conditions:
- platform: state
-
id: â1607420694074â
alias: Bijstellen D1 dimstatus na ghost switching
description: ââ
trigger:- platform: state
entity_id: binary_sensor.d1_diff
to: âoffâ
condition: []
action: - service: mqtt.publish
data:
topic: cmnd/tasmota_CF20A5/Dimmer
payload_template: â{{(state_attr(âlight.dimmer_keukentafel_alleen_cmndâ,âbrightnessâ)/2.55)|round(0)}}â
mode: single
- platform: state
Iâm pretty new to HA, so I know that this implementation might not be the most efficient/elegant one
Hi all,
I went trough this topic and cannot find straight answer.
Does Tasmota and D1 dimmer support HW button on GPIO00? Iâm wondering if it is possible to control D1 with MQTT/RF/Whatever + HW button.
BR
The GPIO 0 is also connected to the left S1 pin. The other side of the S1 pad is connected to GND.
So, if we add a pushbutton to S1, I expect to have the same behavior as the other Sonoff devices.
The pushbutton is connected. With original FW, short presses switch On/Off, a long press dims up and down continuously. The button can be used to flash the device. In Tasmota, there is no function.