Update Fixer.io sensor more often

Thanks for the great fixer.io sensor, i really love it.

I would like to know if it could be possible to update the sensor every hours.

I have found in the fixer.py that this sensor is set to update every days (SCAN_INTERVAL = timedelta(days=1)).

Is it possible to edit this setting myself ?

Thanks.

With the fixer.io free api we have 1000 calls, 24hoursx31days=744 calls if you only track one currency.

yes you can. Copy the fixer.py to [homeassistant]/config/custom_components/sensor/ and rename it. Maybe fixer_hour.py

change SCAN_INTERVAL = timedelta(days=1) to SCAN_INTERVAL = timedelta(hours=1)

and in your configuration file use the new name in stead of “fixer:” like this:

sensor:
  - platform: fixer_hour
    api_key: YOUR_API_KEY
    target: CHF
1 Like

Brillant ! Thanks Pippyn.

Hey @Romquenin @Pippyn how are you doing? Apologies for reopening this thread now that it is closed! Could you please let me know where I can find the script you are talking about? I believe it is required to make it work and I cannot find it anywhere :thinking:

Thanks in advance!

Regards

Over the years this has changed.
You’ll need to make a folder in your custom_components folder and name it like we used to name the file. e.i. fixer_hour or something

Copy the 3 files from github in this folder. The rest is the same

Thanks for your response. But it seems I am facing the issue described here Fixer.io exchange rates fails to load where the API Key generated by the new site API Layer that owns Fixer/io is no longer valid with this integration.

TLDR, saw the Fixer/io component yesterday. It didn’t work out of the box and saw then your thread and the references to those files. I thought these files were indeed required to make it work, but it seems they are not required. It should work fine just by adding the sensor config and having a correct API Key.

Anyway, I have tried what you mentioned and it didn’t work either:

Platform error sensor.fixer_hour - Integration “fixer_hour” not found.

Folder: /root/config/custom_components/fixer_hour ← dropped in here the three files

In configuration.yaml:

sensor:
  - platform: fixer_hour
    api_key: ....
    target: EUR
    name: Exchange rate

Anyway, as I said before, it seems the API Key generated by the new site API Layer that owns Fixer.io is no longer compatible.

Thanks for your help!

First add the files, than reboot HA.
After that you can add it to your config, not before.

Thank you, @Pippyn for your help. I have tried a few times without not much luck. Therefore, I tried other options and alpha_vantage did the trick.

Regards.