This is a Custom Component for Home-Assistant, it fetches live mid-rates using FXMarketAPI.
NOTE: You will need an FXMarketAPI account, you can sign up for free here.
NOTE: Not all currencies are available, to check the available currencies see this page here.
- Have HACS installed, this will allow you to easily manage and track updates.
- Open HACS and click 'Integrations' tab
- Search for 'FXMarketAPI Integration'.
- Click 'FXMarketAPI Integration'.
- Click Install below the found integration.
- Configure using the configuration instructions below.
- Restart Home-Assistant.
- Download the latest Release
- Open the dowloaded zip (or tar.gz)
- Copy directory
custom_components/fxmarketapi
from, the zip file to your<config dir>/custom_components
directory. - Configure with config like below.
- Restart Home-Assistant.
To use this component in your installation, add the following to your configuration.yaml
file:
NOTE: For more info on using secrets look here.
# Example configuration.yaml entry
# The below will call the FXMarketAPI every hour and add sensors for USD to ZAR and ZAR to USD
sensor:
- platform: fxmarketapi
api_key: !secret fxmarketapi_key
scan_interval: 01:00:00
foreign_exchange:
- name: USD to ZAR
from: USD
to: ZAR
- name: ZAR to USD
from: ZAR
to: USD
Key | Type | Required | Default | Description |
---|---|---|---|---|
api_key |
string |
True |
- | API key for your FXMarketAPI account |
scan_interval |
time period |
False |
00:60:00 |
Interval between sensor updates (API calls) |
foreign_exchange |
list |
True |
[] |
Currencies to get live rates for (see below) |
Key | Type | Required | Default | Description |
---|---|---|---|---|
name |
string |
False |
Friendly name for the sensor | |
from |
string |
True |
The 3 digit currency code to get the exchange rate from (i.e. USD) | |
to |
string |
True |
The 3 digit currency code to get the exchange rate to (i.e. ZAR) |
Please refer to the Home-Assistant Logger page for detailed info.
# Example configuration.yaml entry
logger:
default: error
logs:
custom_components.fxmarketapi: debug
This integration is provided as-is without warranties of any kind.