Unable to get Wifi strength / rssi from sonoff via MQTT

I have a sonoff (tasmota flashed with 6.7.1) correctly integrated in homeassitant.
This is integration:

- platform: mqtt
  name: "sonoff01"
  state_topic: "hass/stat/sonoff01/POWER"
  command_topic: "hass/cmnd/sonoff01/POWER"
  availability_topic: "hass/tele/sonoff01/LWT"
  qos: 0
  payload_on: "ON"
  payload_off: "OFF"
  payload_available: "Online"
  payload_not_available: "Offline"
  optimistic: false
  retain: false

I would get a sensor with wifi/RSSI strenght. So i did add


- platform: mqtt
  state_topic: '/hass/tele/sonoff01/STATE'
  value_template: "{{ value_json.Wifi.RSSI }}"
  name: 'sonoff01_wifi_strength'
  unit_of_measurement: '%'

I got the sensor into homeassistant, but it is showed with “unknown”. I did wait more than 5minutes of tele.
If I type into console of web interface of sonoff I got the right payload

{
	"Time": "2019-11-10T14:00:57",
	"Uptime": "0T00:05:19",
	"UptimeSec": 319,
	"Heap": 28,
	"SleepMode": "Dynamic",
	"Sleep": 50,
	"LoadAvg": 19,
	"MqttCount": 1,
	"POWER": "OFF",
	"Wifi": {
		"AP": 1,
		"SSId": "ffff",
		"BSSId": "ff:ff:ff:ff",
		"Channel": 5,
		"RSSI": 76,
		"LinkCount": 1,
		"Downtime": "0T00:00:08"
	}
}

Thank you for your support!

1 Like

It is better to use autodiscovery on tasmota as this will give you all the entities belonging to that device without any need of adding json code anywhere.

If using autodiscovery, a sensor with the RSSI is created.

Thank you.
Can I use the auto-discovery PLUS self-written sensors (as my first post)

- platform: mqtt
  name: "sonoff01"
  state_topic: "hass/stat/sonoff01/POWER"
  command_topic: "hass/cmnd/sonoff01/POWER"
  availability_topic: "hass/tele/sonoff01/LWT"
  qos: 0
  payload_on: "ON"
  payload_off: "OFF"
  payload_available: "Online"
  payload_not_available: "Offline"
  optimistic: false
  retain: false

?
Or something could conflicts?