[SOLVED] Problem with Sonoff T1 CH2 and MQTT v2

Hello,

i have a problem with the sonoff t1 ch2 and the mqtt v2 binding.

i have running a lot of sonoff t1 ch1, these are working, but the sonoff t1 ch2 are not.

Here an example:

sonoff t1 ch1:

	Thing topic Sonoff_Touch_GF_Bath "Sonoff Touch Bad EG" @ "Bad EG" {
		Channels:
			Type string : reachable "Reachable"            [ stateTopic="tele/Sonoff-Touch-Bad/LWT" ]
			Type switch : power     "Power"                [ stateTopic="stat/Sonoff-Touch-Bad/POWER", commandTopic="cmnd/Sonoff-Touch-Bad/POWER" ]
			Type number : rssi      "WiFi Signal Strength" [ stateTopic="tele/Sonoff-Touch-Bad/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI"]

This one are working.

sonoff t1 ch2:

	Thing topic Sonoff_Touch_GF_Living_2 "Sonoff Touch Wohnzimmer und Essbereich" @ "Wohnzimmer" {
		Channels:
			Type string : reachable "Reachable"            [ stateTopic="tele/Sonoff_Touch_GF_Living/LWT" ]
			Type switch : power2    "Wohnzimmer"           [ stateTopic="stat/Sonoff_Touch_GF_Living:POWER2", commandTopic="cmnd/Sonoff_Touch_GF_Living:POWER2" ]
			Type number : rssi      "WiFi Signal Strength" [ stateTopic="tele/Sonoff_Touch_GF_Living/STATE",  transformationPattern="JSONPATH:$.Wifi.RSSI"]
    }
	Thing topic Sonoff_Touch_GF_Eat_2 "Sonoff Touch Wohnzimmer und Essbereich" @ "Essbereich" {
		Channels:
			Type string : reachable "Reachable"            [ stateTopic="tele/Sonoff_Touch_GF_Living/LWT" ]
			Type switch : power1    "Essbereich"           [ stateTopic="stat/Sonoff_Touch_GF_Living:POWER1", commandTopic="cmnd/Sonoff_Touch_GF_Living:POWER1" ]
    }

this are not working.

Can someone tell me what is wrong in the syntax?

this is the code from mqtt v1, this is working:

Switch Sonoff_Touch_GF_Eat									"Essbereich"									<light>			(GF_Eat, Lights, Lampe)						{mqtt=">[mosquitto:cmnd/Sonoff-Touch-Wohnzimmer/POWER1:command:*:default],<[mosquitto:stat/Sonoff-Touch-Wohnzimmer/POWER1:state:default]"}
Switch Sonoff_Touch_GF_Living								"Wohnzimmer"									<light>			(GF_Living, Lights, Lampe)					{mqtt=">[mosquitto:cmnd/Sonoff-Touch-Wohnzimmer/POWER2:command:*:default],<[mosquitto:stat/Sonoff-Touch-Wohnzimmer/POWER2:state:default]"}

Kind regards,
Martin

You used a different topic for the dual device, did you change that on the device as well?

the topic is Sonoff-Touch-Wohnzimmer, and the Power1 and Power2 is default, because it has 2 switch to turn off an on

you have wrong topic
there is no : in topic

this is wrong

correct is this

stateTopic="stat/Sonoff_Touch_GF_Living/POWER2", commandTopic="cmnd/Sonoff_Touch_GF_Living/POWER2"

i see, i have changed it, but also not working, it is only working with the mqtt v1

do it as one item (and you are missing broker in your thing example as well)

this is for 3ch

Thing mqtt:topic:WallSwitchHall "WallSwitch Light Hall" (mqtt:broker:home) @ "Hall" {
Channels:
    Type switch : hall          "Hall Lights"           [ stateTopic="home/hallfloor/light/stat/POWER1", commandTopic="home/hallfloor/light/cmnd/POWER1", on="ON", off="OFF" ]
    Type switch : stairs        "Stairs Lights"         [ stateTopic="home/hallfloor/light/stat/POWER2", commandTopic="home/hallfloor/light/cmnd/POWER2", on="ON", off="OFF" ]
    Type switch : entrance      "Entrance Hall Lights"  [ stateTopic="home/hallfloor/light/stat/POWER3", commandTopic="home/hallfloor/light/cmnd/POWER3", on="ON", off="OFF" ]
}

in the thing file i have the broker on the first line, all other things are working in this file, i have a lot of mqtt items.

i have changed now to:

			Type string : reachable "Reachable"            [ stateTopic="tele/Sonoff_Touch_GF_Living/LWT" ]
			Type switch : power1    "Essbereich"           [ stateTopic="stat/Sonoff_Touch_GF_Living/POWER1", commandTopic="cmnd/Sonoff_Touch_GF_Living/POWER1", on="ON", off="OFF" ]
    		Type switch : power2    "Wohnzimmer"	       [ stateTopic="stat/Sonoff_Touch_GF_Living/POWER2", commandTopic="cmnd/Sonoff_Touch_GF_Living/POWER2", on="ON", off="OFF" ]

and the item to:

Switch Sonoff_Touch_GF_Living_21   							"Test1"             							<light>                                                 	   {channel="mqtt:topic:mosquitto:Sonoff_Touch_GF_Living_2:power1"}
Switch Sonoff_Touch_GF_Living_22   							"Test2"             							<light>                                                 	   {channel="mqtt:topic:mosquitto:Sonoff_Touch_GF_Living_2:power2"}

the item changing to on and off, but the light is not going on :neutral_face:

i also tried with removing the , on=“ON”, off=“OFF”

these are my settings on tasmota:

i know whats wrong, the wrong topic, thank you very much for the help.

this are the right syntax:

	Thing topic Sonoff_Touch_GF_Living_and_Eat "Sonoff Touch Wohnzimmer und Essbereich" @ "Wohnzimmer" {
		Channels:
			Type string : reachable "Reachable"            [ stateTopic="tele/Sonoff-Touch-Wohnzimmer/LWT" ]
			Type switch : power1    "Essbereich"           [ stateTopic="stat/Sonoff-Touch-Wohnzimmer/POWER1", commandTopic="cmnd/Sonoff-Touch-Wohnzimmer/POWER1", on="ON", off="OFF"  ]
			Type switch : power2    "Wohnzimmer"           [ stateTopic="stat/Sonoff-Touch-Wohnzimmer/POWER2", commandTopic="cmnd/Sonoff-Touch-Wohnzimmer/POWER2", on="ON", off="OFF"  ]
			Type number : rssi      "WiFi Signal Strength" [ stateTopic="tele/Sonoff-Touch-Wohnzimmer/STATE",  transformationPattern="JSONPATH:$.Wifi.RSSI"]
    }

As I tried to tell you!

1 Like