Not able to get feedback from sonoff

Platform information:

  • Hardware: Resp pi 4
  • OS: openhabian 2.5.1

Hi All
I’m tried to bind a sonoff device to openhab with mqtt.
I been able to send commands to the device.
But for some reason I didn’t got any feedback on OH when switching the module.
In the logs I get:

Executing the JSONPATH-transformation failed: Invalid path '$.POWER' in 'OFF'

Thanks to @H102 I manage to fix the problem.

@H102 - can you share your solution?

Thanks

I presume your openHAB stateTopic is tied to the POWER topic of your sonoff. This doesn’t require using a JSON transformation at all, as the POWER topic returns either OFF or ON - nothing in JSON format.

If you share your things configuration we can very quickly tell you what to change!

You may not need the transformation, give it a try without it. Below is an example of one sonoff device I have that works fine.

Thing topic sonoff2 "Couch Light" @ "Couch Light" {
//    Channels:
//        Type switch : power        "Power"         [ stateTopic="stat/sonoff2/POWER", commandTopic="cmnd/sonoff2/POWER" ]
//    }

The // are where I have commented this out and moved to creating my Things via PaperUI and use files for items. This is also the recommended way for most users.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.