fvilmos / power_meter_mqtt

esp32 power meter for sensors with pulse output. Implements MQTT for status reporting. Accurate and easily can be integrated with Home Automation systems.
GNU General Public License v3.0
26 stars 5 forks source link

Schrack mgrzk465 #6

Open iLLiac4 opened 1 year ago

iLLiac4 commented 1 year ago

Hi. I need some help. Want to add this meter to HomeAssistant and am having problems. Those are impulse specs: Pulsfrequenz: 1000 imp/kWh Impulsdauer: 32 ms ±2 ms Bemessungsspannung DC: 27 V max Schaltstrom: 27 mA max

I was able to program the microcontroller and i am able to ping it. Have changed in .ino file:

define IN_PIN_PEM 18 / input pin for pulse sensor /

define IN_PIN_TMP 2 / input pin for DS18d20 temperature sensor /

define ISR_TYPE FALLING / isr triggering mode /

define HOUR 3600.0 / hour as constant /

define PULSES_KWH_RES 1 / 1 KW = 1000W, power meter has 2000 (0.5) inpulses resolution /

define SECOUND_ISR_PERIOD 0.032 / pulse period is ~90 ms (32ms), used to ignore secound interrupt arrival bug/

define MAX_POWER 7040 / for a peek of 32A => 7040W, ignor higher measurements /

And I get nothing. Also have problems with HomeAssitant I can not get this MQTT working. _Have mosquito installed also devices from Tasmota are working ok. Have paste the config into .yaml and nothing. I am using ESP32 WeMos LOLIN32 Lite. But it is the same as yours basically.

fvilmos commented 1 year ago

Hello, did you tried to connect trough Arduino studio and enable the debug function (add to the .ino file: #define DEBUG)? If this enabled, you will get in serial terminal the debug messages...

Verify:

  1. wifi connected
  2. mosquito connected, Does your mosquito needs a password on connection?
  3. use an mqtt web client to inspect the communication.