mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
Added replace from , to . for float handling
Since the website saves numbers with , the sensor ends up with "," when trying to use it in automations float does not work. So i thought i added this if somone ells uses the example
This commit is contained in:
parent
29840a1ec4
commit
e0f5d86582
@ -126,7 +126,7 @@ sensor:
|
|||||||
resource: https://elen.nu/timpriser-pa-el-for-elomrade-se3-stockholm/
|
resource: https://elen.nu/timpriser-pa-el-for-elomrade-se3-stockholm/
|
||||||
name: Electricity price
|
name: Electricity price
|
||||||
select: ".elspot-content"
|
select: ".elspot-content"
|
||||||
value_template: '{{ value.split(" ")[0] }}'
|
value_template: '{{ ((value.split(" ")[0]) | replace (",", ".")) }}'
|
||||||
unit_of_measurement: "öre/kWh"
|
unit_of_measurement: "öre/kWh"
|
||||||
```
|
```
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user