mqtt2prometheus icon indicating copy to clipboard operation
mqtt2prometheus copied to clipboard

Athom Tasmota plug

Open zemmyang opened this issue 8 months ago • 0 comments
trafficstars

I bought a couple of smart plugs from Athom with Tasmota pre-flashed. Side note, I don't want to go through the "re-flash the plug so that it has prom support" method.

I have mosquitto running on Docker on port 1883 on a RPi. The host of the plug are set to the IP of this machine. The topic of the plug is "big-potato" and the full topic is "power/big-potato".

I have mqtt2prometheus running on the same RPi. My configuration looks like this:

mqtt:
  server: tcp://RPI_LOCAL_IP:1883
  user: USER
  password: PASSWORD
 
  topic_path: "#"
  device_id_regex: "power/(?P<deviceid>.*)/"
 
  # The MQTT QoS level
  qos: 0
 
 cache:
  timeout: 10m
 
 metrics:
  - prom_name: bp_consumed_energy_kilowatthours_total
    mqtt_name: "ENERGY.Total"
    help: big potato total power
    type: counter

I'm not getting any errors, but I'm not getting any mqtt-related metrics out of mqtt2prometheus, either. I'm not sure what I'm doing wrong.

fwiw, this is what I get from the plug's console:

06:34:50.000 MQT: power/big-potato/STATE = {"Time":"2025-03-02T06:34:49","Uptime":"0T15:40:14","UptimeSec":56414,"Heap":25,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER":"ON","Wifi":{"AP":1,"SSId":"OUR_WIFI","BSSId":"58:D5:6E:B7:F2:DF","Channel":13,"Mode":"11n","RSSI":60,"Signal":-70,"LinkCount":1,"Downtime":"0T00:00:08"}}
06:34:50.010 MQT: power/big-potato/SENSOR = {"Time":"2025-03-02T06:34:50","ENERGY":{"TotalStartTime":"2025-02-12T13:38:56","Total":4.454,"Yesterday":2.340,"Today":0.115,"Period":11,"Power":104,"ApparentPower":194,"ReactivePower":164,"Factor":0.54,"Voltage":222,"Current":0.873}}

zemmyang avatar Mar 02 '25 05:03 zemmyang