1. sensors.yaml:
- platform: rest
  name: EUR NBP A # sensor.eur_nbp_a
  resource: http://api.nbp.pl/api/exchangerates/rates/A/EUR/?format=json
  value_template: "{{ value_json.rates[0].mid }}"
  json_attributes_path: $.rates.[0]
  scan_interval: 500
  unit_of_measurement: "PLN"
  
- platform: rest
  name: USD NBP A # sensor.usd_nbp_a
  resource: http://api.nbp.pl/api/exchangerates/rates/A/USD/?format=json
  value_template: "{{ value_json.rates[0].mid }}"
  json_attributes_path: $.rates.[0]
  scan_interval: 500
  unit_of_measurement: "PLN""

2. automations.yaml:
- id: '2024101201'
  alias: 'AWTRIX: USD and EURO currency rates for Polish National Bank (NBP) Table
    A'
  description: ''
  triggers:
  - minutes: /4
    trigger: time_pattern
  conditions: []
  actions:
  - data:
      qos: '0'
      retain: false
      topic: awtrix_55bb50/custom/rateeurnbpa
      payload: '{           "text": "{{ states(''sensor.eur_nbp_a'') | round(4) }}",           "icon":
        "2147",           "repeat": 2,           "duration": 5         }'
    action: mqtt.publish
  - data:
      qos: '0'
      retain: false
      topic: awtrix_55bb50/custom/rateusdnbpa
      payload: '{           "text": "{{ states(''sensor.usd_nbp_a'') | round(4) }}",           "icon":
        "11388",           "repeat": 2,           "duration": 5         }'
    action: mqtt.publish
  mode: single