Hi guys,
I need advice on how to find out several different pieces of information from a website. I tried via multiscrape.yaml but no luck.
I need to “scan” EUR, GBP and USD rates. Everything for the current day from CNB (Czech National Bank).
I tried it in configuration.yaml like this, but it just keeps showing me only the first entity EUR rate. I don’t see those other entities anywhere.
I look in “developer tools” → “states” → and here I filter the entities.
And I still only see the first one.
Anyone has some idea?
I think the quote is causing your problem. Should be before Kurz.
- name: Kurz "CZK/EUR"
--------------^----^
Here’s how you really want to do it, though, using the XML file they provide. Much better than scraping for an arbitrary <td> that will break if they add / remove a currency or change their layout.
Logger: homeassistant.helpers.template
Source: helpers/template.py:589
First occurred: 13:54:31 (2 occurrences)
Last logged: 13:54:31
Template variable error: 'dict object' has no attribute 'gesmes' when rendering '{{ value_json.gesmes.Cube.Cube.Cube|selectattr('@currency','eq','USD')|map(attribute='@rate')|first|replace(',','.') }}'
Template variable error: 'dict object' has no attribute 'gesmes' when rendering '{{ value_json.gesmes.Cube.Cube.Cube|selectattr('@currency','eq','GPB')|map(attribute='@rate')|first|replace(',','.') }}'
Hi Troon again,
can you please be so kind and let me know, if you are able to read the currency values from this site?
It is a CSOB bank from CZ and I assume they are not using XML as the CNB CZ bank.
The CNB exchange rates are fine, but they are always lower than the CSOB bank exchange rates.
And as I use the CSOB bank, I would need to know more precisely their rates.
Here’s what you need. Looks like the XML URL changes daily, so I’ve included the date in the resource_template — hopefully that’ll work, depending on when they publish the new one each day:
I’ve picked the Buy rate (Nákup) but you can change '@Buy' to '@Sale' or '@Middle' depending on which you need. Here’s how that search template is working:
Wow, that is absolutely perfect. Everything is working fine and let´s see if it works on the other days…
Thanks man very much, any way how to donate to you for your help :-)?