Advertisement
JLindvig

fuelfinder new v. 0.1

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