i have a sensor with attributes. one of this attribute is metric (json)
Metric
temp: -1 heatIndex: -1 dewpt: -2 windChill: -1 windSpeed: 0 windGust: 0 pressure: 1015.92 precipRate: 0 precipTotal: 0 elev: 157
with state: “{{ state_attr (‘sensor.balkon_wetter’, ‘metric’) }}” i get:
{‘temp’: -1, ‘heatIndex’: -1, ‘dewpt’: -2, ‘windChill’: -1, ‘windSpeed’: 3, ‘windGust’: 0, ‘pressure’: 1015.92, ‘precipRate’: 0.0, ‘precipTotal’: 0.0, ‘elev’: 157}
but how can i access the value (f.e. windSpeed) ?
template:
- sensor:
- name: “balkon_wetter_windspeed”
unique_id: balkon_wetter_windspeed
#unit_of_measurement: “°C”
state: “{{ (state_attr (‘sensor.balkon_wetter’, ‘metric’)|from_json()).values.4 }}”
#this works not - name: “balkon_wetter_windspeed2”
unique_id: balkon_wetter_windspeed2
#unit_of_measurement: “°C”
state: “{{ state_attr (‘sensor.balkon_wetter’, ‘metric’) }}”
- name: “balkon_wetter_windspeed”