ESPEasy MQTT HLW8012 Powermeter

Hya,

after putting the ESPEasy with HLW8012 as powermeter, my mqtt broker recognizes it:

broker shows:

POWERMETER
HLW8012
Current = 0.00
Power = 0.00
PowerFactor = 0.00
Voltage = 0.00
status
LWT = Online

and topics are:

POWERMETER/HLW8012/Current
POWERMETER/HLW8012/Power
POWERMETER/HLW8012/PowerFactor
POWERMETER/HLW8012/Voltage

Question:

How to i define it in configuration.yaml to be recognized by HA?

Thx in advance.

You create mqtt sensors for each of the values you want to bring into Home Assistant:

Thx.

solved with:

sensor hlw80121:
  - platform: mqtt
    name: "Current"
    unique_id: hlw8012c1
    state_topic: "POWERMETER/HLW8012/Current"
  - platform: mqtt
    name: "Power"
    unique_id: hlw8012p1
    state_topic: "POWERMETER/HLW8012/Power"
  - platform: mqtt
    name: "PowerFactor"
    unique_id: hlw8012f1
    state_topic: "POWERMETER/HLW8012/PowerFactor"
  - platform: mqtt
    name: "Voltage"
    unique_id: hlw8012v1
    state_topic: "POWERMETER/HLW8012/Voltage"

1 Like

It never ceases to confuse me when people do this. I know it’s valid, I’m just not used to seeing it.

very simple. for each physical device, i assign an unique name, to be able to find it directly on the configuration.

for device bt91100, i.e., i have sensor bt91100 and switch bt91100.

for me, at leat, makes it easier to mantain.

1 Like