ahadata
(ahadata)
1
I have a sensor that retrieves currency rate with multiscrape
But it only shows up as legend, not as a graph
If i put unit_of_measurement: "EUR"
on the sensor, it doesnt show decimals Only integer
Value is 4 decimals, is that the issue? How do i fix it
Olivier1974
(Olivier Toussaint)
2
To be displayed as graph it must be a graphable value.
What is the device_class
of the sensor? Monetary ?
ahadata
(ahadata)
3
I have tried that as well
![image](https://community-assets.home-assistant.io/original/4X/9/1/d/91d313e01b573106de6ed2940a6b4c8206d78228.png)
And the sensors is set as below
sensor:
- unique_id: Euro_buy
name: Euro-buy
select: "#pair_61 > div.contentBox > div.innerContainerWrap.first > div.pid-61-bid.innerContainer"
device_class: "Monetary"
unit_of_measurement: "EUR"
ahadata
(ahadata)
4
I had to solve it with a template sensor inorder to correct decimal sign (from “,” to “.”)
sensor:
- platform: template
sensors:
euro_kurs:
friendly_name: Euro-Kurs
unit_of_measurement: "EUR"
value_template: "{{ states('sensor.euro_buy')|replace(',', '.') }}"
Olivier1974
(Olivier Toussaint)
5
The additional template is not necessary.
You did not reply to my post but to the topic so I didn’t see your attempt.
A template value can be defined in the scrape definition itself.
sensor:
- unique_id: Euro_buy
name: Euro-buy
select: "#pair_61 > div.contentBox > div.innerContainerWrap.first > div.pid-61-bid.innerContainer"
device_class: "Monetary"
unit_of_measurement: "EUR"
value_template: "{{ value.replace(',', '.') }}"