[Activity]: Share your application with IAMMETER and win free wifi power meter
More detail please refer to :https://www.iammeter.com/newsshow/activity-210618
Welcome to our activity, please send your content link below this post.We will review it at first time and reply you soon.
Best Regards
IAMMETER team
Este é o meu projeto.
Autoconsumo com 1500w wm Paineis Solares Fotovoltaicos.
Sistema de medição IAMMETER.
Estou fascinado com este sistema. Obrigado.
Hi Jorge:
Thanks for your comments.
If you want to share your site, there are some setting need to be done.
https://www.iammeter.com/docs/share-your-site
Otherwise , other person can not open your link
If you want to participate this activity, only a share link is not enough.
Anyway, thanks for your attention.
Thanks again
Here's my current system
19.6 kWp on 15kW inverters (3 x 5kw) three phase system, 1 inverter per phase
2 x Tesla powerwall (13.5 kW x 2)
Currently have one WEM 3080T monitoring the grid feed only, I have another meter on the wayto add in the solar. So with the batteries, I currently generally only show export in the afternoons, because I arely need to import anything.
My link is here https://www.iammeter.com/home/share/7e5eb800e706437295b86b12c7400a0e
password pexpa$$
The main reason I chose iammeter product was for the integrartion into home assistant.
I now have a fully customised monitoring solution with the 2 systems working together.
The integration allows me to both monitor usage and export and the feedback allows better control of when and how to charge the Kona and Zoe EVs we have.
It has made life much easier.
We are adding more sensors to furhter enhance the scope of the system.
Hi Greg, Thanks for your sharing.
We have scored your post according to the following scoring standard (https://www.iammeter.com/newsshow/activity-210618)
The full score is one hundred points, which is divided according to the following standards.
- Effectiveness: whether the application itself can bring benefits to others (40 points).
- Reproducibility: whether the application can help others (30 points).
- Propaganda: whether the post itself play a role in promoting IAMMETER system and products (30 points).
According to this standard, your scores are rated as follows.
Full Scores | Your Scores | Description | |
---|---|---|---|
Effectiveness | 40 | 20 | Clear description of individual need(10/10) Clear description of application scenarios, but lack of specific introduction and configuration steps(10/20) Lack of specific quantitative indicators about your application(0/10) |
Reproducibility | 30 | 0 | Did not provide solutions that others can replicate (0/30) |
Propaganda | 30 | 10 | Share the URL of your IAMMETER overview webpage (10/10) Not posted to other forums (0/10) Not attracted attention on other forums by posting your application there (0/10) |
Therefore, your total score is 30 points, which should be the third prize according to our rule. But since you are the first person to participate in this activity, in order to thank you for your participation, we decided to award you the second prize.
The prize is a single phase WiFi energy Meter(WEM3080).
If you have no other comments, please contact us through the feedback system. https://www.iammeter.com/docs/feedback-and-notification
Thanks again for your participation!
IAMMETER Team
The first WEM3080(2nd prize) had been sent out and installed .
Looking forward to more interesting application.
Dear IAMMETER team,
I would like to lead my solar project. In the project I use two WEM3080T devices (one is optional) that are queried via RS485. The data is processed and sent to a Node Red server. This leads the total power of all 3 phases to Arduino devices, which in turn control inverters so that they generate the corresponding power so that the main meter almost reaches 0 watts.
I would like to publish everything about the project here.
- Drawing of the structure of the system, used charge controller and inverter (including company name and model).
- Circuit diagram and program code for the RS485 retrieval and forwarding to the MQTT Node Red Server. I need your approval for the program code or whether I should remove part of it.
- Node Red code from the controls
- Circuit diagram + program code for controlling the inverters
- Small instructions for converting the inverter for external control.
I ask for a short feedback regarding the publication of the program code for the RS485 retrieval and the naming of the company / device name of the charge controller and inverter.
Because my English is not that good, I use a translator. Hope this is okay.
Thanks for the feedback
Hi Torakas
Thanks for your attention for our project. Please see my reply below.
I need your approval for the program code or whether I should remove part of it.
It is OK.
I ask for a short feedback regarding the publication of the program code for the RS485 retrieval and the naming of the company / device name of the charge controller and inverter.
It is OK.
You can release all the information about your project here(include our RS485 protocol and the corresponding inverter brand name).
Looking forward your project introduction.
But please note, As the activity criteria listed in https://www.iammeter.com/newsshow/activity-210618#activity-criteria
"Propaganda: whether the post itself play a role in promoting IAMMETER system and products (30 points)."
You will get more chance to be award 1st if you post your project to other hot forum (you can paste the corresponding url here) than you post it here.
BR
This is my solar system in Home Assistant. It uses a WEM380T on the grid, solar feed and house. I infer power to the EV car charger as it is on a separate feed off my main fuse board.
I also provide my Home Asssiant Code below including the pretty animated GIF on power flow that has the 'bubbles' on each power line move at a speed proportional to power flow.
https://wiki.bunnfamily.nz/index.php?title=Solar_Panels#Power_Flow_Diagram
Hi Smbunn:
Thanks for your sharing.
According to this standard listed in https://www.iammeter.com/newsshow/activity-210618#activity-criteria ,
your scores are rated as follows.
Full Scores | Your Scores | Description | |
---|---|---|---|
Effectiveness | 40 | 30 | |
Reproducibility | 30 | 30 | provide solutions that others can replicate (30/30) |
Propaganda | 30 | 10 | share IAMMETER in your wiki |
The prize is a single phase WiFi energy Meter(WEM3080).
If you have no other comments, please contact us through the feedback system. https://www.iammeter.com/docs/feedback-and-notification
Thanks again for your participation!
IAMMETER Team
Dear IAMMETER team,
I hereby present my project with the IAMMETER WEM3080T.
As a starting system, I have a three-phase connection with a digital accumulating electricity meter. This means that if 1000 watts are drawn from the electricity supplier on L1 and 1000 watts or more is fed in together on L2 and L3, then the meter stops.
As a solar system I have 6KWp. The solar MPTT charge controller (EPEver Tracer 8420AN) stores the electricity in 16S LiFePo4 310Ah batteries (> 15kW). There are currently 3 inverters each 1000 watts (Sun-1000GTIL2) with limiter function attached to the batteries. These inverters themselves have a bracket to measure the power consumption on one phase and to send this to the house's power grid on the same phase. To measure all 3 phases you would need a separate inverter on each phase, which would then only send up to 1000 watts per phase into the house's power grid. That would mean if on L1 phase 1500 watts and on the other phases L2 and L3 together 300 watts (total 1800 watts) you still draw 500 watts from the electricity supplier because the inverter from L1 only creates 1000 watts. If each inverter were to produce 600 watts, it would be balanced again and nothing would be drawn from the electricity supplier.
Therefore, the internal limiter function of the SUN inverters is not used in this project, but the IAMMETER WEM3080T takes over the measurement of consumption. The data from the WEM3080T is read out via the RS485 interface with an Arduino device / program and forwarded to an MQTT server via WIFI. In this example, this is done by a Node Red Server running on a Raspberry Pi 4.
The Node Red Server adds up the total consumption on all phases and distributes the load to all inverters. For this purpose, the requested load is also sent to an Arduino device via MQTT command, which controls a digital analog converter (DAC) which is then attached to the inverter and thus controls it.
The inverters feed the current between the main fuse and the IAMMETER WEM3080T so that the WEM3080T only measures the consumption in the house. For the WEM3080T, the fed-in current from the inverters is as if it came from the electricity supplier. So that you know how much the inverters have produced in total, you can add another WEM3080T to the inverters to measure the electricity produced. This is optional, but helps to create the table of how much voltage the DAC should deliver at which wattage of the inverter.
The second WEM3080T could be replaced by a DIY solution, but it turned out that it does not measure the current exactly. I currently still have a DIY solution, but would prefer the second WEM3080T here, which I could then use better with the cloud.
The products (WEM3080 (T)) from IAMMETER are my first choice after a long research with other products. They are very accurate in their measurements (checked) and the support is really great.
There are regular updates with further features and if you have problems you can get help very quickly in the forum. Here at this point a real praise and keep it up.
But enough of the theory and we go straight to the detailed description of my project with all circuit diagrams, Arduino / Node Red program code.
Here I show the structure of my project with the WEM3080T and the inverters how they are connected.
Circuit diagram to read out the data from the WEM3080T via the RS485 interface:
Arduino IDE source code for data retrieval:
#include <ModbusMaster.h>
#include <SoftwareSerial.h>
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#define ARDUINOJSON_USE_LONG_LONG 1
#include <ArduinoJson.h>
#include <WiFiUdp.h>
#include <NTPClient.h>
#include <TimeLib.h>
#include <Timezone.h> // https://github.com/JChristensen/Timezone
// Define your own values *************************
const char* wifi_ssid = "************";
const char* wifi_password = "**********************";
const char* mqtt_server = "192.168.1.5";
const char* topic = "IAM/griddata";
#define ESP8266Client "IAM"
WiFiClient espClient;
PubSubClient client(espClient);
String json;
float voltageA;
float currentA;
float powerA;
float pfA;
float energyPositivA;
float energyNegativA;
int statusA;
float voltageB;
float currentB;
float powerB;
float pfB;
float energyPositivB;
float energyNegativB;
int statusB;
float voltageC;
float currentC;
float powerC;
float pfC;
float energyPositivC;
float energyNegativC;
int statusC;
float voltage;
float current;
float power;
float pf;
float energyPositiv;
float Hz;
float energyNegativ;
float energyPositivDay;
float energyNegativDay;
#define BAUD_RATE 9600 // Modbus communication runs at 9600 baud
SoftwareSerial swSer(14, 16); //GPIO16-D0-Tx, GPIO14-D5-Rx
/*!
We're using a MAX485-compatible RS485 Transceiver.
Rx/Tx is hooked up to the hardware serial port at 'SoftwareSerial'.
The Data Enable and Receiver Enable pins are hooked up as follows:
*/
#define MAX485_DE 13 //GPIO13-D7 Control Half-Duplex
#define MAX485_RE_NEG 13
// instantiate ModbusMaster object
ModbusMaster node;
WiFiUDP ntpUDP; // WiFi UDP Client
// You can specify the time server pool and the offset, (in seconds)
// additionaly you can specify the update interval (in milliseconds).
int GTMOffset = 0; // SET TO UTC TIME
NTPClient timeClient(ntpUDP, "europe.pool.ntp.org", GTMOffset*60*60, 60*60*1000);
// Central European Time (Frankfurt, Paris)
TimeChangeRule CEST = {"CEST", Last, Sun, Mar, 2, 120}; // Central European Summer Time
TimeChangeRule CET = {"CET ", Last, Sun, Oct, 3, 60}; // Central European Standard Time
Timezone CE(CEST, CET);
void preTransmission()
{
digitalWrite(MAX485_RE_NEG, 1);
digitalWrite(MAX485_DE, 1);
}
void postTransmission()
{
digitalWrite(MAX485_RE_NEG, 0);
digitalWrite(MAX485_DE, 0);
}
void setup()
{
pinMode(MAX485_RE_NEG, OUTPUT);
pinMode(MAX485_DE, OUTPUT);
// Init in receive mode
digitalWrite(MAX485_RE_NEG, 0);
digitalWrite(MAX485_DE, 0);
Serial.begin(115200);
swSer.begin(BAUD_RATE); // Modbus communication runs at 9600 baud
// Modbus slave ID 1
node.begin(1, swSer);
// Callbacks allow us to configure the RS485 transceiver correctly
node.preTransmission(preTransmission);
node.postTransmission(postTransmission);
WiFi.mode(WIFI_STA);
setup_wifi();
client.setServer(mqtt_server, 1883);
// client.setCallback(callback);
// NTP Client starten
timeClient.begin();
// Force NTP Update
int loopcount = 0;
while (!timeClient.forceUpdate()) { // NTP Update check
Serial.println("NTP Update failed.");
delay (1000);
if (loopcount == 5)
timeClient.setPoolServerName("192.168.1.1");
if (loopcount == 360)
ESP.restart(); //Wemos resetten
}
// Set NTP Time in TimeLib
//setTime(CE.toUTC(timeClient.getEpochTime()));
setTime(timeClient.getEpochTime()); // set time from NTP Server
}
bool state = true;
uint monthday = 0;
float energyPositivStart = 0;
float energyNegativStart = 0;
#define RS485StartRegister 0x0048
void loop()
{
uint8_t result;
uint16_t data[6];
Serial.println("loop");
// Read registers
result = node.readHoldingRegisters(RS485StartRegister, 32);
if (result == node.ku8MBSuccess)
{
voltageA = (node.getResponseBuffer(0x00) / 100.0f);
currentA = (node.getResponseBuffer(0x01) / 100.0f);
powerA = (node.getResponseBuffer(0x02));
energyPositivA = (node.getResponseBuffer(0x03) * 256);
energyPositivA += (node.getResponseBuffer(0x04));
energyPositivA = energyPositivA / 800.0f;
pfA = (node.getResponseBuffer(0x05) / 1000.0f);
energyNegativA = (node.getResponseBuffer(0x06) * 256);
energyNegativA += (node.getResponseBuffer(0x07));
energyNegativA = energyNegativA / 800.0f;
statusA = highByte(node.getResponseBuffer(0x08));
if (statusA == 1) {
powerA = powerA * -1.0f;
currentA = currentA * -1.0f;
}
voltageB = (node.getResponseBuffer(0x09) / 100.0f);
currentB = (node.getResponseBuffer(0x0A) / 100.0f);
powerB = (node.getResponseBuffer(0x0B));
energyPositivB = (node.getResponseBuffer(0x0C) * 256);
energyPositivB += (node.getResponseBuffer(0x0D));
energyPositivB = energyPositivB / 800.0f;
pfB = (node.getResponseBuffer(0x0E) / 1000.0f);
energyNegativB = (node.getResponseBuffer(0x0F) * 256);
energyNegativB += (node.getResponseBuffer(0x10));
energyNegativB = energyNegativB / 800.0f;
statusB = highByte(node.getResponseBuffer(0x11));
if (statusB == 1) {
powerB = powerB * -1.0f;
currentB = currentB * -1.0f;
}
voltageC = (node.getResponseBuffer(0x12) / 100.0f);
currentC = (node.getResponseBuffer(0x13) / 100.0f);
powerC = (node.getResponseBuffer(0x14));
energyPositivC = (node.getResponseBuffer(0x15) * 256);
energyPositivC += (node.getResponseBuffer(0x16));
energyPositivC = energyPositivC / 800.0f;
pfC = (node.getResponseBuffer(0x17) / 1000.0f);
energyNegativC = (node.getResponseBuffer(0x18) * 256);
energyNegativC += (node.getResponseBuffer(0x19));
energyNegativC = energyNegativC / 800.0f;
statusC = highByte(node.getResponseBuffer(0x1A));
if (statusC == 1) {
powerC = powerC * -1.0f;
currentC = currentC * -1.0f;
}
// Round / Cut after Dot 2-3 Digits
voltage = ((uint)(((voltageA + voltageB + voltageC) / 3) * 100.0f)) / 100.0f;
current = ((int)((currentA + currentB + currentC) * 100.0f)) / 100.0f;
power = ((int)((powerA + powerB + powerC) * 100.0f)) / 100.0f;
pf = ((uint)(((pfA + pfB + pfC) / 3) * 1000.0f)) / 1000.0f;
energyPositiv = (node.getResponseBuffer(0x1B) * 256);
energyPositiv += (node.getResponseBuffer(0x1C));
energyPositiv = energyPositiv / 800.0f;
Hz = (node.getResponseBuffer(0x1D) / 100.0f);
energyNegativ = (node.getResponseBuffer(0x1E) * 256);
energyNegativ += (node.getResponseBuffer(0x1F));
energyNegativ = energyNegativ / 800.0f;
// If the day has change, reset the data
if (monthday != day(CE.toLocal(now()))) {
Serial.println("New day - Reset energy start value");
energyPositivStart = energyPositiv;
energyNegativStart = energyNegativ;
monthday = day(CE.toLocal(now()));
}
energyPositivDay = energyPositiv - energyPositivStart;
energyNegativDay = energyNegativ - energyNegativStart;
Serial.print("voltage A: "); Serial.println(voltageA);
Serial.print("current A: "); Serial.println(currentA);
Serial.print("power A: "); Serial.println(powerA);
Serial.print("pf A: "); Serial.println(pfA);
Serial.print("energyPositiv A: "); Serial.println(energyPositivA);
Serial.print("energyNegativ A: "); Serial.println(energyNegativA);
Serial.print("status A: "); Serial.println(statusA);
Serial.println("------------------------------------");
Serial.print("voltage B: "); Serial.println(voltageB);
Serial.print("current B: "); Serial.println(currentB);
Serial.print("power B: "); Serial.println(powerB);
Serial.print("pf B: "); Serial.println(pfB);
Serial.print("energyPositiv B: "); Serial.println(energyPositivB);
Serial.print("energyNegativ B: "); Serial.println(energyNegativB);
Serial.print("status B: "); Serial.println(statusB);
Serial.println("------------------------------------");
Serial.print("voltage C: "); Serial.println(voltageC);
Serial.print("current C: "); Serial.println(currentC);
Serial.print("power C: "); Serial.println(powerC);
Serial.print("pf C: "); Serial.println(pfC);
Serial.print("energyPositiv C: "); Serial.println(energyPositivC);
Serial.print("energyNegativ C: "); Serial.println(energyNegativC);
Serial.print("status C: "); Serial.println(statusC);
Serial.println("------------------------------------");
Serial.print("voltage: "); Serial.println(voltage);
Serial.print("current: "); Serial.println(current);
Serial.print("power : "); Serial.println(power);
Serial.print("pf : "); Serial.println(pf);
Serial.print("energyPositiv: "); Serial.println(energyPositiv);
Serial.print("energyNegativ: "); Serial.println(energyNegativ);
Serial.print("Hz : "); Serial.println(Hz);
Serial.print("energyPositivDay: "); Serial.println(energyPositivDay);
Serial.print("energyNegativDay: "); Serial.println(energyNegativDay);
char buffer[512];
StaticJsonDocument<512> doc;
uint tnow = now();
doc["TimeStamp"] = CE.toLocal(tnow); //timeClient.getEpochTime();
doc["FormatedDate"] = timeClient.getFormattedDate(CE.toLocal(tnow));
doc["voltage"] = voltage;
doc["current"] = current;
doc["power"] = power;
doc["pf"] = pf;
doc["energyPositiv"] = energyPositiv;
doc["energyNegativ"] = energyNegativ;
doc["energyPositivDay"] = energyPositivDay;
doc["energyNegativDay"] = energyNegativDay;
doc["voltageA"] = voltageA;
doc["currentA"] = currentA;
doc["powerA"] = powerA;
doc["pfA"] = pfA;
doc["statusA"] = statusA;
doc["voltageB"] = voltageB;
doc["currentB"] = currentB;
doc["powerB"] = powerB;
doc["pfB"] = pfB;
doc["statusB"] = statusB;
doc["voltageC"] = voltageC;
doc["currentC"] = currentC;
doc["powerC"] = powerC;
doc["pfC"] = pfC;
doc["statusC"] = statusC;
size_t n = serializeJson(doc, buffer);
// If the MQTT buffer is to low, set it higher. Standard is 256 chars
if (client.getBufferSize() <= n) {
client.setBufferSize(n + 50);
delay(20);
}
if (!client.connected()) {
reconnect();
}
client.publish(topic, String(buffer).c_str(), true);
Serial.println(buffer);
Serial.println("####################################");
}
delay(2000);
}
void setup_wifi() {
//WiFi.setmode(STATION);
delay(10);
// We start by connecting to a WiFi network
Serial.print("Connecting to ");
Serial.print(wifi_ssid);
WiFi.begin(wifi_ssid, wifi_password);
int x = 0;
while (WiFi.status() != WL_CONNECTED) {
delay(300);
Serial.print(".");
}
Serial.println("");
Serial.print("WiFi connected, IP address: ");
Serial.println(WiFi.localIP());
}
void reconnect() {
// Loop until we're reconnected
while (!client.connected()) {
Serial.print("Attempting MQTT connection...Topic:");
if (client.connect(ESP8266Client)) {
Serial.println("connected");
client.subscribe(topic);
} else {
Serial.print("failed, rc=");
Serial.print(client.state());
Serial.println(" try again in 5 seconds");
// Wait 5 seconds before retrying
delay(5000);
}
}
}
Modification of the SUN 1000 inverter for DAC control:
For the conversion, the inverter must be unscrewed (attention: the inverter must be disconnected from the AC / DC power, otherwise risk to life) and the plug from the external limiter must be plugged into the free port on the controller board. With this we can control the port for the external limiter for the DAC.
Each SUN limiter should be controlled with its own DAC and the voltage from the DB9 connection of each inverter - not that external voltages come from another limiter via the control line, which could destroy the controller board.
Circuit diagram from the Arduino Digital Analog Controller (DAC):
Arduino IDE source code for the Arduino DAC:
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include <Adafruit_MCP4725.h>
#include <Wire.h>
#define ARDUINOJSON_USE_LONG_LONG 1
#include <ArduinoJson.h>
Adafruit_MCP4725 dac;
// Define your own values
const char* wifi_ssid = "****************";
const char* wifi_password = "************";
const char* mqtt_server = "192.168.1.5";
const char* topic = "SunDAC_A/set"; //Power Request for the DAC
#define ESP8266Client "SunDAC_A"
#define wifihostname "SunDAC_A"
//***************************************************
WiFiClient espClient;
PubSubClient client(espClient);
typedef struct {
uint16_t power;
uint16_t dacValue;
} dacDictionary;
// Pre computed dac table
static const dacDictionary dacTable[] = {
{ 0, 0 }, { 12, 2 }, { 13, 17 }, { 16, 22 }, { 18, 27 }, { 21, 32 }, { 22, 34 }, { 23, 37 },
{ 24, 40 }, { 25, 42 }, { 29, 47 }, { 30, 50 }, { 32, 52 }, { 35, 57 }, { 37, 60 }, { 38, 65 },
{ 40, 67 }, { 42, 70 }, { 45, 80 }, { 46, 75 }, { 48, 77 }, { 50, 87 }, { 54, 90 }, { 55, 93 },
{ 58, 98 }, { 60, 95 }, { 61, 103 }, { 65, 105 }, { 66, 100 }, { 73, 110 }, { 75, 113 }, { 77, 115 },
{ 82, 118 }, { 84, 120 }, { 86, 123 }, { 88, 130 }, { 89, 140 }, { 90, 125 }, { 92, 145 }, { 94, 135 },
{ 95, 153 }, { 97, 128 }, { 99, 168 }, { 100, 158 }, { 101, 165 }, { 102, 155 }, { 104, 178 }, { 105, 175 },
{ 107, 170 }, { 108, 173 }, { 113, 180 }, { 114, 188 }, { 115, 186 }, { 116, 196 }, { 117, 201 }, { 118, 203 },
{ 120, 191 }, { 124, 208 }, { 134, 218 }, { 138, 211 }, { 143, 216 }, { 144, 229 }, { 150, 239 }, { 152, 221 },
{ 153, 234 }, { 154, 244 }, { 156, 246 }, { 161, 236 }, { 162, 251 }, { 166, 241 }, { 171, 264 }, { 177, 253 },
{ 183, 269 }, { 184, 257 }, { 189, 274 }, { 190, 272 }, { 191, 267 }, { 192, 297 }, { 193, 262 }, { 195, 295 },
{ 197, 259 }, { 204, 279 }, { 205, 312 }, { 207, 287 }, { 208, 282 }, { 209, 300 }, { 213, 284 }, { 214, 302 },
{ 216, 277 }, { 219, 310 }, { 226, 340 }, { 227, 317 }, { 229, 315 }, { 230, 320 }, { 231, 330 }, { 233, 333 },
{ 234, 325 }, { 235, 338 }, { 238, 343 }, { 242, 352 }, { 243, 345 }, { 245, 357 }, { 246, 362 }, { 247, 348 },
{ 248, 372 }, { 249, 370 }, { 253, 367 }, { 254, 385 }, { 255, 382 }, { 256, 375 }, { 257, 377 }, { 261, 405 },
{ 262, 418 }, { 264, 410 }, { 265, 407 }, { 266, 423 }, { 267, 428 }, { 268, 443 }, { 269, 425 }, { 270, 430 },
{ 271, 450 }, { 273, 433 }, { 274, 458 }, { 275, 448 }, { 277, 466 }, { 278, 468 }, { 280, 471 }, { 281, 476 },
{ 283, 487 }, { 284, 486 }, { 285, 483 }, { 287, 500 }, { 288, 497 }, { 289, 503 }, { 291, 517 }, { 292, 519 },
{ 293, 513 }, { 294, 515 }, { 295, 525 }, { 296, 527 }, { 297, 530 }, { 300, 562 }, { 301, 540 }, { 302, 560 },
{ 303, 572 }, { 305, 570 }, { 307, 582 }, { 309, 577 }, { 310, 590 }, { 311, 587 }, { 312, 580 }, { 314, 605 },
{ 315, 595 }, { 316, 600 }, { 317, 603 }, { 318, 598 }, { 319, 617 }, { 321, 613 }, { 322, 610 }, { 323, 640 },
{ 325, 622 }, { 326, 638 }, { 328, 627 }, { 329, 630 }, { 330, 635 }, { 331, 663 }, { 333, 655 }, { 334, 658 },
{ 335, 661 }, { 336, 653 }, { 338, 676 }, { 339, 671 }, { 341, 680 }, { 342, 677 }, { 343, 687 }, { 344, 682 },
{ 346, 702 }, { 347, 700 }, { 348, 710 }, { 349, 695 }, { 351, 720 }, { 352, 722 }, { 354, 725 }, { 356, 727 },
{ 359, 735 }, { 360, 742 }, { 361, 750 }, { 363, 755 }, { 366, 753 }, { 368, 783 }, { 369, 765 }, { 370, 758 },
{ 371, 781 }, { 372, 770 }, { 373, 773 }, { 375, 793 }, { 376, 788 }, { 377, 798 }, { 380, 796 }, { 381, 801 },
{ 382, 808 }, { 384, 839 }, { 385, 806 }, { 386, 831 }, { 387, 834 }, { 388, 826 }, { 390, 842 }, { 391, 847 },
{ 392, 859 }, { 394, 862 }, { 395, 849 }, { 396, 854 }, { 399, 869 }, { 400, 872 }, { 401, 874 }, { 403, 887 },
{ 404, 879 }, { 405, 882 }, { 407, 900 }, { 408, 889 }, { 410, 897 }, { 411, 905 }, { 412, 895 }, { 414, 907 },
{ 415, 930 }, { 416, 902 }, { 417, 917 }, { 418, 927 }, { 419, 912 }, { 422, 940 }, { 424, 935 }, { 425, 945 },
{ 426, 938 }, { 429, 950 }, { 430, 953 }, { 431, 976 }, { 432, 973 }, { 433, 960 }, { 436, 963 }, { 437, 978 },
{ 438, 971 }, { 439, 965 }, { 441, 986 }, { 442, 981 }, { 447, 988 }, { 448, 991 }, { 449, 1001 }, { 450, 993 },
{ 452, 996 }, { 453, 1010 }, { 457, 1013 }, { 459, 1015 }, { 460, 1028 }, { 462, 1041 }, { 463, 1038 }, { 464, 1025 },
{ 465, 1033 }, { 467, 1043 }, { 468, 1046 }, { 469, 1023 }, { 472, 1048 }, { 473, 1051 }, { 474, 1064 }, { 476, 1060 },
{ 479, 1062 }, { 480, 1067 }, { 481, 1092 }, { 482, 1089 }, { 483, 1082 }, { 484, 1077 }, { 487, 1072 }, { 490, 1099 },
{ 491, 1094 }, { 492, 1087 }, { 495, 1105 }, { 498, 1107 }, { 499, 1110 }, { 500, 1115 }, { 501, 1117 }, { 503, 1120 },
{ 507, 1112 }, { 508, 1125 }, { 509, 1132 }, { 510, 1122 }, { 514, 1139 }, { 515, 1142 }, { 520, 1137 }, { 522, 1167 },
{ 523, 1150 }, { 524, 1152 }, { 526, 1162 }, { 527, 1160 }, { 528, 1165 }, { 530, 1154 }, { 531, 1172 }, { 533, 1175 },
{ 534, 1185 }, { 535, 1180 }, { 541, 1170 }, { 543, 1195 }, { 544, 1215 }, { 545, 1200 }, { 546, 1182 }, { 547, 1187 },
{ 548, 1202 }, { 549, 1197 }, { 550, 1220 }, { 552, 1208 }, { 556, 1218 }, { 558, 1205 }, { 559, 1235 }, { 560, 1225 },
{ 562, 1223 }, { 567, 1241 }, { 568, 1243 }, { 570, 1233 }, { 573, 1238 }, { 577, 1253 }, { 578, 1255 }, { 582, 1270 },
{ 583, 1265 }, { 584, 1267 }, { 585, 1260 }, { 586, 1275 }, { 588, 1282 }, { 591, 1277 }, { 594, 1300 }, { 598, 1280 },
{ 600, 1290 }, { 602, 1295 }, { 603, 1292 }, { 604, 1303 }, { 607, 1298 }, { 609, 1318 }, { 610, 1308 }, { 611, 1310 },
{ 612, 1313 }, { 614, 1325 }, { 617, 1338 }, { 619, 1328 }, { 620, 1331 }, { 621, 1320 }, { 627, 1336 }, { 628, 1354 },
{ 629, 1343 }, { 631, 1356 }, { 633, 1358 }, { 636, 1364 }, { 637, 1369 }, { 641, 1361 }, { 645, 1377 }, { 648, 1389 },
{ 650, 1382 }, { 651, 1402 }, { 652, 1379 }, { 655, 1384 }, { 663, 1397 }, { 664, 1404 }, { 665, 1399 }, { 666, 1409 },
{ 669, 1414 }, { 673, 1412 }, { 675, 1434 }, { 676, 1422 }, { 680, 1437 }, { 681, 1444 }, { 683, 1432 }, { 684, 1439 },
{ 685, 1450 }, { 690, 1457 }, { 691, 1447 }, { 693, 1465 }, { 694, 1460 }, { 697, 1470 }, { 699, 1480 }, { 703, 1478 },
{ 704, 1487 }, { 705, 1485 }, { 706, 1494 }, { 710, 1483 }, { 711, 1492 }, { 712, 1502 }, { 713, 1499 }, { 717, 1497 },
{ 719, 1507 }, { 721, 1511 }, { 725, 1514 }, { 734, 1519 }, { 735, 1529 }, { 736, 1524 }, { 740, 1532 }, { 741, 1534 },
{ 743, 1544 }, { 747, 1549 }, { 749, 1552 }, { 751, 1547 }, { 752, 1562 }, { 753, 1557 }, { 754, 1567 }, { 755, 1577 },
{ 756, 1575 }, { 757, 1570 }, { 760, 1579 }, { 762, 1581 }, { 763, 1586 }, { 764, 1591 }, { 765, 1589 }, { 766, 1584 },
{ 768, 1599 }, { 769, 1603 }, { 770, 1594 }, { 772, 1595 }, { 774, 1614 }, { 777, 1608 }, { 778, 1611 }, { 779, 1618 },
{ 782, 1616 }, { 783, 1621 }, { 787, 1628 }, { 790, 1640 }, { 791, 1638 }, { 792, 1645 }, { 793, 1635 }, { 795, 1633 },
{ 796, 1631 }, { 799, 1643 }, { 800, 1650 }, { 802, 1647 }, { 805, 1657 }, { 807, 1652 }, { 809, 1655 }, { 810, 1672 },
{ 812, 1667 }, { 814, 1662 }, { 815, 1683 }, { 816, 1677 }, { 817, 1665 }, { 821, 1680 }, { 822, 1705 }, { 823, 1685 },
{ 826, 1690 }, { 827, 1688 }, { 828, 1703 }, { 831, 1700 }, { 832, 1695 }, { 833, 1713 }, { 834, 1698 }, { 835, 1718 },
{ 837, 1726 }, { 841, 1728 }, { 844, 1731 }, { 846, 1741 }, { 847, 1733 }, { 848, 1723 }, { 850, 1738 }, { 851, 1721 },
{ 853, 1756 }, { 855, 1754 }, { 857, 1751 }, { 863, 1759 }, { 865, 1764 }, { 866, 1766 }, { 869, 1787 }, { 871, 1792 },
{ 872, 1761 }, { 873, 1779 }, { 875, 1781 }, { 876, 1771 }, { 878, 1789 }, { 880, 1797 }, { 882, 1804 }, { 883, 1784 },
{ 887, 1807 }, { 888, 1799 }, { 889, 1814 }, { 892, 1812 }, { 893, 1809 }, { 895, 1817 }, { 897, 1845 }, { 898, 1819 },
{ 900, 1832 }, { 902, 1837 }, { 903, 1824 }, { 905, 1847 }, { 906, 1829 }, { 907, 1857 }, { 908, 1842 }, { 909, 1852 },
{ 910, 1860 }, { 912, 1840 }, { 915, 1862 }, { 916, 1869 }, { 918, 1880 }, { 919, 1868 }, { 921, 1855 }, { 924, 1878 },
{ 925, 1875 }, { 928, 1949 }, { 929, 1873 }, { 932, 1885 }, { 933, 1921 }, { 934, 1895 }, { 935, 1933 }, { 940, 1883 },
{ 941, 1898 }, { 942, 1908 }, { 943, 1918 }, { 946, 1903 }, { 948, 1936 }, { 962, 1941 }
};
void setup() {
Serial.begin(115200);
WiFi.mode(WIFI_STA);
setup_wifi();
client.setServer(mqtt_server, 1883);
client.setCallback(callback);
dac.begin(0x60);
delay(1000);
dac.setVoltage(0, false);
}
void loop() {
if (!client.connected()) {
reconnect();
}
client.loop();
// delay(100);
}
void setup_wifi() {
//WiFi.setmode(STATION);
WiFi.setHostname(wifihostname);
delay(10);
// We start by connecting to a WiFi network
Serial.print("Connecting to ");
Serial.print(wifi_ssid);
WiFi.begin(wifi_ssid, wifi_password);
int x = 0;
while (WiFi.status() != WL_CONNECTED) {
delay(300);
Serial.print(".");
}
Serial.println("");
Serial.print("WiFi connected, IP address: ");
Serial.println(WiFi.localIP());
}
void reconnect() {
// Loop until we're reconnected
while (!client.connected()) {
Serial.print("Attempting MQTT connection...Topic:");
if (client.connect(ESP8266Client)) {
Serial.println("connected");
// topic = reset_topic;
client.subscribe(topic);
} else {
Serial.print("failed, rc=");
Serial.print(client.state());
Serial.println(" try again in 5 seconds");
// Wait 5 seconds before retrying
delay(5000);
}
}
}
float powersum = 0;
unsigned int devices = 1;
unsigned int rawvalue = 0;
void callback(char* topic, byte * payload, unsigned int length) {
Serial.print("Message arrived [");
Serial.print(topic);
Serial.print("], ");
Serial.print("Length is ");
Serial.println(length);
char *callbackString = (char *) payload;
callbackString[length] = '\0'; // Adds a terminator to end of string based on length of current payload
//Serial.println(topic);
//need to convert the payloads from bytes to strings for easy display
payload[length] = '\0';
String strPayload = String((char*)payload);
Serial.print("Callback payload: ");
Serial.println(strPayload);
StaticJsonDocument<256> doc;
DeserializationError err = deserializeJson(doc, payload, length);
if (err)
{
Serial.print(F("deserializeJson() failed with code: "));
Serial.println(err.c_str());
Serial.println("Set DAC to zero voltage.");
dac.setVoltage(0, false);
}
else
{
powersum = (float) doc["powersum"];
Serial.print("powersum: ");
Serial.println(powersum);
if (doc.containsKey("devices"))
{
devices = (unsigned int) doc["devices"];
if (devices == 0)
{
devices = 1;
}
Serial.print("devices: ");
Serial.println(devices);
}
if (doc.containsKey("rawvalue"))
{
rawvalue = (unsigned int) doc["rawvalue"];
Serial.print("rawvalue: ");
Serial.println(rawvalue);
}
Serial.println("");
Serial.print("power request: ");
Serial.println(powersum);
uint16_t maxPower = 0;
int maxPowerDacTablePos = 0;
int dacTablePos = 0;
uint16_t dacValue = 0;
for(uint16_t i = 0; i < sizeof(dacTable)/sizeof(dacDictionary); ++i) {
float forpower = dacTable[i].power;
if (forpower > maxPower) {
maxPower = forpower;
maxPowerDacTablePos = i;
}
if ((powersum / devices) - forpower < 0) {
dacTablePos = i;
dacValue = dacTable[i].dacValue;
break;
}
}
if (dacValue == 0 && (powersum / devices) > maxPower) {
dacTablePos = maxPowerDacTablePos;
dacValue = dacTable[dacTablePos].dacValue;
}
Serial.print("Position: ");
Serial.println(dacTablePos);
if (rawvalue > 0) {
dacValue = rawvalue;
Serial.print("RAW DAC Value: ");
Serial.println(dacValue);
} else {
if (powersum == 0) {
dacValue = 0;
}
Serial.print("DAC Value: ");
Serial.println(dacValue);
}
Serial.println("------------------------------");
dac.setVoltage(dacValue, false);
}
}
Node Flow Code:
[{"id":"928911f6.11a55","type":"mqtt in","z":"d3cdff25.7e38","name":"","topic":"IAM/griddata","qos":"2","datatype":"json","broker":"ef215ef2.1813a","x":110,"y":140,"wires":[["b06e5aeb.b0a2d8","9acdf284.f1a87","daaf024f.7c1fa","2b70e36f.68b52c"]]},{"id":"daaf024f.7c1fa","type":"function","z":"d3cdff25.7e38","name":"Set SunDAC","func":"var status_message = \"\";\n\nif (msg.topic == \"IAM/griddata\") {\n \n var devices = 3;\n var power = msg.payload.power;\n \n if (power < -50) {\n power = 0;\n } else {\n if (power < 0) {\n power = 0;\n }\n \n if (power < 400) {\n // Under 400 Watt add 15 Watt more power\n power = power + 15;\n } else if (power >= 400 && power < 600) {\n // Between 400 and 600 Watt add 30 Watt more power\n power = power + 30;\n } else if (power >= 600) {\n // Over 600 Watt add 40 watt\n power = power + 40;\n }\n }\n\n var data = {\"powersum\": power, \"devices\": devices };\n status_message = \"Topic: \" + msg.topic + \", Current Power: \" + msg.payload.power + \", Send power: \" + power + \", Inverter State: \" + inverteron + \", BatteryVoltage: \" + batterycoltage;\n \n node.status({fill: \"blue\", shape: \"ring\", text: status_message});\n \n // Return JSON String \n return { payload: JSON.stringify(data) };\n}\n\nreturn;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":510,"y":200,"wires":[["a60fa8f8.f99f"]]},{"id":"a60fa8f8.f99f","type":"mqtt out","z":"d3cdff25.7e38","name":"","topic":"SunDAC_A/set","qos":"","retain":"","broker":"ef215ef2.1813a","x":800,"y":260,"wires":[]},{"id":"2b70e36f.68b52c","type":"function","z":"d3cdff25.7e38","name":"","func":"msg.payload = msg.payload.power;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":180,"y":320,"wires":[["2f8865c4.babf1a"]]},{"id":"2f8865c4.babf1a","type":"ui_gauge","z":"d3cdff25.7e38","name":"","group":"16d65d67.62f1a3","order":7,"width":0,"height":0,"gtype":"gage","title":"iammeter","label":"Watt","format":"{{value | number:0}}","min":0,"max":"8000","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":330,"y":300,"wires":[]},{"id":"ef215ef2.1813a","type":"mqtt-broker","name":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"16d65d67.62f1a3","type":"ui_group","name":"Solar","tab":"fab7bc12.641bd8","order":11,"disp":false,"width":"3","collapse":false},{"id":"fab7bc12.641bd8","type":"ui_tab","name":"Heizung mk","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
The project is currently still under construction, but the main meter showed that it was working at night. Hardly any electricity is drawn from the power grid, only a few watts are sent out.
The second WEM3080T is currently missing, but it is already planned. Maybe I'll win a WEM3080T here for my solar log side.
As it is still under construction, the data in the IAMMETER Cloud is not yet correct.
But here is my link: https://www.iammeter.com/home/share/30820e6ea653432c8ca237b265a8805f Password: jFFED6JDR98M7D
I have drawn attention to the project and the IAMMETER WEM3080T in the following link. You have been dealing with this topic for a long time in the forum but have never built it up with the DAC.
Hi Torakas:
Thanks for your sharing.
No matter post in our forum or other places, strongly recommends creating a new post for such valuable content.
It will more easy for other people to find your content in this way.
You just need to paste the content link in this post.
About your content, we will discuss it internally and would reply to you before next Tuesday.
Thanks again.
BR
IAMMETER Team
I hereby present my project with the
IAMMETER WEM3080T.
As a starting system, I have a
three-phase connection with a digital accumulating electricity meter. This
means that if 1000 watts are drawn from the electricity supplier on L1 and 1000
watts or more is fed in together on L2 and L3, then the meter stops.
As a solar system I have 6KWp. The solar MPTT charge controller (EPEver
Tracer 8420AN) stores the electricity in 16S LiFePo4 310Ah batteries (&
Thank you for your reply. I will then wait for your next answer.
Hi Torakas:
Thanks for your sharing.
We have scored your post according to the following scoring standard (https://www.iammeter.com/newsshow/activity-210618)
The full score is one hundred points, which is divided according to the following standards.
- Effectiveness: whether the application itself can bring benefits to others (40 points).
- Reproducibility: whether the application can help others (30 points).
- Propaganda: whether the post itself play a role in promoting IAMMETER system and products (30 points).
According to this standard, your scores are rated as follows.
Full Scores | Your Scores | Description | |
---|---|---|---|
Effectiveness | 40 | 30 | |
Reproducibility | 30 | 30 | |
Propaganda | 30 | 10 | Although the author also posted posts in other forums, it did not arouse other people’s attention to IAMMETER |
Therefore, your total score is 70 points, which should be the second prize according to our rule.
The prize is a single phase WiFi energy Meter(WEM3080).
If you have no other comments, please contact us through the feedback system. https://www.iammeter.com/docs/feedback-and-notification
Thanks again for your participation!
IAMMETER Team
Please let me know if you have received the WEM3080.
Until now, there are still 5 pcs WEM3080T and 7 pcs WEM3080 left in this activity.
Award history record:
Name | award | Status | further information |
---|---|---|---|
Greg | 2rd prize | delivered | receive and reply here |
smbunn | 2rd prize | still not send out yet,because can not contact | |
Torakas | 2rd prize | delivered | not any feedback |
Looking forward to hearing more interesting usage.