Advertisement
marlar

Valuta-sensor

Jan 25th, 2023 (edited)
953
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.81 KB | None | 0 0
  1.  - platform: rest
  2.     name: currency_eur_dkk
  3.     value_template: "{{ value_json.response[0].average_midpoint | float(7.43904) }}"
  4.     json_attributes_path: "$.response[0]"
  5.     resource_template: >
  6.      {% set base = "EUR" %}
  7.       {% set quote = "DKK" %}
  8.       https://cc-api.oanda.com/cc-api/v1/currencies?base={{base}}&quote={{quote}}&data_type=general_currency_pair&start_date={{ now().date() }}&end_date={{ now().date() }}
  9.     json_attributes:
  10.      - base_currency
  11.       - quote_currency
  12.       - start_time
  13.       - open_time
  14.       - close_time
  15.       - average_bid
  16.       - average_ask
  17.       - average_midpoint
  18.       - high_bid
  19.       - high_ask
  20.       - high_midpoint
  21.       - low_bid
  22.       - low_ask
  23.       - low_midpoint
  24.     headers:
  25.       Content-Type: application/json
  26.     scan_interval: 43200
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement