[SOLVED] Null value in habpanel for sonoff wireless strength - need to check jsonpath is working - MQTT, Sonoff, JSON PATH

Bit out of my depth here and still reading but is there an easy way to test the JSONPATH transformation is working correctly please. Some posts say that jsonpath transformation needed reinstalling, did this through paperui but no change and am trying to avoid a complete reinstall until I understand the problem

I’ve gone through several tutorials and posts around getting 3 sonoff (tasmota) devices working with openhabian 2.2. on a pi2. Zulu 8.25.076.
I can power them on/ off in habpanel but the reading for the wifi connection strength (RSSI) shows as null in habpanel

I’ve learned a lot so far and am still trying to RTFM but am slowly drowning on this one. Help please.

Am I right that you use either addons.cfg _OR_paperui to install the transform (I’ve used the later but may be missing some config steps with it?

Output from MQTT-SPY



Switch sonoff_basic1 "sonoff_basic1" <power> (LR,gpower){ mqtt=">[broker:cmnd/sonoff_basic1/POWER:command:*:default],<[broker:stat/sonoff_basic1/POWER:state:default]", autoupdate="false" }
Switch sonoff_slampher1 "sonoff_slapmher1" <power> (LR,gpower){ mqtt=">[broker:cmnd/sonoff_slampher1/POWER:command:*:default],<[broker:stat/sonoff_slampher1/POWER:state:default]", autoupdate="false" }
Switch sonoff_pow1 "sonoff_pow1" <power> (LR,gpower){ mqtt=">[broker:cmnd/sonoff_pow1/POWER:command:*:default],<[broker:stat/sonoff_pow1/POWER:state:default]", autoupdate="false" }
Switch sonoff_basic1_reachable "sonoff_basic1:reachable" (gReachable){ mqtt="<[broker:tele/sonoff_basic1/LWT:state:MAP(reachable.map)]" }
Switch sonoff_pow1_reachable "sonoff_pow1:reachable" (gReachable){ mqtt="<[broker:tele/sonoff_pow1/LWT:state:MAP(reachable.map)]" }
Switch sonoff_slampher1_reachable "sonoff_slampher1:reachable" (gReachable){ mqtt="<[broker:tele/sonoff_slampher1/LWT:state:MAP(reachable.map)]" }
Number sonoff_basic1_RSSI "sonoff basic1: RSSI [%d %%]" (gRSSI){ mqtt="<[broker:tele/sonoff_basic1/STATE:state:JSONPATH($.Wifi.RSSI)]" }
Number sonoff_pow1_RSSI "sonoff_pow1: RSSI [%d %%]" (gRSSI){ mqtt="<[broker:tele/sonoff_pow1/STATE:state:JSONPATH($.Wifi.RSSI)]" }
Number sonoff_slampher1_RSSI "sonoff_slampher1: RSSI [%d %%]" (gRSSI){mqtt="<[broker:tele/sonoff_slampher1/STATE:state:JSONPATH($.Wifi.RSSI)]" }
String  Sonoff_Action "Sonoff Action" <sonoff_basic1>
String  Sonoff_Action "Sonoff Action" <sonoff_pow1>
String  Sonoff_Action "Sonoff Action" <sonoff_slampher1>
String Sonoff__basic1_Current_FW_Available "Current Release [%s]" <sonoff_basic1> (Sonoff_Maintenance) { http="<[tasmotaRelease:10000:JSONPATH($[0].name)]"}

NB I’ve tried it with $.StatusSTS.Wifi.RSSI as per the tutorial but I think it should be as above? - am I right?


# Define your MQTT broker connections here for use in the MQTT Binding or MQTT
# Persistence bundles. Replace <broker> with an ID you choose.

# URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883

# Optional. Client id (max 23 chars) to use when connecting to the broker.
# If not provided a random default is generated.

# Optional. True or false. If set to true, allows the use of clientId values
# up to 65535 characters long. Defaults to false.
# NOTE: clientId values longer than 23 characters may not be supported by all
# MQTT servers. Check the server documentation.

# Optional. User id to authenticate with the broker.

# Optional. Password to authenticate with the broker.

# Optional. Set the quality of service level for sending messages to this broker.
# Possible values are 0 (Deliver at most once),1 (Deliver at least once) or 2
# (Deliver exactly once). Defaults to 0.

# Optional. True or false. Defines if the broker should retain the messages sent to
# it. Defaults to false.

# Optional. True or false. Defines if messages are published asynchronously or
# synchronously. Defaults to true.

# Optional. Defines the last will and testament that is sent when this client goes offline
# Format: topic:message:qos:retained <br/>
#<broker>.lwt=<last will definition>

I’m sure I’m missing something obvious but not sure what. Should there be a rule or something in the transforms folder for this?

Happy to get logs if someone can help me filter for the right things - it’s being filled up with the Sony TV binding searching for the TV at the moment

You changed the full topic on the tasmota
Change it back to default:


You’re a star - it’s working. Thanks so much for that. Clearly I have some more reading to do about MQTT.

Your error was not MQTT but your tasmota settings. Use the defaults until you are really familiar with it.
Also, please mark to thread as solved, thanks

Will mark as solved. Thanks again

I can see my confusion from https://github.com/arendst/Sonoff-Tasmota/wiki/openHAB

“In the example configuration you can see a non-default Full Topic definition, which is not used in the following examples (but which can be recommended).”

1 Like