Hi all,
I’m trying to create an energy sensor, to be used in energy dashboard, which gets data via REST from another application running on my raspberry.
The sensor is defined as following:
- platform: rest
resource: http://192.168.1.165/metern/programs/programtotal.php
name: solar_immissione_giornaliera
value_template: '{{ value_json.Dailycounter4 }}'
unit_of_measurement: Wh
state_class: total_increasing
device_class: energy
unique_id: "immissione_giornaliera"
It works, but I realized that the unit of measurement provided by the “programtotal.php” provides values as a raw value up to 999 Wh, and then it returns valued like “1 k”.
So the sensor raises up to 999 Wh, and then falls to 1, since apparently HA remove the “k” after the figure.
See picture:
How can I configure the sensor for getting both the value and the unit (k), and when the k is present it should multiply the value by 1000.
Thanks!