Dear All,
I have not been abble to solve the following message I get in Openhab 2.4 logs when using my Sonoff Touch T2 device with TASMONA firmware:
2019-01-25 21:45:56.065 [WARN ] [l.generic.ChannelStateTransformation] - Executing the JSONPATH-transformation failed: Invalid path ‘$.POWER’ in ‘{“POWER1”:“ON”}’
2019-01-25 21:45:56.069 [WARN ] [eneric.internal.generic.ChannelState] - Command ‘{“POWER1”:“ON”}’ not supported by type ‘OnOffValue’: No enum constant org.eclipse.smarthome.core.library.types.OnOffType.{“POWER1”:“ON”}
The device does what it is expected (turn on or off the light) but it is as if Openhab expected a POWER path in the JSON whereas MQTT returns POWER1 (or POWER2) because the sonoff touch T2 has 2 switches on it.
Did someone encountered the same problem?
Thank you for your help.
My things file looks like:
Thing mqtt:topic:LS_FF_Salon1_thg “Sonoff Light Switch Piano” (mqtt:broker:mosquitto) @ “MQTT” {
Channels:
Type switch : PowerSwitch “Lumière Piano” [ stateTopic=“stat/sonoff/POWER1”, commandTopic=“cmnd/sonoff/POWER1”, ON=“1”, OFF=“0” ]
Type switch : PowerSwitchRes “Lumière Piano status” [ stateTopic=“stat/sonoff/RESULT”, transformationPattern=“JSONPATH:$.POWER1”,ON=“1”,OFF=“0” ]
Type string : Version “Version 02” [ stateTopic=“tele/sonoff/light/INFO1”, transformationPattern=“JSONPATH:$.Version”]
Type string : fallback “fallback topic” [ stateTopic=“tele/sonoff/light/INFO1”, transformationPattern=“JSONPATH:$.FallbackTopic”]
Type string : hostname "hostname " [ stateTopic=“tele/sonoff/light/INFO2”, transformationPattern=“JSONPATH:$.Hostname”]
Type string : IP "IP " [ stateTopic=“tele/sonoff/light/INFO2”, transformationPattern=“JSONPATH:$.IPAddress”]
Type string : time “Time” [ stateTopic=“tele/sonoff/light/STATE”, transformationPattern=“JSONPATH:$.Time” ]
Type string : uptime “Uptime” [ stateTopic=“tele/sonoff/light/STATE”, transformationPattern=“JSONPATH:$.Uptime” ]
Type number : vcc “VCC” [ stateTopic=“tele/sonoff/light/STATE”, transformationPattern=“JSONPATH:$.Vcc” ]
Type string : wifi-ap “Wifi AP” [ stateTopic=“tele/sonoff/light/STATE”, transformationPattern=“JSONPATH:$.Wifi.AP” ]
Type string : wifi-ssid “Wifi SSID” [ stateTopic=“tele/sonoff/light/STATE”, transformationPattern=“JSONPATH:$.Wifi.SSId” ]
Type string : wifi-channel “Wifi Channel” [ stateTopic=“tele/sonoff/light/STATE”, transformationPattern=“JSONPATH:$.Wifi.Channel” ]
Type string : wifi-rssi “Wifi RSSI” [ stateTopic=“tele/sonoff/light/STATE”, transformationPattern=“JSONPATH:$.Wifi.RSSI” ]
Type string : SensorTime “Sensor Time” [ stateTopic=“tele/sonoff/light/SENSOR”, transformationPattern=“JSONPATH:$.Time” ]
Type string : POW-startTime “POW Start Time” [ stateTopic=“tele/sonoff/light/SENSOR”, transformationPattern=“JSONPATH:$.ENERGY.TotalStartTime” ]
Type string : POW-Total “POW Total” [ stateTopic=“tele/sonoff/light/SENSOR”, transformationPattern=“JSONPATH:$.ENERGY.Total” ]
Type string : POW-Voltage “POW Voltage” [ stateTopic=“tele/sonoff/light/SENSOR”, transformationPattern=“JSONPATH:$.ENERGY.Voltage” ]
Type string : devicestate “Device State” [ stateTopic=“tele/sonoff/light/LWT” ]
} // end of thing
My items file is:
Switch LS_FF_Salon1 “Piano” (FF_Salon) [ “Lighting” ] { channel=“mqtt:topic:LS_FF_Salon1_thg:PowerSwitch” }