Advertisement
JLindvig

Untitled

Nov 6th, 2021
1,232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.89 KB | None | 0 0
  1. fuelfinder:
  2.   rest:
  3.     - resource: http://rest.apptoo.dk/fuelfinder.json
  4.       sensor:
  5.         - name: OK 95
  6.           value_template: >
  7.            {% set fuelcompany = value_json.fuelprices | selectattr('company_name', 'eq', 'OK') | list | first %}
  8.             {{ fuelcompany['gas_95'] }}
  9.           json_attributes_path: "$.fuelprices[?(@.company_name == 'OK')]"
  10.           json_attributes:
  11.            - company_logo
  12.             - gas_95
  13.             - diesel
  14.             - last_update
  15.         - name: OK Diesel
  16.           value_template: >
  17.            {% set fuelcompany = value_json.fuelprices | selectattr('company_name', 'eq', 'OK') | list | first %}
  18.             {{ fuelcompany['diesel'] }}
  19.           json_attributes_path: "$.fuelprices[?(@.company_name == 'OK')]"
  20.           json_attributes:
  21.            - company_logo
  22.             - gas_95
  23.             - diesel
  24.             - last_update
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement