Hello all, I was wondering if there’s a better way to do this:
rest:
resource: https://periodic-table-elements-info.herokuapp.com/elements
sensor:
- name: 'hydrogen'
json_attributes_path: $.[0]
value_template: 'OK'
json_attributes:
- atomicNumber
- symbol
- atomicMass
- atomicRadius
- standardState
- meltingPoint
- boilingPoint
- density
- name: 'helium'
json_attributes_path: $.[1]
value_template: 'OK'
json_attributes:
- atomicNumber
- symbol
- atomicMass
- atomicRadius
- standardState
- meltingPoint
- boilingPoint
- density
- name: 'lithium'
json_attributes_path: $.[2]
value_template: 'OK'
json_attributes:
- atomicNumber
- symbol
- atomicMass
- atomicRadius
- standardState
- meltingPoint
- boilingPoint
- density
So I’m using restful to pull periodic table data. Is there a way to loop the json array instead of defining a sensor for each element individually?
Thanks