Hi All,
a newbie here please help
if have a smartlife Energy Meassurement Power switch connected with tuya
it’s working well except for total used power for day - month - year.
in the app on my phone i will get the information.
My power sensor is:
sensor.slimme.stekker_power
how can i create a custom sensor that will show me total power usage if it’s possible in a day or month and year. if not total usage of all days i’m using it will be enough.
i did a test creating a new sensor only to check if the power is working see the example below.
template:
- sensor:
- name: Energy Meter Marty
state: >
{% if states("sensor.slimme_stekker_power") | float == 0 %}
Off
{% else %}
On
{% endif %}
i hope somebody can help me out , be aware i’m a newbie
hey Mamekedi,
Welcome to the HA forum !
It is easy, just go to → settings → devices and services → helpers
There you can make a counter for your device which resets itself each day, week, month etc.
Goodluck !
gr. Wim
You want to use the Utility meter integration.
Have a look in the documentation it explains it all in there.
Basically you set up and add which sensor your want it to monitor and it creates which sensors you want like daily, weekly etc.
Thanks Guys i will look in to it
Hi All,
a little step ahead but the result are not correct.
in the picture below the smartlife energy switch uses a power sensor in watts (nr 1 in the picture)
i created a new sensor like (nr 2 in the picture):
- platform: template
sensors:
kilowatt_sensor:
friendly_name: "Kilowatt Sensor"
unit_of_measurement: "kW"
value_template: "{{ states('sensor.slimme_stekker_power') | float * 0.001 }}"

I add the new sensor via ha gui in the utiliy meter (nr 3 in the picture)
As you can see i get some results out of it but it’s way to high.
i have a smartlife app on my phone and it’s telling me at this moment the power use is 0.64 kWh
from 00:00 to 8:30 now
i created the sensor in the ultility meter at 7:30 so in 1 hour run it’s telling me 0.4724 Kw power use
that’s way to high.
I’m a little stuck now i tryed different ways, searched google with no luck.
can you give me some more info please