Giter Site home page Giter Site logo

alcar21 / wemosem Goto Github PK

View Code? Open in Web Editor NEW
113.0 113.0 23.0 2.15 MB

Cheap power monitor (STC013) with Home Assistant Discover and Wemos D1 Mini / PRO (esp8266)

C++ 14.53% C 26.55% HTML 57.12% JavaScript 0.77% Makefile 0.04% Python 0.71% Shell 0.21% CSS 0.08%

wemosem's People

Contributors

alcar21 avatar northernman54 avatar plutec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wemosem's Issues

kWh not increasing?

I'm a bit confused about the kwh.. I have my d1mini measuring for the past 35 days.. and reset counter at 0 but yet I only see ~1000 kWh.. is this the expected behaviour? or I'm I seeing something wrong?

Thanks

Screen Shot 2021-04-14 at 17 35 14

Relay shield

I first congratulate you on the work. It works very well to monitor consumption. It would lack a little more precision.
I wanted to know if it is possible to integrate at least one output to be able to put a relay shield. If it could be controlled by mqtt and even depending on some consumption rule it would be fantastic. Thanks anyway if it can't be done.
Greetings.
Sorry for the English, I used Google translator

Monitor the Mains?

Can I use this board code to monitor my house at the mains board? Thanks

No wifi connection retry

Hi,
I have connected the wemosem with my wifi with no problems. But if I restart the wifi for any reason, the wemosem create the own network as AP and never reconnect to the wifi of the home again.

I don't know if it's a duplicate issue or not.

Any idea? Thanks!

MQTT gets disabled after a reboot

Congrats for the nice piece of work!

I found that after enabling MQTT and saving in the MQTT parameters, when the Wemos restarts, the MQTT gets disabled so you need to enter again in the UI to enable it. I wonder if there is some issue with the enable flag that after a reboot it is set again to disable?.
Could be this behavoir the way this function was designed to work?,

Many thanks
Luis

Differences between SCT-013-000

Hi alcar21, first of all, great work! I'm going to use it ASAP but I have a dubt.
What is the difference using a 30A transformer or a 50A one?
Could I also use freely a 15A or I have to modify some configuration (sw/hw)?
Thank you
S

A couple of minor items and a question

Tks for this piece of work, it is very well done. I just have a couple of minor things

1 - I'm in North America and I can't set the timezone to -5 ( Eastern Standard )

2 - When the device reboots, the data is wonky for the first minute, can this false data be thrown away? ie call em_read(true); at the end of the setup function?

3 - When Power usage is zero, the current sits between 0.02 to 0.04, any thoughts on why?

4 - Noticed that after running for 24 hours, this message "Failed to open config file for writing", so am wondering why the em_read is writing the config after every read in WiFi station mode.

For setup, I'm using a SCT013 Calibrated at 30A 1V, local power is 120 volt 60 Hertzs

MQTT not publishing

I'm having issues with MQTT and home assistant. The only message that the MQTT broker receives from wemosEM is a status offline message, even though the logs show it's publishing correctly.

I have everything configured as instructed in the Readme, any ideas?

Thanks

Status MQTT: -3 Reconnecting...
Attempting MQTT Broker connection... Reconnecting with user/pass
MQTT Connected.
Preparing topic HA Discover
Preparing message HA Discover
[METER] - Payload: {"current":"0.00","voltage":"5.00","watios":"0.00","kwh":"0.02","beforeKwh":"0.00","ical":"85.71","mqttreconnected":"2","wifidb":"56% Bad","uptime":" 0 days 00:02:32","time":"11:36:30 22/11/2019","freemem":23928}
[MQTT] - Published: wemos/wemosEM-51F13F/power > {"current":"0.00","voltage":"5.00","watios":"0.00","kwh":"0.02","beforeKwh":"0.00","ical":"85.71","mqttreconnected":"2","wifidb":"56% Bad","uptime":" 0 days 00:02:32","time":"11:36:30 22/11/2019","freemem":23928}
[MQTT] - Published: wemos/wemosEM-51F13F/status > online [METER] - rmsCurrent: 0.00 mainsVoltage: 5.00 Watios: 20.36 kwh: 0.02 Before reset kwh: 0.00 lastTimeMeasure: 147133
SAVED CONFIG: {"wifi_name":"","wifi_password":"","ip_mode":0,"ip":"192.168.0.43","mask":"255.255.255.0","gateway":"192.168.0.1","mqtt_enabled":true,"mqtt_server":"192.168.0.6","mqtt_port":1883,"mqtt_username":"wemosem","mqtt_password":"wemosem","message_interval":10000,"voltage":5,"ical":85.71,"blynk_enabled":false,"blynkAuth":"","blynkServer":"","blynkPort":0,"ts_enabled":false,"tsChannelNumber":0,"tsWriteAPIKey":"","timezone":7,"minutes_timezone":0,"system_password":"infinito&masalla","dayReset":0,"watiosTotal":20.35835,"kiloWattHours":0.020358,"beforeResetKiloWattHours":0}
[BLYNK] Disabled
[THINGSPEAK] Disabled
[METER] - Payload: {"current":"0.00","voltage":"5.00","watios":"0.00","kwh":"0.02","beforeKwh":"0.00","ical":"85.71","mqttreconnected":"2","wifidb":"60% Poor","uptime":" 0 days 00:02:37","time":"11:36:35 22/11/2019","freemem":26200}
[MQTT] - Published: wemos/wemosEM-51F13F/power > {"current":"0.00","voltage":"5.00","watios":"0.00","kwh":"0.02","beforeKwh":"0.00","ical":"85.71","mqttreconnected":"2","wifidb":"60% Poor","uptime":" 0 days 00:02:37","time":"11:36:35 22/11/2019","freemem":26200}
[MQTT] - Published: wemos/wemosEM-51F13F/status > online

Output from Home Assistant MQTT listener...

Message 18 received on wemos/wemosEM-51F13F/status at 11:39 PM:

Offline

QoS: 0 - Retain: false
Message 17 received on wemos/wemosEM-51F13F/status at 11:39 PM:

Offline

QoS: 0 - Retain: false
Message 16 received on wemos/wemosEM-51F13F/status at 11:38 PM:

Offline

QoS: 0 - Retain: false
Message 15 received on wemos/wemosEM-51F13F/status at 11:37 PM:

Offline

QoS: 0 - Retain: false
Message 14 received on wemos/wemosEM-51F13F/status at 11:36 PM:

Offline

Network connection problems

The device is working correctly but when the network goes down, it does not reconnect to the wifi network, I have to turn the device off and on, it is not often if I do not check it it remains without connecting to the network,
I lose information, do you have solution?

MQTT not enabled after reboot

Flashed WemOS D1 mini with WemosEM-1.3.1-core_2.5.bin. Configured and enabled MQTT on the Webif. Working fine. But after disconnect the Wemos aka reboot it, MQTT stays disabled and need to be reenabled by the webif to work again.

Expected behaviour would be to stay activated after a reset/reboot of the controller.

Timezone

I'm setting the Timezone field to -3 and I'm having an error!

Error saving system settings: {"timezone": "Error: timezone value incorrect (-14- + 14)"}

Energy integration Home Assistant

Someone is using this meter with the new Hassio version with the energy integration, the sensors do not appear, they can explain if it works for them and how they have done it, thank you.

Disconnects...

Hey there...

using wemosEM for month now, was fine the first few. Right now the D1s disconnect random every hour/day and I have to reset them manually. Someone has an idea how to debug this?

Every input is welcome, I'm a little lost here...

Edit: Nevermind seems to be an issue with my wifi, looks like somehow the quality of my signal degraded and if it loose the connection it doesn't seem to reconnect.

Mqtt Problem

Hi,
i configured MQTT Parameters and from Mosquitto broker logs the device is connected.

1616335675: Client wemosEM-4E7EF6 already connected, closing old connection.
1616335675: New client connected from 192.168.1.54 as wemosEM-4E7EF6 (p2, c1, k30, u'mqtt_user').

The entity created on Hassio always returns UNKNOWN
this code is in sensors.yaml

- platform: mqtt
  state_topic: "wemos/wemosem-4e7ef6/power"
  name: "EM General A"
  icon: mdi:current-ac
  unit_of_measurement: "A"
  value_template: "{{ value_json.current }}"
- platform: mqtt
  state_topic: "wemos/wemosem-4e7ef6/power"
  name: "EM General W"
  icon: mdi:power-plug
  unit_of_measurement: "W"
  value_template: "{{ value_json.watios }}"
- platform: mqtt
  state_topic: "wemos/wemosem-4e7ef6/power"
  name: "EM General KWh"
  icon: mdi:power-plug
  unit_of_measurement: "KWh"
  value_template: "{{ value_json.kwh }}"

Where am I doing wrong?

thx

homeassistant autodiscovery is gone

seems with #8 the autodiscover feature for homeassistant isnt included anymore.
I'm not sure why this was removed, but i stumbled upon it while moving to a new homeassistant instance.

would be nice to have this back... it I may ask. thanks!

WiFi.psk

Downloaded latest release, infinito&masalla not accepted as wifi password, not sure where this is set in the code?

MQTT failure on Home assistant

Antes de nada, muchas gracias por el proyecto Alfonso! Sigo en inglés.

I have a problem with the WemosEM publishing via MQTT on Home assistant. I've created the mqtt sensors and configured the server info on the WemosEM but the sensors have no data.

On the mosquitto broker log I have this message repeated several times:

1604686147: New connection from 192.168.1.172 on port 1883.
1604686147: New client connected from 192.168.1.172 as wemosEM-E3ED32 (p2, c1, k30, u'ender').
1604686193: Client wemosEM-E3ED32 has exceeded timeout, disconnecting.

Someone can send me in the right direction? Thanks

Calibration how to

Hi,
is it possible to add a small "how to" for the calibration to the readme file. The link in the app for the Current_Transformer_Conditioner calibration doesnt really make much sense as its not the same device.
Im sure a quick "how to" for working out your settings would be helpful to alot of people including myself

Thanks for the great work

1v vs 3.3v

How did you solve the fact that the CT outputs 0-1v and the Wemos D1 has a built-in voltage divider on the ADC that allows 0-3.3v on the ADC? If you don't boost the CT output, you will only use 1/3 of the resolution of the ADC, giving you only 333 steps between 0A and 30A, about 0.1A steps, which would mean 22W "resolution". Please advice.

platformio compile problems

First, thanks for such a nice project. I'm having problems compiling using PlatformIO, version 4.0.3 (which is currently latest). When using (default) platform_150 it doesn't fit:

/home/dpavlin/.platformio/packages/[email protected]/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: .pio/build/d1_mini/firmware.elf section `.text' will not fit in region `iram1_0_seg'
collect2: error: ld returned 1 exit status
*** [.pio/build/d1_mini/firmware.elf] Error 1

And when compiling with all others I get:

Setup finished

Exception (3):
epc1=0x4021c03c epc2=0x00000000 epc3=0x00000000 excvaddr=0x4025c5d7 depc=0x00000000

And esp keeps rebooting.

Your release binary does work for me, so I'm wondering how did you compile it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.