Hi,
I’m pretty new to Home Assistant. After some initial, straightforward tasks, I’m now trying to add data from a two-way electricity meter in the Energy Dashboard.
The data comes from a Tasmota IR device that’s attached to the front of the electric meter. I configured the device to send the three values I want (current power, meter reading into national grid, and meter reading taken from national grid ) via MQTT.
In HA, I installed and configured the Mosquito broker and Tasmota integrations.
The device and entities appear in the Tasmota integration. In Developer Tools, I see the entities with the values and the corresponding attributes:
This seemed promising. But based on what I’ve read in some other posts and in the docu., the reason why I can’t add these sensors to the Energy Dashboard are missing attributes: device_class, state_class, unit_of_measurement, and maybe others.
I’m really struggling to figure out what I need to add and where/how to add them.
This is what I have so far in the configuration.yaml:
mqtt:
sensor:
- name: "Two-Way Meter"
state_topic: "tasmota_two_way_meter"
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
force_update: true
Is this all I should need? One thing I’m not sure about is the state_topic entry. This is the name that I entered in the Tasmota device’s MQTT settings as the topic name; is that what is needed here?
When I look at the entity, I see the required attributes and it is accepted in the Energy Dashboard. But the state is 0.0, which doesn’t match any of the other sensors from the device at the same point in time.
I’m also wondering how I get the three values that I have from the Tasmota device…
I assume I need three sensors in line with the three that I have by default via MQTT, but in the settings that I entered in the configuration.yaml, I don’t see how I can keep the three apart.
Can anyone help me out here? Any pointers would be much appreciated.