From 3629371f96dc9080aaa1b6a63e0e29a8f80427b1 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Mon, 29 Oct 2018 10:34:35 +0100 Subject: [PATCH] add smart meter interfaces --- libnymea/interfaces/extendedsmartmeterconsumer.json | 10 ++++++++++ libnymea/interfaces/extendedsmartmeterproducer.json | 10 ++++++++++ libnymea/interfaces/interfaces.qrc | 4 ++++ libnymea/interfaces/smartmeter.json | 8 +------- libnymea/interfaces/smartmeterconsumer.json | 10 ++++++++++ libnymea/interfaces/smartmeterproducer.json | 10 ++++++++++ 6 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 libnymea/interfaces/extendedsmartmeterconsumer.json create mode 100644 libnymea/interfaces/extendedsmartmeterproducer.json create mode 100644 libnymea/interfaces/smartmeterconsumer.json create mode 100644 libnymea/interfaces/smartmeterproducer.json diff --git a/libnymea/interfaces/extendedsmartmeterconsumer.json b/libnymea/interfaces/extendedsmartmeterconsumer.json new file mode 100644 index 00000000..bca5393a --- /dev/null +++ b/libnymea/interfaces/extendedsmartmeterconsumer.json @@ -0,0 +1,10 @@ +{ + "description": "Like smartmeterconsumer, but instead of only providing total consumed energy, this also supports retrieving the current power demand rate. Note that currentPower is negative for consumers but might also be positive if a device implements consumer and producer and currently produces more than it consumes.", + "extends": "smartmeterconsumer", + "states": [ + { + "name": "currentPower", + "type": "double" + } + ] +} diff --git a/libnymea/interfaces/extendedsmartmeterproducer.json b/libnymea/interfaces/extendedsmartmeterproducer.json new file mode 100644 index 00000000..0c8ad6c7 --- /dev/null +++ b/libnymea/interfaces/extendedsmartmeterproducer.json @@ -0,0 +1,10 @@ +{ + "description": "Like smartmeterproducer, but instead of only providing total produced energy, this also supports retrieving the current power supply rate. Note that currentPower is positive for producers but might also be negative if a device implements consumer and producer and currently consumes more than it produces.", + "extends": "smartmeterproducer", + "states": [ + { + "name": "currentPower", + "type": "double" + } + ] +} diff --git a/libnymea/interfaces/interfaces.qrc b/libnymea/interfaces/interfaces.qrc index 0cc2c1f8..af1628f1 100644 --- a/libnymea/interfaces/interfaces.qrc +++ b/libnymea/interfaces/interfaces.qrc @@ -42,7 +42,11 @@ extendedshutter.json smartlock.json system.json + smartmeterconsumer.json + smartmeterproducer.json smartmeter.json + extendedsmartmeterconsumer.json + extendedsmartmeterproducer.json diff --git a/libnymea/interfaces/smartmeter.json b/libnymea/interfaces/smartmeter.json index 043ccceb..faaddd23 100644 --- a/libnymea/interfaces/smartmeter.json +++ b/libnymea/interfaces/smartmeter.json @@ -1,9 +1,3 @@ { - "states": [ - { - "name": "totalEnergy", - "type": "double" - } - - ] + "description": "This interface is used for things that can monitor energy consumption/production. This interface is the base for smartmeter things. Actual things will most likely want to use one of the extending interfaces like smartmeterconsumer and/or smartmeterproducer instead." } diff --git a/libnymea/interfaces/smartmeterconsumer.json b/libnymea/interfaces/smartmeterconsumer.json new file mode 100644 index 00000000..b44c85c9 --- /dev/null +++ b/libnymea/interfaces/smartmeterconsumer.json @@ -0,0 +1,10 @@ +{ + "description": "A smartmeterproducer can monitor total energy consumed by this thing.", + "extends": "smartmeter", + "states": [ + { + "name": "totalEnergyConsumed", + "type": "double" + } + ] +} diff --git a/libnymea/interfaces/smartmeterproducer.json b/libnymea/interfaces/smartmeterproducer.json new file mode 100644 index 00000000..9569c4e3 --- /dev/null +++ b/libnymea/interfaces/smartmeterproducer.json @@ -0,0 +1,10 @@ +{ + "description": "A smartmeterproducer can monitor total energy produced by this thing.", + "extends": "smartmeter", + "states": [ + { + "name": "totalEnergyProduced", + "type": "double" + } + ] +}