Skip to content

Instantly share code, notes, and snippets.

@devbis
Created April 12, 2023 08:27
Show Gist options
  • Save devbis/8a40b51d4ffedcd374e0a32f24004770 to your computer and use it in GitHub Desktop.
Save devbis/8a40b51d4ffedcd374e0a32f24004770 to your computer and use it in GitHub Desktop.
Home Assistant sensors for USD-GEL rates in banks
scrape:
- resource: https://credobank.ge/en/
sensor:
- name: USD/GEL rate Credo
select: "body > div.wrap.container > div.content > main > div.news-section.full-width-padding-lr.flex-wrap.space-between > div.news-container.right > div > div.js-currency-box.currency-box.active > div > div:nth-child(2) > div.currency.second-column"
value_template: '{{ value | float }}'
unit_of_measurement: GEL
sensor:
- platform: rest
resource: https://nbg.gov.ge/gw/api/ct/monetarypolicy/currencies/en/json/
method: GET
name: USD/GEL rate NBG
#device_class: monetary
value_template: "{{ (value_json[0]['currencies']|selectattr('code', '==', 'USD')| list)[0]['rate'] }}"
unit_of_measurement: GEL
- platform: rest
resource: https://bankofgeorgia.ge/api/currencies/convert/USD/GEL?amountFrom=1&amountTo=1
method: GET
name: USD/GEL rate BoG
#device_class: monetary
value_template: "{{ value_json['data']['rate'] }}"
unit_of_measurement: GEL
- platform: rest
name: USD/GEL rate TBC
resource: https://tbconline.ge/ibs/delegate/rest/exchangerate/v1/exchangeRate?fromCurrency=USD&toCurrency=GEL&fromAmount=1
method: GET
value_template: "{{ value_json['yourExchangeRate'] }}"
unit_of_measurement: GEL
#device_class: monetary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment