Hi all,
I try to create a status sensor for my Shelly devices without the need to create a separte sensor for each and single attribute that I want to fetch and to be displayed and that I can use in automations.
So far I have created a sensor similar to:
- platform: rest
name: "Shelly1PM heatpump"
resource: http://192.168.132.179/status
json_attributes:
- wifi_sta
- temperature
- overtemperature
value_template: 'OK'
scan_interval: 7200
This sensor is based on the JSON response of the /status endpoint of my Shelly device which looks like:
{
"wifi_sta": {
"connected": true,
"ssid": "blablabla",
"ip": "192.168.132.179",
"rssi": -73
},
"cloud": {
"enabled": false,
"connected": false
},
"mqtt": {
"connected": false
},
"time": "14:15",
"unixtime": 1602425702,
"serial": 42603,
"has_update": false,
"mac": "98F4ABB915D1",
"cfg_changed_cnt": 36338,
"actions_stats": {
"skipped": 0
},
"relays": [
{
"ison": true,
"has_timer": false,
"timer_started": 0,
"timer_duration": 0,
"timer_remaining": 0,
"overpower": false,
"source": "http"
}
],
"meters": [
{
"power": 52.44,
"overpower": 0.00,
"is_valid": true,
"timestamp": 1602425702,
"counters": [
52.646,
52.606,
52.722
],
"total": 535267
}
],
"inputs": [
{
"input": 0,
"event": "",
"event_cnt": 0
}
],
"ext_sensors": {
"temperature_unit": "C"
},
"ext_temperature": {
"0": {
"hwID": "2857f456b5013c8d",
"tC": 26.50,
"tF": 79.70
},
"1": {
"hwID": "284fec56b5013c35",
"tC": 39.19,
"tF": 102.54
},
"2": {
"hwID": "28efc456b5013caf",
"tC": 29.62,
"tF": 85.33
}
},
"ext_humidity": {},
"temperature": 50.13,
"overtemperature": false,
"tmp": {
"tC": 50.13,
"tF": 122.23,
"is_valid": true
},
"update": {
"status": "idle",
"has_update": false,
"new_version": "20200827-070450/v1.8.3@4a8bc427",
"old_version": "20200827-070450/v1.8.3@4a8bc427"
},
"ram_total": 50712,
"ram_free": 38436,
"fs_size": 233681,
"fs_free": 149596,
"uptime": 616851
}
This gives me my sensor as:
But my question is:
How can I display e.g. the RSSI signal strength in my UI or use it in my automations without the need for creating a separate sensor. I tried with:
type: 'custom:multiple-entity-row'
entity: sensor.shelly1pm_heatpump
show_state: false
name: Shelly1PM
icon: 'mdi:motion'
secondary_option: last_changed
entities:
- attribute: wifi_sta.rssi
name: WiFi signal
But this returns nothing?
Any help is much appreciated.
Thanks