alcar21 / wemosem Goto Github PK
View Code? Open in Web Editor NEWCheap power monitor (STC013) with Home Assistant Discover and Wemos D1 Mini / PRO (esp8266)
Cheap power monitor (STC013) with Home Assistant Discover and Wemos D1 Mini / PRO (esp8266)
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
Can I use this board code to monitor my house at the mains board? Thanks
@alcar21
Could you provide power monitoring for 3 phase.
Maybe with ESP32, MCP3008 or ADS1115.
Thanks.
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!
Could you provide more information for Blynk integration?
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
I have a SCT-013-030 and my readings are off when using the ICAL proposed on http://lechacal.com/wiki/index.php/Current_Transformer_Conditioner. I need to push the ICAL up to 140 to get something reasonable. However, I was using the firmware from the domology tutorial and my readings were correct with the hardware as is.
I saw that @rechena ended up removing his in this issue #14 but I'm not sure if I should too.
So, do I take it out?
Thanks!
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
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
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
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?
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.
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)"}
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.
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.
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
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!
Downloaded latest release, infinito&masalla not accepted as wifi password, not sure where this is set in the code?
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
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
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.
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?
Could you provide a Domoticz integration via MQTT?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.