stijnb
(Stijn)
February 10, 2018, 7:23pm
1
Hi,
I just flashed a H801 led controller with the Tasmota firmware. Being new to MQTT I was hoping for a few pointers. I have my led strip connected to W1 on the H801 controller. Can someone help me create a working configuration? Currently the switch just toggles back to off in the HA interface, so I guess I did not add it correctly.
namadori
(Namadori)
February 10, 2018, 11:05pm
2
I replied on the other thread:
I’m not sure this is the best config, but for me it works. I’m using the W wire on the input side, in Tasmota it is PWM5, it must be enabled on the config page.
light:
- platform: mqtt
name: "Salotto Faretti"
state_topic: "stat/sonoffled-1/RESULT"
state_value_template: '{%- if value_json["PWM"]["PWM5"]| int > 0 -%} 1023 {%- else -%} 0 {%- endif -%}'
command_topic: "cmnd/sonoffled-1/PWM5"
on_command_type: 'brightness'
brightness_state_topic: "stat/sonoffled-1/RESULT"
…
2 Likes
Rosiaantje
(Sebastiaan Rosendaal)
February 11, 2018, 9:39am
3
Tnx a lot @namadori ! will try that! let you know if it did work!
stijnb
(Stijn)
February 11, 2018, 2:06pm
4
Thanks for your help @namadori !
I changed to your suggested config but it does not seem to work yet. Did you also change the full topic code in the sonoff MQTT configuration?
Thanks
Stijn
stijnb
(Stijn)
February 11, 2018, 2:35pm
5
Super I got it working!
This is my config for other people
light:
- platform: mqtt
name: "Keukenledstrip"
state_topic: "stat/keukenled/RESULT"
state_value_template: '{%- if value_json["PWM"]["PWM5"]| int > 0 -%} 1023 {%- else -%} 0 {%- endif -%}'
command_topic: "cmnd/keukenled/PWM5"
on_command_type: 'brightness'
brightness_state_topic: "stat/keukenled/RESULT"
brightness_command_topic: "cmnd/keukenled/PWM5"
brightness_value_template: '{{value_json["PWM"]["PWM5"]}}'
brightness_scale: 1023
qos: 0
payload_on: '1023'
payload_off: '0'
retain: true
optimistic: false
Thanks a lot for your help!
namadori
(Namadori)
February 11, 2018, 6:22pm
6
Glad you sorted it out. Just a notice: with your Sonoff configuration you are using the W1 and W2 output as a single logical unit. If you need to use them as independent channels, you should set GPIO4 to PWM4 and GPIO14 to PWM5.
2 Likes
stijnb
(Stijn)
August 23, 2020, 1:30pm
7
The new Tasmota has different options. Does anyone have any experience how this is supposed to be setup?