Advertisement
denperss

Sensor rest

Mar 24th, 2021
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.13 KB | None | 0 0
  1.  - platform: rest
  2.     name: json4
  3.     json_attributes_path: "$.features[0].['properties']"
  4.     json_attributes:
  5.    - title
  6.     - header
  7.     - description
  8.     - beginPeriod
  9.     - lastModified
  10.     - coordinates
  11.     - geometry
  12.     resource: http://home.ajer.dk:8123/local.testy.json
  13.     value_template: "{{ value_json.features[0]['properties']['title'] }}"  
  14.  
  15.   - platform: template
  16.     sensors:
  17.       json4_sensor1:
  18.         friendly_name_template: "json4 main"
  19.         value_template: >
  20.          {{ states("sensor.json4") + ' / ' + state_attr("sensor.json4","description") + ' / ' + state_attr("sensor.json4","lastModified") }}
  21.  
  22.   - platform: template
  23.     sensors:
  24.       json4_info:
  25.         friendly_name_template: "For lovelace"
  26.         value_template: >
  27.           {{ state_attr("sensor.json4","header") + '\n' ' Opdateret: ' + state_attr("sensor.json4","lastModified") }}
  28.  
  29.  
  30. ##### This is where i need the cordinates output ######
  31.   - platform: template
  32.     sensors:
  33.       json4_map:
  34.         friendly_name_template: "GPS for lovelace"
  35.         value_template: >
  36.          {{ state_attr("sensor.json4","coordinates") }}
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement