Mosquito entities from a tasmota device get overwritten/reset, want to set "state_class", device_class and unit_of_measurement

I am totally clueless and need suggestions:

  • Have a power meter tasmota device > mqtt
  • Have Mosquito set up in Homeassistant
  • Entities show up and I have the correct values for power usage
  • Cannot setup a energy dashboard because the values miss the above mentioned attributes
  • I set attributes “state_class”, device_class and unit_of_measurement via developer tools
  • Can see the attributes and even managed to set up one value in energy dashboard if I am quick
  • After 1 or 2 minutes or so all the attributes I entered there are reset/empty again and the energy dashboard is inoperational

Thansk for your suggestions!

I expect you need to “fix” it in tasmota so it send unit_of_measurement etc. (by default tasmota does not do this). Alternative might be to work’a’round it with a template sensor directly in HA or via mqtt sensors like described in the tasmota docs? Publishing payloads for another (tasmota) device from HA to the mqtt broker for sure doesn’t help at all as the next tasmota payload will just overwrite it :man_shrugging:

Depending on your power meter hardware you might also be able to install esphome on your device and make use of the (superior) native api instead of wasting time with mqtt :bulb:

Got it to work, thank you!

Feel free to post your solution and mark the thread as resolved :white_check_mark: so other users with the same problem can benefit from your mileage :wink: