I am trying to create an automation that sends me the values of my energy meter via notification to my mobile phone on a monthly period.
I did get this working but sadly the sensor loses his number format when send via notification and therefore the “,” and “.” are swapped and there are no seperators as-like when accessing via the WebUI.
My Notification Config:
data:
title: Stromzählerwerte
message: >-
Netzbezug: {{
states('sensor.energy_real_consumed_fronius_meter_0_froniusgen24_home')}}
kWh
Netzeinspeisung: {{
states('sensor.energy_real_produced_fronius_meter_0_froniusgen24_home')}}
kWh
Correct number forat via WebUI:
Wrong number format via (iOS) Notification:
Also tried the new state_translated
feature without success (still same issue)
Any help appreciated. Thanks
petro
(Petro)
March 15, 2024, 11:00am
2
state
and state_translated
do not output in relation to your selected number format. This functionality does not exist at this time.
This is probably the easiest way to handle this
{% set value = states('sensor.energy_real_produced_fronius_meter_0_froniusgen24_home') | float %}
{{ "{:,}".format(value).replace('.', ' ').replace(',','.').replace(' ',',') }}
Got it working.
Big thank you and a lot of apprectiation for the fast reply
Hope the feature will be implemented some time. Would be another step to making Home Assistant more user-friendly
In case anybody finds this posts and has same issue.
Here is my “fixed” configuration:
data:
title: Stromzählerwerte
message: >-
Netzbezug:{% set value =
states('sensor.energy_real_consumed_fronius_meter_0_froniusgen24_home') |
float %} {{ "{:,}".format(value).replace('.', '
').replace(',','.').replace(' ',',') }} kWh
Netzeinspeisung:{% set value =
states('sensor.energy_real_produced_fronius_meter_0_froniusgen24_home') |
float %} {{ "{:,}".format(value).replace('.', '
').replace(',','.').replace(' ',',') }} kWh