mirror of https://github.com/arendst/Tasmota.git
Merge pull request #6017 from ascillato/patch-1
Fix SDM120 and SDM630 Energy Values to Domoticz
This commit is contained in:
commit
006f4da90d
|
@ -347,9 +347,11 @@ void SDM120Show(bool json)
|
||||||
#endif // USE_SDM220
|
#endif // USE_SDM220
|
||||||
#ifdef USE_DOMOTICZ
|
#ifdef USE_DOMOTICZ
|
||||||
if (0 == tele_period) {
|
if (0 == tele_period) {
|
||||||
|
char energy_total_chr[33];
|
||||||
|
dtostrfd(sdm120_energy_total * 1000, 1, energy_total_chr);
|
||||||
DomoticzSensor(DZ_VOLTAGE, voltage);
|
DomoticzSensor(DZ_VOLTAGE, voltage);
|
||||||
DomoticzSensor(DZ_CURRENT, current);
|
DomoticzSensor(DZ_CURRENT, current);
|
||||||
DomoticzSensorPowerEnergy((int)sdm120_active_power, energy_total);
|
DomoticzSensorPowerEnergy((int)sdm120_active_power, energy_total_chr);
|
||||||
}
|
}
|
||||||
#endif // USE_DOMOTICZ
|
#endif // USE_DOMOTICZ
|
||||||
#ifdef USE_WEBSERVER
|
#ifdef USE_WEBSERVER
|
||||||
|
|
|
@ -301,6 +301,16 @@ void SDM630Show(bool json)
|
||||||
char energy_total[33];
|
char energy_total[33];
|
||||||
dtostrfd(sdm630_energy_total, Settings.flag2.energy_resolution, energy_total);
|
dtostrfd(sdm630_energy_total, Settings.flag2.energy_resolution, energy_total);
|
||||||
|
|
||||||
|
#ifdef USE_DOMOTICZ
|
||||||
|
if (0 == tele_period) {
|
||||||
|
char energy_total_chr[33];
|
||||||
|
dtostrfd(sdm630_energy_total * 1000, 1, energy_total_chr);
|
||||||
|
DomoticzSensor(DZ_VOLTAGE, voltage);
|
||||||
|
DomoticzSensor(DZ_CURRENT, current);
|
||||||
|
DomoticzSensorPowerEnergy((int)sdm630_active_power, energy_total_chr);
|
||||||
|
}
|
||||||
|
#endif // USE_DOMOTICZ
|
||||||
|
|
||||||
if (json) {
|
if (json) {
|
||||||
ResponseAppend_P(PSTR(",\"" D_RSLT_ENERGY "\":{\"" D_JSON_TOTAL "\":%s,\""
|
ResponseAppend_P(PSTR(",\"" D_RSLT_ENERGY "\":{\"" D_JSON_TOTAL "\":%s,\""
|
||||||
D_JSON_ACTIVE_POWERUSAGE "\":[%s,%s,%s],\"" D_JSON_REACTIVE_POWERUSAGE "\":[%s,%s,%s],\""
|
D_JSON_ACTIVE_POWERUSAGE "\":[%s,%s,%s],\"" D_JSON_REACTIVE_POWERUSAGE "\":[%s,%s,%s],\""
|
||||||
|
|
Loading…
Reference in New Issue