Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change output 1.8.0 / 2.8.0 from Wh to kWh #59

Open
AndyWo83 opened this issue Mar 9, 2023 · 3 comments
Open

Change output 1.8.0 / 2.8.0 from Wh to kWh #59

AndyWo83 opened this issue Mar 9, 2023 · 3 comments

Comments

@AndyWo83
Copy link

AndyWo83 commented Mar 9, 2023

Is it possible to include the output from Wh to kWh in the config, since most people work with kwh anyway?

static const SensorConfig SENSOR_CONFIGS[] = {
    {.pin = D2, // GPIO pin of the phototransistor
     .name = "1", // Sensor name used in MQTT topic
     .numeric_only = false, // If "true", only numeric values are being published via MQTT
     .output_kwh = true,// If "true", output value in kWh   <--- !!!!!!!NEW!!!!!!!!
     .status_led_enabled = true, // Flash status LED (3 times) when an SML start sequence has been found
     .status_led_inverted = true, // Some LEDs (like the ESP8266 builtin LED) require an inverted output signal
     .status_led_pin = LED_BUILTIN, // GPIO pin used for sensor status LED
     .interval = 0 // If greater than 0, messages are published every [interval] seconds
    }};

That's why I'm currently using Tasmota and there smartmeter integration, but I would like to switch to this, since Tasmota only sends the data via MQTT every 10 seconds.

image

@AndyWo83 AndyWo83 changed the title Decimal point is wrong in 1.8.0 Change output 1.8.0 / 2.8.0 from Wh to kWh Mar 9, 2023
@emmrichd
Copy link

Hello,

Tasmota can send the data more often. you have to add 16 to the precision definition in the M-statement:
<precision> | number of decimal places. Add 16 to transmit the data immediately. Otherwise it is transmitted on TelePeriod only.
Regards, Dieter

@btmerz
Copy link

btmerz commented Aug 21, 2023

Hi,
to get this, I added the lines
if (scaler<0) {
scaler -=3; //convert values from Wh to kWhum
prec=3;
}

at line 103 of MqttPublisher.h to convert the values from Wh to kWh.

Maybe that helps someone...

Regards Bernd

@Kubunter
Copy link

@mruettgers Would be nice to see this change in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants