[SOLVED] Openhab to switch a flashed Gosund Power plug - issues


I successfully flashed a set of Gosung power plus with Tasmota.
I want

  • to switch the plug On and offI
  • to display current power consumption => WORKING
  • later: a rule which is sending some notification if washing machine is finished

I am struggling with the switch topic.

This is my items declaration (all numbers are working)

/* WLAN */

Switch	Dose_WaMa_Switch		"Waschmaschine"	    <switch>		(gKE_Naehen)	{ mqtt=">[mymosquitto:Dose-WaMa/relay/0:command:OFF:0], >[mymosquitto:Dose-WaMa/relay/0:command:ON:1], <[mymosquitto:Dose-WaMa/status:state:default]" }
Number	Dose_WaMa_Power	    "Leistung [%.0f W]"		<owntemperature>	(gKE_Naehen)	{ mqtt="<[mymosquitto:Dose-WaMa/power:state:default]" }
Number	Dose_WaMa_Voltage	    "Spannung [%.0f V]"		<owntemperature>	(gKE_Naehen)	{ mqtt="<[mymosquitto:Dose-WaMa/voltage:state:default]" }
Number	Dose_WaMa_Energy	    "Verbrauch [%.3f kWh]"		<owntemperature>	(gKE_Naehen)	{ mqtt="<[mymosquitto:Dose-WaMa/energy:state:default]" }
Number	Dose_WaMa_Current	    "Stromstärke [%.3f A]"		<owntemperature>	(gKE_Naehen)	{ mqtt="<[mymosquitto:Dose-WaMa/current:state:default]" }

Do you know where I am having a mistake?


Here is my working items for the Gosund Power Plug
Number Gosund_RSSI “Gosund: RSSI [%d %%]” (gRSSI)
{ mqtt="<[broker:tele/sonoff-16CE26/STATE:state:JSONPATH($.Wifi.RSSI)]" }
Switch Gosund “Powermonitor2” (BA,gGosund)
{ mqtt=">[broker:cmnd/sonoff-16CE26/POWER:command:*:default],
<[broker:stat/sonoff-16CE26/POWER:state:default]" }
Number Gosund_Energy_Power “Power aktuell [%.1f W]” (BA,gGosund)
{ mqtt="<[broker:tele/sonoff-16CE26/SENSOR:state:JSONPATH($.ENERGY.Power)]" }
Number Gosund_Energy_Total “Power Total [%.2f kWh]” (BA,gGosund)
{ mqtt="<[broker:tele/sonoff-16CE26/SENSOR:state:JSONPATH($.ENERGY.Total)]" }
Number Gosund_Energy_Yesterday “Power Gestern [%.2f kWh]” (BA,gGosund)
{ mqtt="<[broker:tele/sonoff-16CE26/SENSOR:state:JSONPATH($.ENERGY.Yesterday)]" }
Number Gosund_Energy_Today “Power Heute [%.2f kWh]” (BA,gGosund)
{ mqtt="<[broker:tele/sonoff-16CE26/SENSOR:state:JSONPATH($.ENERGY.Today)]" }
//Number Gosund_Energy_Period “Periode [%.2f]” (BA)
// { mqtt="<[broker:tele/sonoff-16CE26/SENSOR:state:JSONPATH($.ENERGY.Period)]" }
Number Gosund_Energy_Factor “Power Factor [%.2f ]” (BA,gGosund)
{ mqtt="<[broker:tele/sonoff-16CE26/SENSOR:state:JSONPATH($.ENERGY.Factor)]" }
Number Gosund_Energy_Voltage “Power Volt [%.1f V]” (BA,gGosund)
{ mqtt="<[broker:tele/sonoff-16CE26/SENSOR:state:JSONPATH($.ENERGY.Voltage)]" }
Number Gosund_Energy_Current “Power Strom [%.3f A]” (BA,gGosund)
{ mqtt="<[broker:tele/sonoff-16CE26/SENSOR:state:JSONPATH($.ENERGY.Current)]" }
String Gosund_Up “Power Messinterval (Uptime): [%s]” (gUptime,gGosund)
{ mqtt="<[broker:tele/sonoff-16CE26/STATE:state:JSONPATH($.Uptime)]" }

I tried the switch part similar:

Switch  Gosund      "Powermonitor2"  (gKE_Naehen) 	{ mqtt=">[mymosquitto:cmnd/Dose-WaMa/POWER:command:*:default], <[mymosquitto:stat/Dose-WaMa/POWER:state:default]" }

no success.
Where is this setting come from (where in Tasmota?) sonoff-16CE26
In my mqtt client all entries are in lower cases. Is yours (POWER,ENERGY etc) written like this to your mqtt broker?


Are you sure you used tasmota? And not another ESP utility?
Because tasmota publishes json strings for energy use and has a very specific syntax for commands (cmnd)

1 Like

OMG, you are so right.
I played with several different bin and with Tasmota it worked then I tried to use ESPurna … and this is the current system.

I am so sorry, I will try to google for this issue to find a solution.
Sorry again

Some other users are using ESPurna,

Can you post your config once you are all set-up, please?

1 Like

As to be expected your post in this threat is the solution: