Hi,
I have a rest sensor reading data from a website. Now I have trouble to extract the data from the state attribute.
- platform: rest
scan_interval: 3600
name: "Hexal Pollenflug"
resource: http://www.allergie.hexal.de/pollenflug/xml-interface-neu/pollen_de_7tage.php?plz=24111
json_attributes_path: "$..datasets.pollendaten"
json_attributes:
- pollenbelastungen
value_template: "{{ value_json.last_update }}"
The attribute is showing data like:
pollenbelastungen:
- '@tag': '0'
pollen:
- '@name': Ambrosia
'@belastung': '0'
- '@name': Ampfer
'@belastung': '0'
- '@name': Beifuß
'@belastung': '0'
- '@name': Birke
'@belastung': '0'
- '@name': Buche
'@belastung': '0'
- '@name': Eiche
'@belastung': '0'
- '@name': Erle
'@belastung': '0'
- '@name': Esche
'@belastung': '0'
- '@name': Gräser
'@belastung': '0'
- '@name': Hasel
'@belastung': '1'
- '@name': Pappel
'@belastung': '1'
- '@name': Roggen
'@belastung': '0'
- '@name': Ulme
'@belastung': '0'
- '@name': Wegerich
'@belastung': '0'
- '@name': Weide
'@belastung': '0'
My Sensor:
- platform: template
sensors:
hexal_pollen_today:
icon_template: "mdi:tree-outline"
friendly_name: "Heute"
value_template: >-
{% set today_state = state_attr('sensor.hexal_pollenflug', 'pollenenbelastung')["@tag"]%}
I get no data.
any idea?
BR
Det