From 8ee13a9d35853451b6bc895299eec4e9c51f2661 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Fri, 25 Jun 2021 18:18:01 +0200 Subject: [PATCH] Update plugins to new smartmeter interface --- fronius/froniusinverter.cpp | 2 +- fronius/integrationpluginfronius.json | 10 +-- .../integrationplugingenericthings.cpp | 28 ++++---- .../integrationplugingenericthings.json | 8 +-- keba/integrationpluginkeba.cpp | 2 +- keba/integrationpluginkeba.json | 4 +- shelly/integrationpluginshelly.cpp | 56 ++++++++-------- shelly/integrationpluginshelly.json | 64 +++++++++---------- simulation/integrationpluginsimulation.json | 8 +-- solarlog/integrationpluginsolarlog.cpp | 2 +- solarlog/integrationpluginsolarlog.json | 4 +- tplink/integrationplugintplink.json | 4 +- 12 files changed, 96 insertions(+), 96 deletions(-) diff --git a/fronius/froniusinverter.cpp b/fronius/froniusinverter.cpp index 3f43aed3..36fdd9d7 100644 --- a/fronius/froniusinverter.cpp +++ b/fronius/froniusinverter.cpp @@ -81,7 +81,7 @@ void FroniusInverter::updateThingInfo(const QByteArray &data) // Set the inverter device state if (dataMap.contains("PAC")) { if(dataMap.value("PAC").toMap().values().at(0) == "W") - pluginThing()->setStateValue(inverterCurrentPowerStateTypeId, dataMap.value("PAC").toMap().values().at(1).toInt()); + pluginThing()->setStateValue(inverterCurrentPowerStateTypeId, -dataMap.value("PAC").toMap().values().at(1).toDouble()); } if (dataMap.contains("DAY_ENERGY")) { diff --git a/fronius/integrationpluginfronius.json b/fronius/integrationpluginfronius.json index f3ca58b3..917ab66f 100644 --- a/fronius/integrationpluginfronius.json +++ b/fronius/integrationpluginfronius.json @@ -151,7 +151,7 @@ "name": "inverter", "displayName": "Fronius Solar Inverter", "createMethods": ["auto"], - "interfaces" : ["extendedsmartmeterproducer", "connectable"], + "interfaces" : ["smartmeterproducer", "connectable"], "paramTypes": [ { "id": "f2f8c2f5-dd6a-4786-b336-82fc84e5bb98", @@ -184,7 +184,7 @@ "id": "788accbc-b86e-471b-b37f-14c9c6411526", "name": "currentPower", "displayName": "Current power", - "displayNameEvent": "Current Power changed", + "displayNameEvent": "Current power changed", "type": "double", "unit": "Watt", "defaultValue": "0" @@ -223,7 +223,7 @@ "name": "meter", "displayName": "Fronius smart meter", "createMethods": ["auto"], - "interfaces": [ "extendedsmartmeterconsumer", "extendedsmartmeterproducer", "connectable" ], + "interfaces": [ "smartmeterconsumer", "smartmeterproducer", "connectable" ], "paramTypes": [ { "id": "cf3a7025-d368-475a-8f48-efc1344a8409", @@ -247,8 +247,8 @@ { "id": "e5056ea1-88a2-410b-9c5e-6322aca4cb17", "name": "currentPower", - "displayName": "Total current power", - "displayNameEvent": "Total current power changed", + "displayName": "Current power usage", + "displayNameEvent": "Current power usage changed", "type": "double", "unit": "Watt", "defaultValue": "0" diff --git a/genericthings/integrationplugingenericthings.cpp b/genericthings/integrationplugingenericthings.cpp index d467cd22..09ee5d24 100644 --- a/genericthings/integrationplugingenericthings.cpp +++ b/genericthings/integrationplugingenericthings.cpp @@ -181,24 +181,24 @@ void IntegrationPluginGenericThings::setupThing(ThingSetupInfo *info) } } }); - } else if (thing->thingClassId() == extendedSmartMeterConsumerThingClassId) { + } else if (thing->thingClassId() == smartMeterThingClassId) { QTimer* smartMeterTimer = new QTimer(this); - int timeframe = thing->setting(extendedSmartMeterConsumerSettingsImpulseTimeframeParamTypeId).toInt(); + int timeframe = thing->setting(smartMeterSettingsImpulseTimeframeParamTypeId).toInt(); smartMeterTimer->setInterval(timeframe * 1000); m_smartMeterTimer.insert(thing, smartMeterTimer); smartMeterTimer->start(); connect(thing, &Thing::settingChanged, smartMeterTimer, [smartMeterTimer] (const ParamTypeId ¶mTypeId, const QVariant &value) { - if (paramTypeId == extendedSmartMeterConsumerSettingsImpulseTimeframeParamTypeId) { + if (paramTypeId == smartMeterSettingsImpulseTimeframeParamTypeId) { smartMeterTimer->setInterval(value.toInt() * 1000); } }); connect(smartMeterTimer, &QTimer::timeout, thing, [this, smartMeterTimer, thing] { - double impulsePerKwh = thing->setting(extendedSmartMeterConsumerSettingsImpulsePerKwhParamTypeId).toDouble(); + double impulsePerKwh = thing->setting(smartMeterSettingsImpulsePerKwhParamTypeId).toDouble(); int interval = smartMeterTimer->interval()/1000; double power = (m_pulsesPerTimeframe.value(thing)/impulsePerKwh)/(interval/3600.00); // Power = Energy/Time; Energy = Impulses/ImpPerkWh - thing->setStateValue(extendedSmartMeterConsumerCurrentPowerStateTypeId, power*1000); + thing->setStateValue(smartMeterCurrentPowerStateTypeId, power*1000); m_pulsesPerTimeframe.insert(thing, 0); }); } else if (thing->thingClassId() == extendedStatefulGaragedoorThingClassId) { @@ -589,14 +589,14 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) } else { Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } - } else if (thing->thingClassId() == extendedSmartMeterConsumerThingClassId) { - if (action.actionTypeId() == extendedSmartMeterConsumerImpulseInputActionTypeId) { - bool value = info->action().param(extendedSmartMeterConsumerImpulseInputActionImpulseInputParamTypeId).value().toBool(); - thing->setStateValue(extendedSmartMeterConsumerImpulseInputStateTypeId, value); - int impulsePerKwh = info->thing()->setting(extendedSmartMeterConsumerSettingsImpulsePerKwhParamTypeId).toInt(); + } else if (thing->thingClassId() == smartMeterThingClassId) { + if (action.actionTypeId() == smartMeterImpulseInputActionTypeId) { + bool value = info->action().param(smartMeterImpulseInputActionImpulseInputParamTypeId).value().toBool(); + thing->setStateValue(smartMeterImpulseInputStateTypeId, value); + int impulsePerKwh = info->thing()->setting(smartMeterSettingsImpulsePerKwhParamTypeId).toInt(); if (value) { - double currentEnergy = thing->stateValue(extendedSmartMeterConsumerTotalEnergyConsumedStateTypeId).toDouble(); - thing->setStateValue(extendedSmartMeterConsumerTotalEnergyConsumedStateTypeId ,currentEnergy + (1.00/impulsePerKwh)); + double currentEnergy = thing->stateValue(smartMeterTotalEnergyConsumedStateTypeId).toDouble(); + thing->setStateValue(smartMeterTotalEnergyConsumedStateTypeId ,currentEnergy + (1.00/impulsePerKwh)); m_pulsesPerTimeframe[thing]++; } info->finish(Thing::ThingErrorNoError); @@ -767,9 +767,9 @@ void IntegrationPluginGenericThings::thingRemoved(Thing *thing) m_extendedBlindTargetPercentage.remove(thing); m_venetianBlindAngleTimer.take(thing)->deleteLater(); m_venetianBlindTargetAngle.remove(thing); - } else if (thing->thingClassId() == extendedSmartMeterConsumerThingClassId) { + } else if (thing->thingClassId() == smartMeterThingClassId) { m_pulsesPerTimeframe.remove(thing); - } else if (thing->thingClassId() == extendedSmartMeterConsumerThingClassId) { + } else if (thing->thingClassId() == smartMeterThingClassId) { m_smartMeterTimer.take(thing)->deleteLater(); m_pulsesPerTimeframe.remove(thing); } diff --git a/genericthings/integrationplugingenericthings.json b/genericthings/integrationplugingenericthings.json index 9fcd2f32..e3996fa7 100644 --- a/genericthings/integrationplugingenericthings.json +++ b/genericthings/integrationplugingenericthings.json @@ -1033,10 +1033,10 @@ }, { "id": "c3123967-f741-4fe1-a0d4-9a3e405d7e52", - "name": "extendedSmartMeterConsumer", + "name": "smartMeter", "displayName": "Impulse based energy meter", "createMethods": ["user"], - "interfaces": ["extendedsmartmeterconsumer"], + "interfaces": ["smartmeterconsumer"], "settingsTypes": [ { "id": "c361732b-68eb-447e-a434-e84031231871", @@ -1062,8 +1062,8 @@ { "id": "5983d714-5f80-42d8-bee2-9228b6382b3b", "name": "currentPower", - "displayName": "Power", - "displayNameEvent": "Power changed", + "displayName": "Current Power usage", + "displayNameEvent": "Current Power usage changed", "type": "double", "defaultValue": 0.00, "unit": "Watt" diff --git a/keba/integrationpluginkeba.cpp b/keba/integrationpluginkeba.cpp index 09efb12c..7c00af30 100644 --- a/keba/integrationpluginkeba.cpp +++ b/keba/integrationpluginkeba.cpp @@ -395,7 +395,7 @@ void IntegrationPluginKeba::onReportThreeReceived(const KeContact::ReportThree & thing->setStateValue(wallboxVoltagePhase1EventTypeId, reportThree.voltagePhase1); thing->setStateValue(wallboxVoltagePhase2EventTypeId, reportThree.voltagePhase2); thing->setStateValue(wallboxVoltagePhase3EventTypeId, reportThree.voltagePhase3); - thing->setStateValue(wallboxPowerConsumptionStateTypeId, reportThree.power); + thing->setStateValue(wallboxCurrentPowerStateTypeId, reportThree.power); thing->setStateValue(wallboxSessionEnergyStateTypeId, reportThree.energySession); thing->setStateValue(wallboxPowerFactorStateTypeId, reportThree.powerFactor); thing->setStateValue(wallboxTotalEnergyConsumedStateTypeId, reportThree.energyTotal); diff --git a/keba/integrationpluginkeba.json b/keba/integrationpluginkeba.json index c0e193e4..822c1f3e 100644 --- a/keba/integrationpluginkeba.json +++ b/keba/integrationpluginkeba.json @@ -216,11 +216,11 @@ }, { "id": "7af9e93b-099d-4d9d-a480-9c0f66aecd8b", - "name": "powerConsumption", + "name": "currentPower", "displayName": "Power consumption", "displayNameEvent": "Power consumtion changed", "type": "double", - "unit": "KiloWatt", + "unit": "Watt", "defaultValue": 0.00 }, { diff --git a/shelly/integrationpluginshelly.cpp b/shelly/integrationpluginshelly.cpp index 1a7fea8e..6700db37 100644 --- a/shelly/integrationpluginshelly.cpp +++ b/shelly/integrationpluginshelly.cpp @@ -927,7 +927,7 @@ void IntegrationPluginShelly::onPublishReceived(MqttChannel *channel, const QStr } if (topic == "shellies/" + shellyId + "/light/0/power") { - // qCDebug(dcShelly()) << "Payload:" << payload; +// qCDebug(dcShelly()) << "Payload:" << payload; if (currentPowerStateTypeMap.contains(thing->thingClassId())) { double power = payload.toDouble(); thing->setStateValue(currentPowerStateTypeMap.value(thing->thingClassId()), power); @@ -1015,26 +1015,26 @@ void IntegrationPluginShelly::onPublishReceived(MqttChannel *channel, const QStr QVariant value = payload; QHash> channelMap; QHash stateTypeIdMap; - stateTypeIdMap["power"] = shellyEm3PhaseAPowerStateTypeId; - stateTypeIdMap["pf"] = shellyEm3PhaseAPowerFactorStateTypeId; - stateTypeIdMap["current"] = shellyEm3PhaseACurrentStateTypeId; - stateTypeIdMap["voltage"] = shellyEm3PhaseAVoltageStateTypeId; - stateTypeIdMap["total"] = shellyEm3PhaseATotalEnergyConsumedStateTypeId; - stateTypeIdMap["total_returned"] = shellyEm3PhaseATotalEnergyReturnedStateTypeId; + stateTypeIdMap["power"] = shellyEm3CurrentPowerPhaseAStateTypeId; + stateTypeIdMap["pf"] = shellyEm3PowerFactorPhaseAStateTypeId; + stateTypeIdMap["current"] = shellyEm3CurrentPhaseAStateTypeId; + stateTypeIdMap["voltage"] = shellyEm3VoltagePhaseAStateTypeId; + stateTypeIdMap["total"] = shellyEm3EnergyConsumedPhaseAStateTypeId; + stateTypeIdMap["total_returned"] = shellyEm3EnergyProducedPhaseAStateTypeId; channelMap[0] = stateTypeIdMap; - stateTypeIdMap["power"] = shellyEm3PhaseBPowerStateTypeId; - stateTypeIdMap["pf"] = shellyEm3PhaseBPowerFactorStateTypeId; - stateTypeIdMap["current"] = shellyEm3PhaseBCurrentStateTypeId; - stateTypeIdMap["voltage"] = shellyEm3PhaseBVoltageStateTypeId; - stateTypeIdMap["total"] = shellyEm3PhaseBTotalEnergyConsumedStateTypeId; - stateTypeIdMap["total_returned"] = shellyEm3PhaseBTotalEnergyReturnedStateTypeId; + stateTypeIdMap["power"] = shellyEm3CurrentPowerPhaseBStateTypeId; + stateTypeIdMap["pf"] = shellyEm3PowerFactorPhaseBStateTypeId; + stateTypeIdMap["current"] = shellyEm3CurrentPhaseBStateTypeId; + stateTypeIdMap["voltage"] = shellyEm3VoltagePhaseBStateTypeId; + stateTypeIdMap["total"] = shellyEm3EnergyConsumedPhaseBStateTypeId; + stateTypeIdMap["total_returned"] = shellyEm3EnergyProducedPhaseBStateTypeId; channelMap[1] = stateTypeIdMap; - stateTypeIdMap["power"] = shellyEm3PhaseCPowerStateTypeId; - stateTypeIdMap["pf"] = shellyEm3PhaseCPowerFactorStateTypeId; - stateTypeIdMap["current"] = shellyEm3PhaseCCurrentStateTypeId; - stateTypeIdMap["voltage"] = shellyEm3PhaseCVoltageStateTypeId; - stateTypeIdMap["total"] = shellyEm3PhaseCTotalEnergyConsumedStateTypeId; - stateTypeIdMap["total_returned"] = shellyEm3PhaseCTotalEnergyReturnedStateTypeId; + stateTypeIdMap["power"] = shellyEm3CurrentPowerPhaseCStateTypeId; + stateTypeIdMap["pf"] = shellyEm3PowerFactorPhaseCStateTypeId; + stateTypeIdMap["current"] = shellyEm3CurrentPhaseCStateTypeId; + stateTypeIdMap["voltage"] = shellyEm3VoltagePhaseCStateTypeId; + stateTypeIdMap["total"] = shellyEm3EnergyConsumedPhaseCStateTypeId; + stateTypeIdMap["total_returned"] = shellyEm3EnergyProducedPhaseCStateTypeId; channelMap[2] = stateTypeIdMap; StateTypeId stateTypeId = channelMap.value(channel).value(stateName); if (stateTypeId.isNull()) { @@ -1052,17 +1052,17 @@ void IntegrationPluginShelly::onPublishReceived(MqttChannel *channel, const QStr // and calculate the total ourselves. In order to not produce intermediate totals for each incoming message // we'll only refresh the total when we get the last value for the last channel. if (channel == 2 && stateName == "total_returned") { - double grandTotal = thing->stateValue(shellyEm3PhaseATotalEnergyConsumedStateTypeId).toDouble(); - grandTotal += thing->stateValue(shellyEm3PhaseBTotalEnergyConsumedStateTypeId).toDouble(); - grandTotal += thing->stateValue(shellyEm3PhaseCTotalEnergyConsumedStateTypeId).toDouble(); + double grandTotal = thing->stateValue(shellyEm3EnergyConsumedPhaseAStateTypeId).toDouble(); + grandTotal += thing->stateValue(shellyEm3EnergyConsumedPhaseBStateTypeId).toDouble(); + grandTotal += thing->stateValue(shellyEm3EnergyConsumedPhaseCStateTypeId).toDouble(); thing->setStateValue(shellyEm3TotalEnergyConsumedStateTypeId, grandTotal); - double grandTotalReturned = thing->stateValue(shellyEm3PhaseATotalEnergyReturnedStateTypeId).toDouble(); - grandTotalReturned += thing->stateValue(shellyEm3PhaseBTotalEnergyReturnedStateTypeId).toDouble(); - grandTotalReturned += thing->stateValue(shellyEm3PhaseCTotalEnergyReturnedStateTypeId).toDouble(); + double grandTotalReturned = thing->stateValue(shellyEm3EnergyProducedPhaseAStateTypeId).toDouble(); + grandTotalReturned += thing->stateValue(shellyEm3EnergyProducedPhaseBStateTypeId).toDouble(); + grandTotalReturned += thing->stateValue(shellyEm3EnergyProducedPhaseCStateTypeId).toDouble(); thing->setStateValue(shellyEm3TotalEnergyProducedStateTypeId, grandTotalReturned); - double totalPower = thing->stateValue(shellyEm3PhaseAPowerStateTypeId).toDouble(); - totalPower += thing->stateValue(shellyEm3PhaseBPowerStateTypeId).toDouble(); - totalPower += thing->stateValue(shellyEm3PhaseCPowerStateTypeId).toDouble(); + double totalPower = thing->stateValue(shellyEm3CurrentPowerPhaseAStateTypeId).toDouble(); + totalPower += thing->stateValue(shellyEm3CurrentPowerPhaseBStateTypeId).toDouble(); + totalPower += thing->stateValue(shellyEm3CurrentPowerPhaseCStateTypeId).toDouble(); thing->setStateValue(shellyEm3CurrentPowerStateTypeId, totalPower); } } diff --git a/shelly/integrationpluginshelly.json b/shelly/integrationpluginshelly.json index 30191874..a9366396 100644 --- a/shelly/integrationpluginshelly.json +++ b/shelly/integrationpluginshelly.json @@ -111,7 +111,7 @@ "name": "shelly1pm", "displayName": "Shelly 1PM", "createMethods": ["discovery"], - "interfaces": [ "gateway", "extendedsmartmeterconsumer", "wirelessconnectable", "update" ], + "interfaces": [ "gateway", "smartmeterconsumer", "wirelessconnectable", "update" ], "paramTypes": [ { "id": "6df5db8a-4e27-49e5-8cf9-78cb8497d831", @@ -228,7 +228,7 @@ "name": "shelly1l", "displayName": "Shelly 1L", "createMethods": ["discovery"], - "interfaces": [ "gateway", "extendedsmartmeterconsumer", "wirelessconnectable", "update" ], + "interfaces": [ "gateway", "smartmeterconsumer", "wirelessconnectable", "update" ], "paramTypes": [ { "id": "afd5f2c5-dbe4-4d60-80a6-97b77264ad7c", @@ -551,7 +551,7 @@ "name": "shellyPlug", "displayName": "Shelly Plug/PlugS", "createMethods": ["discovery"], - "interfaces": [ "powersocket", "extendedsmartmeterconsumer", "wirelessconnectable", "update" ], + "interfaces": [ "powersocket", "smartmeterconsumer", "wirelessconnectable", "update" ], "paramTypes": [ { "id": "bd5679fc-b761-4a56-a472-97717418c425", @@ -1457,7 +1457,7 @@ "name": "shellyEm3", "displayName": "Shelly 3EM", "createMethods": ["discovery"], - "interfaces": [ "extendedsmartmeterconsumer", "extendedsmartmeterproducer", "wirelessconnectable", "update"], + "interfaces": [ "energymeter", "wirelessconnectable", "update"], "paramTypes": [ { "id": "a80894d2-dfba-4699-892d-081702b0f1f5", @@ -1530,9 +1530,9 @@ }, { "id": "432ba180-936d-4700-907e-766264bfdd35", - "name": "phaseAPower", - "displayName": "Power (Phase A)", - "displayNameEvent": "Power (Phase A) changed", + "name": "currentPowerPhaseA", + "displayName": "Power usage (Phase A)", + "displayNameEvent": "Power usage (Phase A) changed", "type": "double", "unit": "Watt", "defaultValue": 0, @@ -1540,7 +1540,7 @@ }, { "id": "50be490b-ba5d-4b1f-806c-9e15b915c1eb", - "name": "phaseAPowerFactor", + "name": "powerFactorPhaseA", "displayName": "Power factor (Phase A)", "displayNameEvent": "Power factor (Phase A) changed", "type": "double", @@ -1548,7 +1548,7 @@ }, { "id": "5fa79319-756b-4b2c-87b1-59ff996b8435", - "name": "phaseACurrent", + "name": "currentPhaseA", "displayName": "Current (Phase A)", "displayNameEvent": "Current (Phase A) changed", "type": "double", @@ -1558,7 +1558,7 @@ }, { "id": "5977ffab-cdcf-409c-940b-aa0a59de84a5", - "name": "phaseAVoltage", + "name": "voltagePhaseA", "displayName": "Voltage (Phase A)", "displayNameEvent": "Voltage (Phase A) changed", "type": "double", @@ -1567,7 +1567,7 @@ }, { "id": "ba25ef68-bb52-4e96-a8fb-137aae966104", - "name": "phaseATotalEnergyConsumed", + "name": "energyConsumedPhaseA", "displayName": "Total consumed energy (Phase A)", "displayNameEvent": "Total consumed energy (Phase A) changed", "type": "double", @@ -1576,7 +1576,7 @@ }, { "id": "34562cd3-b178-4f68-903d-a01e20d0ad76", - "name": "phaseATotalEnergyReturned", + "name": "energyProducedPhaseA", "displayName": "Total returned energy (Phase A)", "displayNameEvent": "Total returned energy (Phase A) changed", "type": "double", @@ -1585,9 +1585,9 @@ }, { "id": "02edeedb-8a93-41f8-8bc5-09031b7d2d4d", - "name": "phaseBPower", - "displayName": "Power (Phase B)", - "displayNameEvent": "Power (Phase B) changed", + "name": "currentPowerPhaseB", + "displayName": "Power usage (Phase B)", + "displayNameEvent": "Power usage (Phase B) changed", "type": "double", "unit": "Watt", "defaultValue": 0, @@ -1595,7 +1595,7 @@ }, { "id": "f56504bb-0c6c-4425-831c-771b23aadf19", - "name": "phaseBPowerFactor", + "name": "powerFactorPhaseB", "displayName": "Power factor (Phase B)", "displayNameEvent": "Power factor (Phase B) changed", "type": "double", @@ -1603,7 +1603,7 @@ }, { "id": "a4151601-fe77-418a-a2c1-6376e32da3bd", - "name": "phaseBCurrent", + "name": "currentPhaseB", "displayName": "Current (Phase B)", "displayNameEvent": "Current (Phase B) changed", "type": "double", @@ -1612,7 +1612,7 @@ }, { "id": "7c846993-fb06-48ef-987c-7b35d9671070", - "name": "phaseBVoltage", + "name": "voltagePhaseB", "displayName": "Voltage (Phase B)", "displayNameEvent": "Voltage (Phase B) changed", "type": "double", @@ -1621,7 +1621,7 @@ }, { "id": "6636e6a0-e3ca-4654-9506-4302c4e8eed7", - "name": "phaseBTotalEnergyConsumed", + "name": "energyConsumedPhaseB", "displayName": "Total consumed energy (Phase B)", "displayNameEvent": "Total consumed energy (Phase B) changed", "type": "double", @@ -1630,7 +1630,7 @@ }, { "id": "d70a0d1a-cac1-4250-85fa-4859ad2dc947", - "name": "phaseBTotalEnergyReturned", + "name": "energyProducedPhaseB", "displayName": "Total returned energy (Phase B)", "displayNameEvent": "Total returned energy (Phase B) changed", "type": "double", @@ -1639,9 +1639,9 @@ }, { "id": "82277a4e-49cc-45f4-8b29-470ce99333b6", - "name": "phaseCPower", - "displayName": "Power (Phase C)", - "displayNameEvent": "Power (Phase C) changed", + "name": "currentPowerPhaseC", + "displayName": "Power usage (Phase C)", + "displayNameEvent": "Power usage (Phase C) changed", "type": "double", "unit": "Watt", "defaultValue": 0, @@ -1649,7 +1649,7 @@ }, { "id": "2e2c622f-1575-4d0b-a0c0-78bc03748c1e", - "name": "phaseCPowerFactor", + "name": "powerFactorPhaseC", "displayName": "Power factor (Phase C)", "displayNameEvent": "Power factor (Phase C) changed", "type": "double", @@ -1657,7 +1657,7 @@ }, { "id": "ab78aa9c-aa73-4f5d-8d21-38c83c5e9e7c", - "name": "phaseCCurrent", + "name": "currentPhaseC", "displayName": "Current (Phase C)", "displayNameEvent": "Current (Phase C) changed", "type": "double", @@ -1666,7 +1666,7 @@ }, { "id": "cd7af1b2-d5f0-4c2e-b85c-84f23ae1fbb9", - "name": "phaseCVoltage", + "name": "voltagePhaseC", "displayName": "Voltage (Phase C)", "displayNameEvent": "Voltage (Phase C) changed", "type": "double", @@ -1675,7 +1675,7 @@ }, { "id": "452c2159-aa2f-4217-80e5-4b492b69671e", - "name": "phaseCTotalEnergyConsumed", + "name": "energyConsumedPhaseC", "displayName": "Total consumed energy (Phase C)", "displayNameEvent": "Total consumed energy (Phase C) changed", "type": "double", @@ -1684,7 +1684,7 @@ }, { "id": "de248e26-b617-4d22-9175-752e2d695274", - "name": "phaseCTotalEnergyReturned", + "name": "energyProducedPhaseC", "displayName": "Total returned energy (Phase C)", "displayNameEvent": "Total returned energy (Phase C) changed", "type": "double", @@ -1930,7 +1930,7 @@ "name": "shellyGenericPM", "displayName": "Shelly connected device", "createMethods": ["auto"], - "interfaces": ["power", "extendedsmartmeterconsumer", "wirelessconnectable"], + "interfaces": ["power", "smartmeterconsumer", "wirelessconnectable"], "settingsTypes": [ { "id": "8c60a23c-5e5b-42ba-abae-aeeb3d379d79", @@ -2065,7 +2065,7 @@ "name": "shellyLightPM", "displayName": "Shelly connected light", "createMethods": ["auto"], - "interfaces": ["light", "extendedsmartmeterconsumer", "wirelessconnectable"], + "interfaces": ["light", "smartmeterconsumer", "wirelessconnectable"], "settingsTypes": [ { "id": "01cc242a-268d-4dd9-96ce-5502dd1bd430", @@ -2200,7 +2200,7 @@ "name": "shellySocketPM", "displayName": "Shelly connected power socket", "createMethods": ["auto"], - "interfaces": ["powersocket", "extendedsmartmeterconsumer", "wirelessconnectable"], + "interfaces": ["powersocket", "smartmeterconsumer", "wirelessconnectable"], "settingsTypes": [ { "id": "9880a51b-57da-4b65-a0ec-23eb0fdcb8ac", @@ -2277,7 +2277,7 @@ "name": "shellyRoller", "displayName": "Shelly connected Roller Shutter", "createMethods": ["auto"], - "interfaces": ["extendedshutter", "extendedsmartmeterconsumer", "wirelessconnectable"], + "interfaces": ["extendedshutter", "smartmeterconsumer", "wirelessconnectable"], "paramTypes": [ { "id": "281385a5-5084-4ded-80a4-66c0dc1096a8", diff --git a/simulation/integrationpluginsimulation.json b/simulation/integrationpluginsimulation.json index 62d7133c..a456378b 100644 --- a/simulation/integrationpluginsimulation.json +++ b/simulation/integrationpluginsimulation.json @@ -787,7 +787,7 @@ "name": "smartMeter", "displayName": "Smart Meter", "createMethods": ["user"], - "interfaces": ["extendedsmartmeterconsumer", "extendedsmartmeterproducer", "connectable" ], + "interfaces": ["smartmeterconsumer", "smartmeterproducer", "connectable" ], "paramTypes": [ ], "stateTypes": [ { @@ -801,8 +801,8 @@ { "id": "d57f4d9c-759e-40eb-999e-a1acbc8df2b1", "name": "currentPower", - "displayName": "Current power flow", - "displayNameEvent": "Power power flow changed", + "displayName": "Current power usage", + "displayNameEvent": "Power power usage changed", "type": "double", "unit": "Watt", "defaultValue": 0 @@ -832,7 +832,7 @@ "name": "solarPanel", "displayName": "Solar panel", "createMethods": ["user"], - "interfaces": ["extendedsmartmeterproducer"], + "interfaces": ["smartmeterproducer"], "paramTypes": [], "stateTypes": [ { diff --git a/solarlog/integrationpluginsolarlog.cpp b/solarlog/integrationpluginsolarlog.cpp index 4c4da6f3..8b700cc2 100644 --- a/solarlog/integrationpluginsolarlog.cpp +++ b/solarlog/integrationpluginsolarlog.cpp @@ -134,7 +134,7 @@ void IntegrationPluginSolarLog::getData(Thing *thing) thing->setStateValue(solarlogYieldMonthStateTypeId, (map.value(QString::number(JsonObjectNumbers::YieldMonth)).toDouble()/1000.00)); thing->setStateValue(solarlogYieldYearStateTypeId, (map.value(QString::number(JsonObjectNumbers::YieldYear)).toDouble()/1000.00)); thing->setStateValue(solarlogTotalEnergyProducedStateTypeId, (map.value(QString::number(JsonObjectNumbers::YieldTotal)).toDouble()/1000.00)); - thing->setStateValue(solarlogCurrentTotalConsumptionStateTypeId, map.value(QString::number(JsonObjectNumbers::ConsPac))); + thing->setStateValue(solarlogPowerUsageStateTypeId, map.value(QString::number(JsonObjectNumbers::ConsPac))); thing->setStateValue(solarlogConsYieldDayStateTypeId, map.value(QString::number(JsonObjectNumbers::ConsYieldDay))); thing->setStateValue(solarlogConsYieldYesterdayStateTypeId, map.value(QString::number(JsonObjectNumbers::ConsYieldYesterday))); thing->setStateValue(solarlogConsYieldMonthStateTypeId, map.value(QString::number(JsonObjectNumbers::ConsYieldMonth))); diff --git a/solarlog/integrationpluginsolarlog.json b/solarlog/integrationpluginsolarlog.json index 75b01af3..7c7cbc23 100644 --- a/solarlog/integrationpluginsolarlog.json +++ b/solarlog/integrationpluginsolarlog.json @@ -13,7 +13,7 @@ "name": "solarlog", "displayName": "Solar-Log", "createMethods": [ "user", "discovery" ], - "interfaces": ["extendedsmartmeterproducer", "connectable" ], + "interfaces": ["smartmeterproducer", "connectable" ], "paramTypes": [ { "id": "84bd8a41-2411-4bb0-87a9-ab7e01044b10", @@ -125,7 +125,7 @@ }, { "id": "5b665247-278a-4b59-9046-add40763e937", - "name": "currentTotalConsumption", + "name": "powerUsage", "displayName": "Current total power consumption", "displayNameEvent": "Current total power consumption changed", "type": "double", diff --git a/tplink/integrationplugintplink.json b/tplink/integrationplugintplink.json index d0625fef..7ad049d8 100644 --- a/tplink/integrationplugintplink.json +++ b/tplink/integrationplugintplink.json @@ -62,7 +62,7 @@ "name": "kasaPlug110", "displayName": "Kasa Smart Wi-Fi Plug With Energy Monitoring (HS110)", "createMethods": ["discovery"], - "interfaces": [ "powersocket", "extendedsmartmeterconsumer", "wirelessconnectable" ], + "interfaces": [ "powersocket", "smartmeter", "wirelessconnectable" ], "paramTypes": [ { "id": "de3238f7-fe94-440d-b212-61cd4e221b50", @@ -178,7 +178,7 @@ "name": "kasaPowerStrip300", "displayName": "Kasa Smart Wi-Fi Power Strip (HS300)", "createMethods": ["discovery"], - "interfaces": [ "gateway", "extendedsmartmeterconsumer", "wirelessconnectable" ], + "interfaces": [ "gateway", "smartmeter", "wirelessconnectable" ], "paramTypes": [ { "id": "62b38ddf-f6d7-44e1-955f-f04b375d960d",