lrswss/esp8266-wifi-power-meter

Meter number

Closed this issue · 4 comments

Hi,

thanks for your hard work, it works like a charm :-).

I'm wondering where in the code i can change the meter-number. Here it is sth like 078893. i'd like to change it to the real meter-number from the Stromnetzbetreiber :-), especially because the number shows up in the mqtt-message.

Feature request: Mqtt Port in the GUI.

btw: You didn't change the Version number to 212 in config.h .. Don't know if that matters..

btw2: Is there a reason why WiFiUDP.h isn't in your Code? Perhaps you should mention it in your readme.

Cheers,
Alex

The number is derived from the MAC address of the ESP8266, but making it configurable is no big deal. Same holds true for the MQTT port.

The header file WiFiUDP.h is included in influx.h. Do you get compiler warnings/errors or why are you asking? Mentioning the old version number I guess you're using the Arduino IDE, right? I switched to VisualStudio/PlatformIO quite a while ago, so I no longer compile the code explicitly under the Arduino IDE.

Thank you, I found the codeparts with the MAC or systemID Call.

No, i freshly installed Visual Code and PlatformIO. I then cloned into your repository and opened the folder in Visual Code. The compiler complained about the missing WiFiUDP.h. After adding it manually under "include", the compilation went through without errors.

sorry, i'm new to this whole stuff. This is my first project ...

Another Question: I added your Project via MQTT to iobroker. MQTT connection drops twice per minute with "connection lost: Timeout". Any idea how i can fix this? My fritzbox shows Signalstrength of -79 to -74 which is not too good, but the GUI is responsive

Just uploaded v2.1.3 with options in web ui to configure the MQTT port and power meter id. Please check if it's working as expected.

Sorry, I cannot reproduce your error due to missing header WiFiUDP.h. I cleaned up my project in VS and download/compiled all libraries from scratch: no warnings or errors message from the compiler.

I'm using HA and never experienced any connection timeout warnings. Low signal strength is probably not the cause. But I think the warnings are no matter of concern. Looking at the source code of the PubSubClient library I found MQTT_KEEPALIVE and MQTT_SOCKET_TIMEOUT to be set to 15 seconds by default. Timeout and keep alive could be increased with setSocketTimeout() and setKeepAlice() in mqtt.cpp which might fix iobroker's complains. You could try to set the publish interval to 30 or even 15 secs and check if you still get connect lost warnings.

Thank you so much. I changed the timeout and keepalive to 40 seconds and the publish intervall to 30s. The connection is now stable and no more warnings in iobrokers log.

All your other changes (Meter Name, Port) work great. Thanks for this!