Hi, I am new to Home Assistant and Tasmota. I want to create this nice pictures under the energy button.
What I get running; At my dashboard I see the correct data Solar Power & Solar Enegy from my shelly-. From the tasmota I get the total Ennergy and actual power consamtion, Both values without (kWh/W).
I think that is the reseon why i see onl the solar sensors if I like to setup the energy staff. It looks like there are a lot of possibilities.to change that. but all that stuff is so confusing for me. I run a Mosquitto broker. And I see the right values of the entities.
What can do to get these Entities in the Power configuration. What files should I edit ?
So far as I understand I have to set somewhere…
state_class: total_increasing
unit_of_measurement: kWh
device_class: energy
friendly_name: Energy Consumption
I have a Tasmota Wifi setup with a sensor. That ESP8266EX sends the Data as entitities to my Tasmota plugin in home assistant. Is that what you ask for ?
So they are auto discovered from the Tasmota integration and not manual sensors you have created in configuration.yaml (or similar location)?
Tasmota should be sending them out with that information already if they are setup sensors…
Or do you use a rule to publish the message?
You should check why they are being discovered without those attributes.
However, you can use customize.yaml to fix them in HA,
In configuration.yaml you need
homeassistant:
customize: !include customize.yaml
Then in customize.yaml
sensor.tasmota_named_this:
state_class: total_increasing
device_class: energy
Is that setup somewhere else or just in scenes? scenes is not the right spot to add device_class.
scenes.yaml is for well scenes.
Do you have something like below in configuration.yaml
mqtt
sensor
- name: Verbrauch aktuell
state_topic: "homeassistant/tasmota/sensor"
value_template: '{{ value_json.EToday }}'
unit_of_measurement: kWh
device_class: energy <<< will not be there, but it's where they should be for manual sensors.
state_class: total_increasing
ok, thx, I moved the sensors from /config/scenes.yaml to /config/sensors.yaml
I dontknow why they are in szenes. I dont handle scenes.
My entity is in
and now I changed as well the customize.yaml
sensor.tasmota_sm_16_7_0:
device_class: power
unit_of_measurement: W
accuracy_decimals: 3
friendly_name: Verbrauch aktuell
state_class: measurement
sensor.tasmota_sm_1_8_0:
state_class: total_increasing
unit_of_measurement: Wh
accuracy_decimals: 3
device_class: energy
friendly_name: Verbrauch total
Now i get the data in Energy dash. But a wrong value of my usage. I have no idea, where the value from 13.190 kwh is coming from. The data in the Sensor Window is ok. you see there the total value of 7.445.487 Wh … somehow from that the dayly enegrgy should be calculatet .
Ok so if they are coming from the Tasmota Integration, you don’t need to make manual mqtt sensor.
This is a manual mqtt sensor example.
mqtt
sensor
- name: Verbrauch aktuell
state_topic: "homeassistant/tasmota/sensor"
value_template: '{{ value_json.EToday }}'
unit_of_measurement: kWh
device_class: energy <<< will not be there, but it's where they should be for manual sensors.
state_class: total_increasing
They should have attributes like this however in dev tools states. The customize.yaml should have fixed that now(after a restart).
Tasmota should really be sending it out with the correct state_class and device_class though when it is sending out discovery info to the Tasmota Integration.
It would be worth asking on the tasmota discord why that isn’t happening. It may be a device setting or a bug.
Yes there are the right numbers.
But there are still 2 Problems.
1.) the sm_1_8_0 sends in wh not kwh
2.) the number of the used Energy is wrong . I think it should start at 0 and then add sm_1_8_0 . Is that right ?
It takes a little while to calculate.
is that 13.2 kwh or 13000 kwh I can’t tell with the decimal and comma. 13kwh looks about right for a daily cumulative value. It should reset at midnight and start from 0 automatically.
Developer tools > statistics (the last tab)
Is where you can adjust erroneous values.
Is good to know that there will be a automatic reset.
Anyway… now the picture looks a bit different
It says 7.485.841,1 khw from the grid
home usage 7.458.848,8 kwh
The sensor on the right side is getting 7.446.617,67 Wh … The couter is a relative new one, and my eyes read there 7.446 kwh … very strange
is verbrauch total a lifetime or daily value?
its a pulse counter or something on your meter?
7kwh is probably a good value if its only measured for half a day or so…
See how it all looks tomorrow. You may need to change your values.
Yes possibly need to divide by 1000. You could just change the units in customize.yaml change to kwh