From 8a1012405107866bdc5ba04d710d1f55d04a7b49 Mon Sep 17 00:00:00 2001 From: "bernhard.trinnes" Date: Thu, 2 Jul 2020 17:02:33 +0200 Subject: [PATCH 1/9] added extended- and venetian blind --- genericthings/genericthings.pro | 2 - .../integrationplugingenericthings.cpp | 162 ++++++++++------ .../integrationplugingenericthings.json | 175 ++++++++++++++++++ 3 files changed, 281 insertions(+), 58 deletions(-) diff --git a/genericthings/genericthings.pro b/genericthings/genericthings.pro index 126bf47..91b2c27 100644 --- a/genericthings/genericthings.pro +++ b/genericthings/genericthings.pro @@ -1,7 +1,5 @@ include(../plugins.pri) -TARGET = $$qtLibraryTarget(nymea_integrationplugingenericthings) - SOURCES += \ integrationplugingenericthings.cpp diff --git a/genericthings/integrationplugingenericthings.cpp b/genericthings/integrationplugingenericthings.cpp index 53b9478..6a177f4 100644 --- a/genericthings/integrationplugingenericthings.cpp +++ b/genericthings/integrationplugingenericthings.cpp @@ -1,4 +1,4 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright 2013 - 2020, nymea GmbH * Contact: contact@nymea.io @@ -28,28 +28,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/*! - \page genericinterfaces.html - \title Generic interfaces - \brief Common interfaces to test the rule engine. - - \ingroup plugins - \ingroup nymea-tests - - The generic interfaces plugin allows you create virtual buttons, which can be connected with a rule. This gives you - the possibility to execute multiple \l{Action}{Actions} with one signal. Without a rule this generic interfaces are - useless. - - \chapter Plugin properties - Following JSON file contains the definition and the description of all available \l{ThingClass}{DeviceClasses} - and \l{Vendor}{Vendors} of this \l{DevicePlugin}. - - For more details how to read this JSON file please check out the documentation for \l{The plugin JSON File}. - - \quotefile plugins/deviceplugins/genericinterfaces/deviceplugingenericinterfaces.json -*/ - - #include "integrationplugingenericthings.h" #include "plugininfo.h" @@ -113,9 +91,8 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) info->finish(Thing::ThingErrorNoError); } return info->finish(Thing::ThingErrorActionTypeNotFound); - } - if (thing->thingClassId() == blindThingClassId ) { + } else if (thing->thingClassId() == blindThingClassId ) { if (action.actionTypeId() == blindOpenActionTypeId) { thing->setStateValue(blindStatusStateTypeId, "Opening"); thing->setStateValue(blindClosingOutputStateTypeId, false); @@ -157,9 +134,100 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) info->finish(Thing::ThingErrorNoError); } return info->finish(Thing::ThingErrorActionTypeNotFound); - } - if (thing->thingClassId() == shutterThingClassId) { + } else if (thing->thingClassId() == extendedBlindThingClassId) { + if (action.actionTypeId() == extendedBlindOpenActionTypeId) { + thing->setStateValue(extendedBlindStatusStateTypeId, "Opening"); + thing->setStateValue(extendedBlindClosingOutputStateTypeId, false); + thing->setStateValue(extendedBlindOpeningOutputStateTypeId, true); + //TODO set moving state + return info->finish(Thing::ThingErrorNoError); + } else if (action.actionTypeId() == extendedBlindStopActionTypeId) { + thing->setStateValue(extendedBlindStatusStateTypeId, "Stopped"); + thing->setStateValue(extendedBlindOpeningOutputStateTypeId, false); + thing->setStateValue(extendedBlindClosingOutputStateTypeId, false); + return info->finish(Thing::ThingErrorNoError); + } else if (action.actionTypeId() == extendedBlindCloseActionTypeId) { + thing->setStateValue(extendedBlindStatusStateTypeId, "Closing"); + thing->setStateValue(extendedBlindOpeningOutputStateTypeId, false); + thing->setStateValue(extendedBlindClosingOutputStateTypeId, true); + return info->finish(Thing::ThingErrorNoError); + } else if (action.actionTypeId() == extendedBlindOpeningOutputActionTypeId) { + bool on = action.param(extendedBlindOpeningOutputActionOpeningOutputParamTypeId).value().toBool(); + thing->setStateValue(extendedBlindOpeningOutputStateTypeId, on); + if (on) { + thing->setStateValue(extendedBlindStatusStateTypeId, "Opening"); + thing->setStateValue(extendedBlindClosingOutputStateTypeId, false); + } else { + thing->setStateValue(extendedBlindStatusStateTypeId, "Stopped"); + } + info->finish(Thing::ThingErrorNoError); + } else if (action.actionTypeId() == extendedBlindClosingOutputActionTypeId) { + bool on = action.param(extendedBlindClosingOutputActionClosingOutputParamTypeId).value().toBool(); + thing->setStateValue(extendedBlindClosingOutputStateTypeId, on); + if (on) { + thing->setStateValue(extendedBlindStatusStateTypeId, "Closing"); + thing->setStateValue(extendedBlindOpeningOutputStateTypeId, false); + } else { + thing->setStateValue(extendedBlindStatusStateTypeId, "Stopped"); + } + info->finish(Thing::ThingErrorNoError); + } else if (action.actionTypeId() == extendedBlindPercentageActionTypeId) { + int percentage = action.param(extendedBlindPercentageActionPercentageParamTypeId).value().toBool(); + Q_UNUSED(percentage) + //TODO move to percentage + } else { + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); + } + } else if (thing->thingClassId() == venetianBlindThingClassId) { + if (action.actionTypeId() == venetianBlindOpenActionTypeId) { + thing->setStateValue(venetianBlindStatusStateTypeId, "Opening"); + thing->setStateValue(venetianBlindClosingOutputStateTypeId, false); + thing->setStateValue(venetianBlindOpeningOutputStateTypeId, true); + //TODO set moving state + return info->finish(Thing::ThingErrorNoError); + } else if (action.actionTypeId() == venetianBlindStopActionTypeId) { + thing->setStateValue(venetianBlindStatusStateTypeId, "Stopped"); + thing->setStateValue(venetianBlindOpeningOutputStateTypeId, false); + thing->setStateValue(venetianBlindClosingOutputStateTypeId, false); + return info->finish(Thing::ThingErrorNoError); + } else if (action.actionTypeId() == venetianBlindCloseActionTypeId) { + thing->setStateValue(venetianBlindStatusStateTypeId, "Closing"); + thing->setStateValue(venetianBlindOpeningOutputStateTypeId, false); + thing->setStateValue(venetianBlindClosingOutputStateTypeId, true); + return info->finish(Thing::ThingErrorNoError); + } else if (action.actionTypeId() == venetianBlindOpeningOutputActionTypeId) { + bool on = action.param(venetianBlindOpeningOutputActionOpeningOutputParamTypeId).value().toBool(); + thing->setStateValue(venetianBlindOpeningOutputStateTypeId, on); + if (on) { + thing->setStateValue(venetianBlindStatusStateTypeId, "Opening"); + thing->setStateValue(venetianBlindClosingOutputStateTypeId, false); + } else { + thing->setStateValue(venetianBlindStatusStateTypeId, "Stopped"); + } + info->finish(Thing::ThingErrorNoError); + } else if (action.actionTypeId() == venetianBlindClosingOutputActionTypeId) { + bool on = action.param(venetianBlindClosingOutputActionClosingOutputParamTypeId).value().toBool(); + thing->setStateValue(venetianBlindClosingOutputStateTypeId, on); + if (on) { + thing->setStateValue(venetianBlindStatusStateTypeId, "Closing"); + thing->setStateValue(venetianBlindOpeningOutputStateTypeId, false); + } else { + thing->setStateValue(venetianBlindStatusStateTypeId, "Stopped"); + } + info->finish(Thing::ThingErrorNoError); + } else if (action.actionTypeId() == venetianBlindPercentageActionTypeId) { + int percentage = action.param(venetianBlindPercentageActionPercentageParamTypeId).value().toInt(); + Q_UNUSED(percentage) + //TODO move to percentage + } else if (action.actionTypeId() == venetianBlindAngleActionTypeId) { + int angle = action.param(venetianBlindAngleActionAngleParamTypeId).value().toInt(); + Q_UNUSED(angle) + //TODO move to angle + } else { + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); + } + } else if (thing->thingClassId() == shutterThingClassId) { if (action.actionTypeId() == shutterOpenActionTypeId) { thing->setStateValue(shutterStatusStateTypeId, "Opening"); thing->setStateValue(shutterClosingOutputStateTypeId, false); @@ -201,57 +269,43 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) info->finish(Thing::ThingErrorNoError); } return info->finish(Thing::ThingErrorActionTypeNotFound); - } - - if (thing->thingClassId() == socketThingClassId) { + } else if (thing->thingClassId() == socketThingClassId) { if (action.actionTypeId() == socketPowerActionTypeId) { thing->setStateValue(socketPowerStateTypeId, action.param(socketPowerActionPowerParamTypeId).value()); return info->finish(Thing::ThingErrorNoError); } return info->finish(Thing::ThingErrorActionTypeNotFound); - } - - if (thing->thingClassId() == lightThingClassId) { + } else if (thing->thingClassId() == lightThingClassId) { if (action.actionTypeId() == lightPowerActionTypeId) { thing->setStateValue(lightPowerStateTypeId, action.param(lightPowerActionPowerParamTypeId).value()); return info->finish(Thing::ThingErrorNoError); } return info->finish(Thing::ThingErrorActionTypeNotFound); - } - - if (thing->thingClassId() == heatingThingClassId) { + } else if (thing->thingClassId() == heatingThingClassId) { if (action.actionTypeId() == heatingPowerActionTypeId) { thing->setStateValue(heatingPowerStateTypeId, action.param(heatingPowerActionPowerParamTypeId).value()); return info->finish(Thing::ThingErrorNoError); } return info->finish(Thing::ThingErrorActionTypeNotFound); - } - - if (thing->thingClassId() == powerSwitchThingClassId) { + } else if (thing->thingClassId() == powerSwitchThingClassId) { if (action.actionTypeId() == powerSwitchPowerActionTypeId) { thing->setStateValue(powerSwitchPowerStateTypeId, action.param(powerSwitchPowerActionPowerParamTypeId).value()); info->finish(Thing::ThingErrorNoError); return; } - } - - if (thing->thingClassId() == irrigationThingClassId) { + } else if (thing->thingClassId() == irrigationThingClassId) { if (action.actionTypeId() == irrigationPowerActionTypeId) { thing->setStateValue(irrigationPowerStateTypeId, action.param(irrigationPowerActionPowerParamTypeId).value()); info->finish(Thing::ThingErrorNoError); return; } - } - - if (thing->thingClassId() == ventilationThingClassId) { + } else if (thing->thingClassId() == ventilationThingClassId) { if (action.actionTypeId() == ventilationPowerActionTypeId) { thing->setStateValue(ventilationPowerStateTypeId, action.param(ventilationPowerActionPowerParamTypeId).value()); info->finish(Thing::ThingErrorNoError); return; } - } - - if (thing->thingClassId() == temperatureSensorThingClassId) { + } else if (thing->thingClassId() == temperatureSensorThingClassId) { if (action.actionTypeId() == temperatureSensorInputActionTypeId) { double value = info->action().param(temperatureSensorInputActionInputParamTypeId).value().toDouble(); thing->setStateValue(temperatureSensorInputStateTypeId, value); @@ -264,9 +318,7 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) info->finish(Thing::ThingErrorNoError); return; } - } - - if (thing->thingClassId() == humiditySensorThingClassId) { + } else if (thing->thingClassId() == humiditySensorThingClassId) { if (action.actionTypeId() == humiditySensorInputActionTypeId) { double value = info->action().param(humiditySensorInputActionInputParamTypeId).value().toDouble(); thing->setStateValue(humiditySensorInputStateTypeId, value); @@ -279,9 +331,7 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) info->finish(Thing::ThingErrorNoError); return; } - } - - if (thing->thingClassId() == moistureSensorThingClassId) { + } else if (thing->thingClassId() == moistureSensorThingClassId) { if (action.actionTypeId() == moistureSensorInputActionTypeId) { double value = info->action().param(moistureSensorInputActionInputParamTypeId).value().toDouble(); thing->setStateValue(moistureSensorInputStateTypeId, value); @@ -294,9 +344,9 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) info->finish(Thing::ThingErrorNoError); return; } + } else { + Q_ASSERT_X(false, "setupThing", QString("Unhandled thingClassId: %1").arg(thing->thingClassId().toString()).toUtf8()); } - - return info->finish(Thing::ThingErrorThingClassNotFound); } double IntegrationPluginGenericThings::mapDoubleValue(double value, double fromMin, double fromMax, double toMin, double toMax) diff --git a/genericthings/integrationplugingenericthings.json b/genericthings/integrationplugingenericthings.json index 838be3e..45aee59 100644 --- a/genericthings/integrationplugingenericthings.json +++ b/genericthings/integrationplugingenericthings.json @@ -130,6 +130,181 @@ } ] }, + { + "id": "40aa9f3c-a23c-4f7f-8786-fcf3554f3e19", + "name": "extendedBlind", + "displayName": "Generic extended blind", + "createMethods": ["user"], + "interfaces": ["blind"], + "stateTypes": [ + { + "id": "e559f077-e904-4bbc-8ec3-344b814d2eab", + "name": "openingOutput", + "displayName": "Opening output", + "displayNameEvent": "Opening output changed", + "displayNameAction": "Set opening output", + "type": "bool", + "defaultValue": false, + "ioType": "digitalInput", + "writable": true + }, + { + "id": "1a4a5839-a30d-4239-a124-63bfdc74a8f6", + "name": "closingOutput", + "displayName": "Closing output", + "displayNameEvent": "Closing output changed", + "displayNameAction": "Set closing output", + "type": "bool", + "defaultValue": false, + "ioType": "digitalInput", + "writable": true + }, + { + "id": "c2354d7e-198a-43ae-aa5f-c6710010c7e1", + "name": "status", + "displayName": "Status", + "displayNameEvent": "Status changed", + "type": "QString", + "possibleValues": [ + "Opening", + "Stopped", + "Closing" + ], + "defaultValue": "Stopped" + }, + { + "id": "941d1e1f-8dd7-4493-812f-6cefefd88c2e", + "name": "moving", + "type": "bool", + "displayName": "Moving", + "displayNameEvent": "Moving changed", + "defaultValue": false + }, + { + "id": "181df603-d45f-4d3d-a358-97aa3e4ac0bd", + "name": "percentage", + "displayName": "Percentage", + "displayNameEvent": "Percentage changed", + "displayNameAction": "Set percentage", + "type": "int", + "minValue": 0, + "maxValue": 100, + "defaultValue": 0, + "writable": true + } + ], + "actionTypes": [ + { + "id": "5a7599fa-8351-4ed6-9b98-fa2f3be54304", + "name": "open", + "displayName": "Open" + }, + { + "id": "ab67e4bf-c7b6-489b-9b49-3e0a1c7d33ca", + "name": "stop", + "displayName": "Stop" + }, + { + "id": "97d6351d-7440-47f3-bdba-a31bb15368ac", + "name": "close", + "displayName": "Close" + } + ] + }, + { + "id": "e6b96ced-8d50-45da-91c8-792d364d2795", + "name": "venetianBlind", + "displayName": "Venetian blind", + "createMethods": ["user"], + "interfaces": ["blind"], + "stateTypes": [ + { + "id": "6041dacf-5303-4dc0-ba3c-7ecaa438f2dd", + "name": "openingOutput", + "displayName": "Opening output", + "displayNameEvent": "Opening output changed", + "displayNameAction": "Set opening output", + "type": "bool", + "defaultValue": false, + "ioType": "digitalInput", + "writable": true + }, + { + "id": "84dd2fa1-85fe-47f3-9e32-e6083432d39c", + "name": "closingOutput", + "displayName": "Closing output", + "displayNameEvent": "Closing output changed", + "displayNameAction": "Set closing output", + "type": "bool", + "defaultValue": false, + "ioType": "digitalInput", + "writable": true + }, + { + "id": "6fb7826e-b6d8-42f8-b712-719496046436", + "name": "status", + "displayName": "Status", + "displayNameEvent": "Status changed", + "type": "QString", + "possibleValues": [ + "Opening", + "Stopped", + "Closing" + ], + "defaultValue": "Stopped" + }, + { + "id": "6234c07e-4200-4f2c-8cbd-bff24c38c243", + "name": "moving", + "type": "bool", + "displayName": "Moving", + "displayNameEvent": "Moving changed", + "defaultValue": false + }, + { + "id": "33dc8019-336d-4d50-8d60-dff8508338ca", + "name": "percentage", + "displayName": "Percentage", + "displayNameEvent": "Percentage changed", + "displayNameAction": "Set percentage", + "type": "int", + "minValue": 0, + "maxValue": 100, + "defaultValue": 0, + "writable": true + }, + { + "id": "fcb700c4-5da8-4385-85b0-6616e807974e", + "name": "angle", + "displayName": "Angle", + "displayNameEvent": "Angle changed", + "displayNameAction": "Set angle", + "type": "int", + "unit": "Degree", + "minValue": "any", + "maxValue": "any", + "defaultValue": 0, + "writable": true + } + ], + "actionTypes": [ + { + "id": "3e728e50-3d45-4035-b215-1e604cf3159b", + "name": "open", + "displayName": "Open" + }, + { + "id": "6e3eeb5d-d7ed-4175-9795-e76451e0a00b", + "name": "stop", + "displayName": "Stop" + }, + { + "id": "1c71f050-f6cb-4929-9c9d-7c262f77c143", + "name": "close", + "displayName": "Close" + } + ] + }, { "id": "7917c2e7-d7d2-4c47-a38d-41f7dd7693d9", "name": "shutter", From 9641d02fb74f8dacee833890cf456bbbd4cd4fb0 Mon Sep 17 00:00:00 2001 From: "bernhard.trinnes" Date: Fri, 3 Jul 2020 15:00:32 +0200 Subject: [PATCH 2/9] added percentage counter --- .../integrationplugingenericthings.cpp | 222 ++++++++++++++---- .../integrationplugingenericthings.h | 16 ++ .../integrationplugingenericthings.json | 29 ++- 3 files changed, 222 insertions(+), 45 deletions(-) diff --git a/genericthings/integrationplugingenericthings.cpp b/genericthings/integrationplugingenericthings.cpp index 6a177f4..d1ad231 100644 --- a/genericthings/integrationplugingenericthings.cpp +++ b/genericthings/integrationplugingenericthings.cpp @@ -1,8 +1,9 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* * * Copyright 2013 - 2020, nymea GmbH * Contact: contact@nymea.io -* + * This file is part of nymea. * This project including source code and documentation is protected by * copyright law, and remains the property of nymea GmbH. All rights, including @@ -42,6 +43,32 @@ IntegrationPluginGenericThings::IntegrationPluginGenericThings() void IntegrationPluginGenericThings::setupThing(ThingSetupInfo *info) { info->finish(Thing::ThingErrorNoError); + Thing *thing = info->thing(); + if (thing->thingClassId() == extendedBlindThingClassId) { + int closingTime = thing->paramValue(extendedBlindThingClosingTimeParamTypeId).toInt(); + QTimer* timer = new QTimer(this); + timer->setInterval(closingTime/100); // closing timer / 100 to update on every percent + m_extendedBlindPercentageTimer.insert(thing, timer); + connect(timer, &QTimer::timeout, this, [thing, this] { + int targetPercentage = m_extendedBlindTargetPercentage.value(thing); + m_extendedBlindTargetPercentage.insert(thing, targetPercentage++); + int currentPercentage = thing->stateValue(extendedBlindPercentageStateTypeId).toInt(); + thing->setStateValue(extendedBlindPercentageStateTypeId, currentPercentage++); + if (targetPercentage == currentPercentage) { + //Stop timer + setBlindState(BlindStateStopped, thing); + } + if (BlindStateOpening) { + + } else if (BlindStateClosing) { + + } else { + + } + }); + } else if (info->thing()->thingClassId() == venetianBlindThingClassId) { + + } } void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) @@ -136,94 +163,73 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) return info->finish(Thing::ThingErrorActionTypeNotFound); } else if (thing->thingClassId() == extendedBlindThingClassId) { + if (action.actionTypeId() == extendedBlindOpenActionTypeId) { - thing->setStateValue(extendedBlindStatusStateTypeId, "Opening"); - thing->setStateValue(extendedBlindClosingOutputStateTypeId, false); - thing->setStateValue(extendedBlindOpeningOutputStateTypeId, true); - //TODO set moving state + setBlindState(BlindStateOpening, thing); return info->finish(Thing::ThingErrorNoError); } else if (action.actionTypeId() == extendedBlindStopActionTypeId) { - thing->setStateValue(extendedBlindStatusStateTypeId, "Stopped"); - thing->setStateValue(extendedBlindOpeningOutputStateTypeId, false); - thing->setStateValue(extendedBlindClosingOutputStateTypeId, false); + setBlindState(BlindStateStopped, thing); return info->finish(Thing::ThingErrorNoError); } else if (action.actionTypeId() == extendedBlindCloseActionTypeId) { - thing->setStateValue(extendedBlindStatusStateTypeId, "Closing"); - thing->setStateValue(extendedBlindOpeningOutputStateTypeId, false); - thing->setStateValue(extendedBlindClosingOutputStateTypeId, true); + setBlindState(BlindStateClosing, thing); return info->finish(Thing::ThingErrorNoError); } else if (action.actionTypeId() == extendedBlindOpeningOutputActionTypeId) { bool on = action.param(extendedBlindOpeningOutputActionOpeningOutputParamTypeId).value().toBool(); thing->setStateValue(extendedBlindOpeningOutputStateTypeId, on); if (on) { - thing->setStateValue(extendedBlindStatusStateTypeId, "Opening"); - thing->setStateValue(extendedBlindClosingOutputStateTypeId, false); + setBlindState(BlindStateOpening, thing); } else { - thing->setStateValue(extendedBlindStatusStateTypeId, "Stopped"); + setBlindState(BlindStateStopped, thing); } info->finish(Thing::ThingErrorNoError); } else if (action.actionTypeId() == extendedBlindClosingOutputActionTypeId) { bool on = action.param(extendedBlindClosingOutputActionClosingOutputParamTypeId).value().toBool(); thing->setStateValue(extendedBlindClosingOutputStateTypeId, on); if (on) { - thing->setStateValue(extendedBlindStatusStateTypeId, "Closing"); - thing->setStateValue(extendedBlindOpeningOutputStateTypeId, false); + setBlindState(BlindStateClosing, thing); } else { - thing->setStateValue(extendedBlindStatusStateTypeId, "Stopped"); + setBlindState(BlindStateStopped, thing); } info->finish(Thing::ThingErrorNoError); } else if (action.actionTypeId() == extendedBlindPercentageActionTypeId) { - int percentage = action.param(extendedBlindPercentageActionPercentageParamTypeId).value().toBool(); - Q_UNUSED(percentage) - //TODO move to percentage + moveBlindToPercentage(action, thing); } else { Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } } else if (thing->thingClassId() == venetianBlindThingClassId) { if (action.actionTypeId() == venetianBlindOpenActionTypeId) { - thing->setStateValue(venetianBlindStatusStateTypeId, "Opening"); - thing->setStateValue(venetianBlindClosingOutputStateTypeId, false); - thing->setStateValue(venetianBlindOpeningOutputStateTypeId, true); - //TODO set moving state + setBlindState(BlindStateOpening, thing); return info->finish(Thing::ThingErrorNoError); } else if (action.actionTypeId() == venetianBlindStopActionTypeId) { - thing->setStateValue(venetianBlindStatusStateTypeId, "Stopped"); - thing->setStateValue(venetianBlindOpeningOutputStateTypeId, false); - thing->setStateValue(venetianBlindClosingOutputStateTypeId, false); + setBlindState(BlindStateStopped, thing); return info->finish(Thing::ThingErrorNoError); } else if (action.actionTypeId() == venetianBlindCloseActionTypeId) { - thing->setStateValue(venetianBlindStatusStateTypeId, "Closing"); - thing->setStateValue(venetianBlindOpeningOutputStateTypeId, false); - thing->setStateValue(venetianBlindClosingOutputStateTypeId, true); + setBlindState(BlindStateClosing, thing); return info->finish(Thing::ThingErrorNoError); } else if (action.actionTypeId() == venetianBlindOpeningOutputActionTypeId) { bool on = action.param(venetianBlindOpeningOutputActionOpeningOutputParamTypeId).value().toBool(); thing->setStateValue(venetianBlindOpeningOutputStateTypeId, on); if (on) { - thing->setStateValue(venetianBlindStatusStateTypeId, "Opening"); - thing->setStateValue(venetianBlindClosingOutputStateTypeId, false); + setBlindState(BlindStateOpening, thing); } else { - thing->setStateValue(venetianBlindStatusStateTypeId, "Stopped"); + setBlindState(BlindStateStopped, thing); } info->finish(Thing::ThingErrorNoError); } else if (action.actionTypeId() == venetianBlindClosingOutputActionTypeId) { bool on = action.param(venetianBlindClosingOutputActionClosingOutputParamTypeId).value().toBool(); thing->setStateValue(venetianBlindClosingOutputStateTypeId, on); if (on) { - thing->setStateValue(venetianBlindStatusStateTypeId, "Closing"); - thing->setStateValue(venetianBlindOpeningOutputStateTypeId, false); + setBlindState(BlindStateClosing, thing); } else { - thing->setStateValue(venetianBlindStatusStateTypeId, "Stopped"); + setBlindState(BlindStateStopped, thing); } info->finish(Thing::ThingErrorNoError); } else if (action.actionTypeId() == venetianBlindPercentageActionTypeId) { - int percentage = action.param(venetianBlindPercentageActionPercentageParamTypeId).value().toInt(); - Q_UNUSED(percentage) - //TODO move to percentage + moveBlindToPercentage(action, thing); + info->finish(Thing::ThingErrorNoError); } else if (action.actionTypeId() == venetianBlindAngleActionTypeId) { - int angle = action.param(venetianBlindAngleActionAngleParamTypeId).value().toInt(); - Q_UNUSED(angle) - //TODO move to angle + moveBlindToAngle(action, thing); + info->finish(Thing::ThingErrorNoError); } else { Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } @@ -349,9 +355,139 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) } } +void IntegrationPluginGenericThings::thingRemoved(Thing *thing) +{ + if (thing->thingClassId() == extendedBlindThingClassId) { + m_extendedBlindPercentageTimer.take(thing)->deleteLater(); + m_extendedBlindTargetPercentage.remove(thing); + } else if (thing->thingClassId() == venetianBlindThingClassId) { + m_extendedBlindPercentageTimer.take(thing)->deleteLater(); + m_extendedBlindTargetPercentage.remove(thing); + m_venetianBlindAngleTimer.take(thing)->deleteLater(); + } +} + double IntegrationPluginGenericThings::mapDoubleValue(double value, double fromMin, double fromMax, double toMin, double toMax) { double percent = (value - fromMin) / (fromMax - fromMin); double toValue = toMin + (toMax - toMin) * percent; return toValue; } + +void IntegrationPluginGenericThings::setBlindState(IntegrationPluginGenericThings::BlindState state, Thing *thing) +{ + //If an ongoing "to percentage" actions is beeing executed, it is now overruled by another action + m_extendedBlindPercentageTimer.value(thing)->stop(); + m_extendedBlindTargetPercentage.remove(thing); + + if (thing->thingClassId() == extendedBlindThingClassId) { + switch (state) { + case BlindStateOpening: + thing->setStateValue(extendedBlindStatusStateTypeId, "Opening"); + thing->setStateValue(extendedBlindClosingOutputStateTypeId, false); + thing->setStateValue(extendedBlindOpeningOutputStateTypeId, true); + thing->setStateValue(extendedBlindMovingStateTypeId, true); + break; + case BlindStateClosing: + thing->setStateValue(extendedBlindStatusStateTypeId, "Closing"); + thing->setStateValue(extendedBlindClosingOutputStateTypeId, true); + thing->setStateValue(extendedBlindOpeningOutputStateTypeId, false); + thing->setStateValue(extendedBlindMovingStateTypeId, true); + break; + case BlindStateStopped: + thing->setStateValue(extendedBlindStatusStateTypeId, "Stopped"); + thing->setStateValue(extendedBlindClosingOutputStateTypeId, false); + thing->setStateValue(extendedBlindOpeningOutputStateTypeId, false); + thing->setStateValue(extendedBlindMovingStateTypeId, false); + break; + } + } else if (thing->thingClassId() == venetianBlindThingClassId) { + switch (state) { + case BlindStateOpening: + thing->setStateValue(venetianBlindStatusStateTypeId, "Opening"); + thing->setStateValue(venetianBlindClosingOutputStateTypeId, false); + thing->setStateValue(venetianBlindOpeningOutputStateTypeId, true); + thing->setStateValue(venetianBlindMovingStateTypeId, true); + break; + case BlindStateClosing: + thing->setStateValue(venetianBlindStatusStateTypeId, "Closing"); + thing->setStateValue(venetianBlindClosingOutputStateTypeId, true); + thing->setStateValue(venetianBlindOpeningOutputStateTypeId, false); + thing->setStateValue(venetianBlindMovingStateTypeId, true); + break; + case BlindStateStopped: + thing->setStateValue(venetianBlindStatusStateTypeId, "Stopped"); + thing->setStateValue(venetianBlindClosingOutputStateTypeId, false); + thing->setStateValue(venetianBlindOpeningOutputStateTypeId, false); + thing->setStateValue(venetianBlindMovingStateTypeId, false); + break; + } + } +} + +void IntegrationPluginGenericThings::setBlindMovingState(Action action, Thing *thing) +{ + if (thing->thingClassId() == extendedBlindThingClassId) { + int percentage = thing->stateValue(extendedBlindPercentageStateTypeId).toInt(); + if (action.actionTypeId() == extendedBlindOpenActionTypeId) { + if (percentage != 100) { + setBlindState(BlindStateOpening, thing); + } else { + // Blind already open + setBlindState(BlindStateStopped, thing); + } + } else if (action.actionTypeId() == extendedBlindStopActionTypeId) { + setBlindState(BlindStateStopped, thing); + thing->setStateValue(extendedBlindMovingStateTypeId, false); + + } else if (action.actionTypeId() == extendedBlindCloseActionTypeId) { + if (percentage != 0) { + setBlindState(BlindStateClosing, thing); + } else { + // Blind already closed + setBlindState(BlindStateStopped, thing); + thing->setStateValue(extendedBlindMovingStateTypeId, false); + } + } + + } else if (thing->thingClassId() == venetianBlindThingClassId) { + + } +} + +void IntegrationPluginGenericThings::moveBlindToPercentage(Action action, Thing *thing) +{ + if (thing->thingClassId() == extendedBlindThingClassId) { + int targetPercentage = action.param(extendedBlindPercentageActionPercentageParamTypeId).value().toBool(); + int currentPercentage = thing->stateValue(extendedBlindPercentageStateTypeId).toInt(); + // 100% indicates the device is fully closed + if (targetPercentage == currentPercentage) { + //Nothing to do + } else if (targetPercentage > currentPercentage) { + setBlindState(BlindStateClosing, thing); + m_extendedBlindTargetPercentage.insert(thing, targetPercentage); + m_extendedBlindPercentageTimer.value(thing)->start(); + } else if (targetPercentage < currentPercentage) { + setBlindState(BlindStateOpening, thing); + m_extendedBlindTargetPercentage.insert(thing, targetPercentage); + m_extendedBlindPercentageTimer.value(thing)->start(); + } else { + setBlindState(BlindStateStopped, thing); + } + } else if (thing->thingClassId() == venetianBlindThingClassId) { + int targetPercentage = action.param(venetianBlindPercentageActionPercentageParamTypeId).value().toBool(); + int currentPercentage = thing->stateValue(venetianBlindPercentageStateTypeId).toInt(); + if (targetPercentage == currentPercentage) { + + } else if (targetPercentage > currentPercentage) { + + } else if (targetPercentage < currentPercentage) { + + } + } +} + +void IntegrationPluginGenericThings::moveBlindToAngle(Action action, Thing *thing) +{ + +} diff --git a/genericthings/integrationplugingenericthings.h b/genericthings/integrationplugingenericthings.h index 5e6f7f3..d4e5f98 100644 --- a/genericthings/integrationplugingenericthings.h +++ b/genericthings/integrationplugingenericthings.h @@ -32,6 +32,7 @@ #define INTEGRATIONPLUGINGENERICTHINGS_H #include "integrations/integrationplugin.h" +#include class IntegrationPluginGenericThings: public IntegrationPlugin { @@ -44,9 +45,24 @@ public: explicit IntegrationPluginGenericThings(); void setupThing(ThingSetupInfo *info) override; void executeAction(ThingActionInfo *info) override; + void thingRemoved(Thing *thing) override; private: double mapDoubleValue(double value, double fromMin, double fromMax, double toMin, double toMax); + + QHash m_extendedBlindPercentageTimer; + QHash m_venetianBlindAngleTimer; + QHash m_extendedBlindTargetPercentage; + + enum BlindState { + BlindStateOpening, + BlindStateClosing, + BlindStateStopped + }; + void setBlindState(BlindState state, Thing *thing); + void setBlindMovingState(Action action, Thing *thing); + void moveBlindToPercentage(Action action, Thing *thing); + void moveBlindToAngle(Action action, Thing *thing); }; #endif // INTEGRATIONPLUGINGENERICTHINGS_H diff --git a/genericthings/integrationplugingenericthings.json b/genericthings/integrationplugingenericthings.json index 45aee59..846afd2 100644 --- a/genericthings/integrationplugingenericthings.json +++ b/genericthings/integrationplugingenericthings.json @@ -135,7 +135,16 @@ "name": "extendedBlind", "displayName": "Generic extended blind", "createMethods": ["user"], - "interfaces": ["blind"], + "interfaces": ["extendedblind"], + "paramTypes": [ + { + "id": "27a95b8d-7f97-441b-a3be-0646c517cb06", + "name": "closingTime", + "displayName": "Closing time [MilliSecond]", + "type": "int", + "defaultValue": 0 + } + ], "stateTypes": [ { "id": "e559f077-e904-4bbc-8ec3-344b814d2eab", @@ -216,7 +225,23 @@ "name": "venetianBlind", "displayName": "Venetian blind", "createMethods": ["user"], - "interfaces": ["blind"], + "interfaces": ["venetianblind"], + "paramTypes": [ + { + "id": "4c0bf07d-aaab-4f67-af65-00ceaefbaa84", + "name": "closingTime", + "displayName": "Closing time [MilliSecond]", + "type": "int", + "defaultValue": 0 + }, + { + "id": "6c8340bf-7fd3-43e3-a75b-dfa2f6426e11", + "name": "angleTime", + "displayName": "Angle end to end time [MilliSecond]", + "type": "int", + "defaultValue": 0 + } + ], "stateTypes": [ { "id": "6041dacf-5303-4dc0-ba3c-7ecaa438f2dd", From 5dab9ff079138d3ec265e29bc3d0356f3c90c0fd Mon Sep 17 00:00:00 2001 From: "bernhard.trinnes" Date: Fri, 3 Jul 2020 16:20:39 +0200 Subject: [PATCH 3/9] added percentage counter --- .../integrationplugingenericthings.cpp | 83 +++++++++++++++---- 1 file changed, 68 insertions(+), 15 deletions(-) diff --git a/genericthings/integrationplugingenericthings.cpp b/genericthings/integrationplugingenericthings.cpp index d1ad231..8e03b9f 100644 --- a/genericthings/integrationplugingenericthings.cpp +++ b/genericthings/integrationplugingenericthings.cpp @@ -50,24 +50,64 @@ void IntegrationPluginGenericThings::setupThing(ThingSetupInfo *info) timer->setInterval(closingTime/100); // closing timer / 100 to update on every percent m_extendedBlindPercentageTimer.insert(thing, timer); connect(timer, &QTimer::timeout, this, [thing, this] { - int targetPercentage = m_extendedBlindTargetPercentage.value(thing); - m_extendedBlindTargetPercentage.insert(thing, targetPercentage++); int currentPercentage = thing->stateValue(extendedBlindPercentageStateTypeId).toInt(); - thing->setStateValue(extendedBlindPercentageStateTypeId, currentPercentage++); - if (targetPercentage == currentPercentage) { - //Stop timer + + if (thing->stateValue(extendedBlindStatusStateTypeId).toString() == "Closing") { + thing->setStateValue(extendedBlindPercentageStateTypeId, currentPercentage++); + if (currentPercentage == 100) { + setBlindState(BlindStateStopped, thing); + qCDebug(dcGenericThings()) << "Extended blind is closed, stopping timer"; + } + } else if (thing->stateValue(extendedBlindStatusStateTypeId).toString() == "Opening") { + thing->setStateValue(extendedBlindPercentageStateTypeId, currentPercentage--); + if (currentPercentage == 0) { + setBlindState(BlindStateStopped, thing); + qCDebug(dcGenericThings()) << "Extended blind is opened, stopping timer"; + } + } else { setBlindState(BlindStateStopped, thing); } - if (BlindStateOpening) { - - } else if (BlindStateClosing) { - - } else { + if (m_extendedBlindPercentageTimer.contains(thing)) { + int targetPercentage = m_extendedBlindTargetPercentage.value(thing); + if (targetPercentage == currentPercentage) { + qCDebug(dcGenericThings()) << "Extended blind has reached target percentage, stopping timer"; + setBlindState(BlindStateStopped, thing); + } } }); } else if (info->thing()->thingClassId() == venetianBlindThingClassId) { + int closingTime = thing->paramValue(venetianBlindThingClosingTimeParamTypeId).toInt(); + QTimer* timer = new QTimer(this); + timer->setInterval(closingTime/100); // closing timer / 100 to update on every percent + m_extendedBlindPercentageTimer.insert(thing, timer); + connect(timer, &QTimer::timeout, this, [thing, this] { + int currentPercentage = thing->stateValue(venetianBlindPercentageStateTypeId).toInt(); + if (thing->stateValue(venetianBlindStatusStateTypeId).toString() == "Closing") { + thing->setStateValue(venetianBlindPercentageStateTypeId, currentPercentage++); + if (currentPercentage == 100) { + setBlindState(BlindStateStopped, thing); + qCDebug(dcGenericThings()) << "Venetian blind is closed, stopping timer"; + } + } else if (thing->stateValue(venetianBlindStatusStateTypeId).toString() == "Opening") { + thing->setStateValue(venetianBlindPercentageStateTypeId, currentPercentage--); + if (currentPercentage == 0) { + setBlindState(BlindStateStopped, thing); + qCDebug(dcGenericThings()) << "Venetian blind is opened, stopping timer"; + } + } else { + setBlindState(BlindStateStopped, thing); + } + + if (m_extendedBlindPercentageTimer.contains(thing)) { + int targetPercentage = m_extendedBlindTargetPercentage.value(thing); + if (targetPercentage == currentPercentage) { + qCDebug(dcGenericThings()) << "Venetian blind has reached target percentage, stopping timer"; + setBlindState(BlindStateStopped, thing); + } + } + }); } } @@ -358,8 +398,8 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) void IntegrationPluginGenericThings::thingRemoved(Thing *thing) { if (thing->thingClassId() == extendedBlindThingClassId) { - m_extendedBlindPercentageTimer.take(thing)->deleteLater(); - m_extendedBlindTargetPercentage.remove(thing); + m_extendedBlindPercentageTimer.take(thing)->deleteLater(); + m_extendedBlindTargetPercentage.remove(thing); } else if (thing->thingClassId() == venetianBlindThingClassId) { m_extendedBlindPercentageTimer.take(thing)->deleteLater(); m_extendedBlindTargetPercentage.remove(thing); @@ -477,17 +517,30 @@ void IntegrationPluginGenericThings::moveBlindToPercentage(Action action, Thing } else if (thing->thingClassId() == venetianBlindThingClassId) { int targetPercentage = action.param(venetianBlindPercentageActionPercentageParamTypeId).value().toBool(); int currentPercentage = thing->stateValue(venetianBlindPercentageStateTypeId).toInt(); + // 100% indicates the device is fully closed if (targetPercentage == currentPercentage) { - + //Nothing to do } else if (targetPercentage > currentPercentage) { - + setBlindState(BlindStateClosing, thing); + m_extendedBlindTargetPercentage.insert(thing, targetPercentage); + m_extendedBlindPercentageTimer.value(thing)->start(); } else if (targetPercentage < currentPercentage) { - + setBlindState(BlindStateOpening, thing); + m_extendedBlindTargetPercentage.insert(thing, targetPercentage); + m_extendedBlindPercentageTimer.value(thing)->start(); + } else { + setBlindState(BlindStateStopped, thing); } } } void IntegrationPluginGenericThings::moveBlindToAngle(Action action, Thing *thing) { + Q_UNUSED(action) + Q_UNUSED(thing) + if (thing->thingClassId() == venetianBlindThingClassId) { + if (action.actionTypeId() == venetianBlindAngleActionTypeId) { + } + } } From f3a6c961b46df9a686adc35c21d63e9a34b6b333 Mon Sep 17 00:00:00 2001 From: "bernhard.trinnes" Date: Sat, 4 Jul 2020 12:16:12 +0200 Subject: [PATCH 4/9] updated translation files --- .../integrationplugingenericthings.cpp | 241 +++++---- .../integrationplugingenericthings.h | 4 +- .../integrationplugingenericthings.json | 6 +- ...b3188696-2585-4806-bf98-30ab576ce5c8-de.ts | 495 ++++++++++++------ ...88696-2585-4806-bf98-30ab576ce5c8-en_US.ts | 323 +++++++++--- 5 files changed, 735 insertions(+), 334 deletions(-) diff --git a/genericthings/integrationplugingenericthings.cpp b/genericthings/integrationplugingenericthings.cpp index 8e03b9f..0e6a17e 100644 --- a/genericthings/integrationplugingenericthings.cpp +++ b/genericthings/integrationplugingenericthings.cpp @@ -45,31 +45,44 @@ void IntegrationPluginGenericThings::setupThing(ThingSetupInfo *info) info->finish(Thing::ThingErrorNoError); Thing *thing = info->thing(); if (thing->thingClassId() == extendedBlindThingClassId) { - int closingTime = thing->paramValue(extendedBlindThingClosingTimeParamTypeId).toInt(); + uint closingTime = thing->paramValue(extendedBlindThingClosingTimeParamTypeId).toUInt(); + if (closingTime <= 0) { + return info->finish(Thing::ThingErrorSetupFailed, tr("Invalid closing time")); + } QTimer* timer = new QTimer(this); - timer->setInterval(closingTime/100); // closing timer / 100 to update on every percent + timer->setInterval(closingTime/100.00); // closing timer / 100 to update on every percent m_extendedBlindPercentageTimer.insert(thing, timer); connect(timer, &QTimer::timeout, this, [thing, this] { - int currentPercentage = thing->stateValue(extendedBlindPercentageStateTypeId).toInt(); + uint currentPercentage = thing->stateValue(extendedBlindPercentageStateTypeId).toUInt(); if (thing->stateValue(extendedBlindStatusStateTypeId).toString() == "Closing") { - thing->setStateValue(extendedBlindPercentageStateTypeId, currentPercentage++); + if (currentPercentage == 100) { setBlindState(BlindStateStopped, thing); qCDebug(dcGenericThings()) << "Extended blind is closed, stopping timer"; + } else if (currentPercentage > 100) { + currentPercentage = 100; + setBlindState(BlindStateStopped, thing); + qCWarning(dcGenericThings()) << "Extended blind overshoot 100 percent"; + } else { + currentPercentage++; + thing->setStateValue(extendedBlindPercentageStateTypeId, currentPercentage); } } else if (thing->stateValue(extendedBlindStatusStateTypeId).toString() == "Opening") { - thing->setStateValue(extendedBlindPercentageStateTypeId, currentPercentage--); + if (currentPercentage == 0) { setBlindState(BlindStateStopped, thing); qCDebug(dcGenericThings()) << "Extended blind is opened, stopping timer"; + } else { + currentPercentage--; + thing->setStateValue(extendedBlindPercentageStateTypeId, currentPercentage); } } else { setBlindState(BlindStateStopped, thing); } if (m_extendedBlindPercentageTimer.contains(thing)) { - int targetPercentage = m_extendedBlindTargetPercentage.value(thing); + uint targetPercentage = m_extendedBlindTargetPercentage.value(thing); if (targetPercentage == currentPercentage) { qCDebug(dcGenericThings()) << "Extended blind has reached target percentage, stopping timer"; setBlindState(BlindStateStopped, thing); @@ -77,37 +90,92 @@ void IntegrationPluginGenericThings::setupThing(ThingSetupInfo *info) } }); } else if (info->thing()->thingClassId() == venetianBlindThingClassId) { - int closingTime = thing->paramValue(venetianBlindThingClosingTimeParamTypeId).toInt(); + uint closingTime = thing->paramValue(venetianBlindThingClosingTimeParamTypeId).toUInt(); + uint angleTime = thing->paramValue(venetianBlindThingAngleTimeParamTypeId).toUInt(); + if (closingTime <=0 || closingTime < angleTime || angleTime <= 0) { + return info->finish(Thing::ThingErrorSetupFailed, tr("Invalid closing or angle time")); + } QTimer* timer = new QTimer(this); - timer->setInterval(closingTime/100); // closing timer / 100 to update on every percent + timer->setInterval(closingTime/100.00); // closing timer / 100 to update on every percent m_extendedBlindPercentageTimer.insert(thing, timer); + connect(timer, &QTimer::timeout, this, [thing, this] { - int currentPercentage = thing->stateValue(venetianBlindPercentageStateTypeId).toInt(); + uint currentPercentage = thing->stateValue(venetianBlindPercentageStateTypeId).toUInt(); if (thing->stateValue(venetianBlindStatusStateTypeId).toString() == "Closing") { - thing->setStateValue(venetianBlindPercentageStateTypeId, currentPercentage++); + if (currentPercentage == 100) { setBlindState(BlindStateStopped, thing); qCDebug(dcGenericThings()) << "Venetian blind is closed, stopping timer"; + } else if (currentPercentage > 100) { + currentPercentage = 100; + setBlindState(BlindStateStopped, thing); + qCWarning(dcGenericThings()) << "Venetian blind overshoot 100 percent"; + } else { + currentPercentage++; + thing->setStateValue(venetianBlindPercentageStateTypeId, currentPercentage); } } else if (thing->stateValue(venetianBlindStatusStateTypeId).toString() == "Opening") { - thing->setStateValue(venetianBlindPercentageStateTypeId, currentPercentage--); + currentPercentage--; if (currentPercentage == 0) { setBlindState(BlindStateStopped, thing); qCDebug(dcGenericThings()) << "Venetian blind is opened, stopping timer"; + } else { + currentPercentage++; + thing->setStateValue(venetianBlindPercentageStateTypeId, currentPercentage); } } else { setBlindState(BlindStateStopped, thing); } if (m_extendedBlindPercentageTimer.contains(thing)) { - int targetPercentage = m_extendedBlindTargetPercentage.value(thing); + uint targetPercentage = m_extendedBlindTargetPercentage.value(thing); if (targetPercentage == currentPercentage) { qCDebug(dcGenericThings()) << "Venetian blind has reached target percentage, stopping timer"; setBlindState(BlindStateStopped, thing); } } }); + + QTimer* angleTimer = new QTimer(this); + angleTimer->setInterval(angleTime/180.00); // -90 to 90 degree -> 180 degree total + m_venetianBlindAngleTimer.insert(thing, angleTimer); + connect(angleTimer, &QTimer::timeout, this, [thing, this] { + int currentAngle = thing->stateValue(venetianBlindAngleStateTypeId).toInt(); + if (thing->stateValue(venetianBlindStatusStateTypeId).toString() == "Closing") { + + if (currentAngle < 90) { + currentAngle++; + } else if (currentAngle == 90) { + m_venetianBlindAngleTimer.value(thing)->stop(); + } else if (currentAngle > 90) { + currentAngle = 90; + m_venetianBlindAngleTimer.value(thing)->stop(); + qCWarning(dcGenericThings()) << "Venetian blind overshoot angle boundaries"; + } + thing->setStateValue(venetianBlindPercentageStateTypeId, currentAngle); + } else if (thing->stateValue(venetianBlindStatusStateTypeId).toString() == "Opening") { + + if (currentAngle > -90) { + currentAngle--; + } else if (currentAngle == -90) { + m_venetianBlindAngleTimer.value(thing)->stop(); + } else if (currentAngle < -90) { + currentAngle = -90; + m_venetianBlindAngleTimer.value(thing)->stop(); + qCWarning(dcGenericThings()) << "Venetian blind overshoot angle boundaries"; + } + thing->setStateValue(venetianBlindPercentageStateTypeId, currentAngle); + } + + if (m_venetianBlindTargetAngle.contains(thing)) { + int targetAngle = m_venetianBlindTargetAngle.value(thing); + if (targetAngle == currentAngle) { + qCDebug(dcGenericThings()) << "Venetian blind has reached target angle, stopping timer"; + setBlindState(BlindStateStopped, thing); + } + } + }); } } @@ -122,20 +190,17 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) thing->setStateValue(awningClosingOutputStateTypeId, false); thing->setStateValue(awningOpeningOutputStateTypeId, true); return info->finish(Thing::ThingErrorNoError); - } - if (action.actionTypeId() == awningStopActionTypeId) { + } else if (action.actionTypeId() == awningStopActionTypeId) { thing->setStateValue(awningStatusStateTypeId, "Stopped"); thing->setStateValue(awningOpeningOutputStateTypeId, false); thing->setStateValue(awningClosingOutputStateTypeId, false); return info->finish(Thing::ThingErrorNoError); - } - if (action.actionTypeId() == awningCloseActionTypeId) { + } else if (action.actionTypeId() == awningCloseActionTypeId) { thing->setStateValue(awningStatusStateTypeId, "Closing"); thing->setStateValue(awningOpeningOutputStateTypeId, false); thing->setStateValue(awningClosingOutputStateTypeId, true); return info->finish(Thing::ThingErrorNoError); - } - if (action.actionTypeId() == awningOpeningOutputActionTypeId) { + } else if (action.actionTypeId() == awningOpeningOutputActionTypeId) { bool on = action.param(awningOpeningOutputActionOpeningOutputParamTypeId).value().toBool(); thing->setStateValue(awningOpeningOutputStateTypeId, on); if (on) { @@ -145,8 +210,7 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) thing->setStateValue(awningStatusStateTypeId, "Stopped"); } info->finish(Thing::ThingErrorNoError); - } - if (action.actionTypeId() == awningClosingOutputActionTypeId) { + } else if (action.actionTypeId() == awningClosingOutputActionTypeId) { bool on = action.param(awningClosingOutputActionClosingOutputParamTypeId).value().toBool(); thing->setStateValue(awningClosingOutputStateTypeId, on); if (on) { @@ -156,29 +220,26 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) thing->setStateValue(awningStatusStateTypeId, "Stopped"); } info->finish(Thing::ThingErrorNoError); + } else { + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } - return info->finish(Thing::ThingErrorActionTypeNotFound); - } else if (thing->thingClassId() == blindThingClassId ) { if (action.actionTypeId() == blindOpenActionTypeId) { thing->setStateValue(blindStatusStateTypeId, "Opening"); thing->setStateValue(blindClosingOutputStateTypeId, false); thing->setStateValue(blindOpeningOutputStateTypeId, true); return info->finish(Thing::ThingErrorNoError); - } - if (action.actionTypeId() == blindStopActionTypeId) { + } else if (action.actionTypeId() == blindStopActionTypeId) { thing->setStateValue(blindStatusStateTypeId, "Stopped"); thing->setStateValue(blindOpeningOutputStateTypeId, false); thing->setStateValue(blindClosingOutputStateTypeId, false); return info->finish(Thing::ThingErrorNoError); - } - if (action.actionTypeId() == blindCloseActionTypeId) { + } else if (action.actionTypeId() == blindCloseActionTypeId) { thing->setStateValue(blindStatusStateTypeId, "Closing"); thing->setStateValue(blindOpeningOutputStateTypeId, false); thing->setStateValue(blindClosingOutputStateTypeId, true); return info->finish(Thing::ThingErrorNoError); - } - if (action.actionTypeId() == blindOpeningOutputActionTypeId) { + } else if (action.actionTypeId() == blindOpeningOutputActionTypeId) { bool on = action.param(blindOpeningOutputActionOpeningOutputParamTypeId).value().toBool(); thing->setStateValue(blindOpeningOutputStateTypeId, on); if (on) { @@ -188,8 +249,7 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) thing->setStateValue(blindStatusStateTypeId, "Stopped"); } info->finish(Thing::ThingErrorNoError); - } - if (action.actionTypeId() == blindClosingOutputActionTypeId) { + } else if (action.actionTypeId() == blindClosingOutputActionTypeId) { bool on = action.param(blindClosingOutputActionClosingOutputParamTypeId).value().toBool(); thing->setStateValue(blindClosingOutputStateTypeId, on); if (on) { @@ -199,9 +259,9 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) thing->setStateValue(blindStatusStateTypeId, "Stopped"); } info->finish(Thing::ThingErrorNoError); + } else { + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } - return info->finish(Thing::ThingErrorActionTypeNotFound); - } else if (thing->thingClassId() == extendedBlindThingClassId) { if (action.actionTypeId() == extendedBlindOpenActionTypeId) { @@ -279,20 +339,17 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) thing->setStateValue(shutterClosingOutputStateTypeId, false); thing->setStateValue(shutterOpeningOutputStateTypeId, true); return info->finish(Thing::ThingErrorNoError); - } - if (action.actionTypeId() == shutterStopActionTypeId) { + } else if (action.actionTypeId() == shutterStopActionTypeId) { thing->setStateValue(shutterStatusStateTypeId, "Stopped"); thing->setStateValue(shutterOpeningOutputStateTypeId, false); thing->setStateValue(shutterClosingOutputStateTypeId, false); return info->finish(Thing::ThingErrorNoError); - } - if (action.actionTypeId() == shutterCloseActionTypeId) { + } else if (action.actionTypeId() == shutterCloseActionTypeId) { thing->setStateValue(shutterStatusStateTypeId, "Closing"); thing->setStateValue(shutterOpeningOutputStateTypeId, false); thing->setStateValue(shutterClosingOutputStateTypeId, true); return info->finish(Thing::ThingErrorNoError); - } - if (action.actionTypeId() == shutterOpeningOutputActionTypeId) { + } else if (action.actionTypeId() == shutterOpeningOutputActionTypeId) { bool on = action.param(shutterOpeningOutputActionOpeningOutputParamTypeId).value().toBool(); thing->setStateValue(shutterOpeningOutputStateTypeId, on); if (on) { @@ -302,8 +359,7 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) thing->setStateValue(shutterStatusStateTypeId, "Stopped"); } info->finish(Thing::ThingErrorNoError); - } - if (action.actionTypeId() == shutterClosingOutputActionTypeId) { + } else if (action.actionTypeId() == shutterClosingOutputActionTypeId) { bool on = action.param(shutterClosingOutputActionClosingOutputParamTypeId).value().toBool(); thing->setStateValue(shutterClosingOutputStateTypeId, on); if (on) { @@ -313,43 +369,53 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) thing->setStateValue(shutterStatusStateTypeId, "Stopped"); } info->finish(Thing::ThingErrorNoError); + } else { + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } - return info->finish(Thing::ThingErrorActionTypeNotFound); } else if (thing->thingClassId() == socketThingClassId) { if (action.actionTypeId() == socketPowerActionTypeId) { thing->setStateValue(socketPowerStateTypeId, action.param(socketPowerActionPowerParamTypeId).value()); return info->finish(Thing::ThingErrorNoError); + } else { + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } - return info->finish(Thing::ThingErrorActionTypeNotFound); } else if (thing->thingClassId() == lightThingClassId) { if (action.actionTypeId() == lightPowerActionTypeId) { thing->setStateValue(lightPowerStateTypeId, action.param(lightPowerActionPowerParamTypeId).value()); return info->finish(Thing::ThingErrorNoError); + } else { + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } - return info->finish(Thing::ThingErrorActionTypeNotFound); } else if (thing->thingClassId() == heatingThingClassId) { if (action.actionTypeId() == heatingPowerActionTypeId) { thing->setStateValue(heatingPowerStateTypeId, action.param(heatingPowerActionPowerParamTypeId).value()); return info->finish(Thing::ThingErrorNoError); + } else { + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } - return info->finish(Thing::ThingErrorActionTypeNotFound); } else if (thing->thingClassId() == powerSwitchThingClassId) { if (action.actionTypeId() == powerSwitchPowerActionTypeId) { thing->setStateValue(powerSwitchPowerStateTypeId, action.param(powerSwitchPowerActionPowerParamTypeId).value()); info->finish(Thing::ThingErrorNoError); return; + } else { + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } } else if (thing->thingClassId() == irrigationThingClassId) { if (action.actionTypeId() == irrigationPowerActionTypeId) { thing->setStateValue(irrigationPowerStateTypeId, action.param(irrigationPowerActionPowerParamTypeId).value()); info->finish(Thing::ThingErrorNoError); return; + } else { + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } } else if (thing->thingClassId() == ventilationThingClassId) { if (action.actionTypeId() == ventilationPowerActionTypeId) { thing->setStateValue(ventilationPowerStateTypeId, action.param(ventilationPowerActionPowerParamTypeId).value()); info->finish(Thing::ThingErrorNoError); return; + } else { + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } } else if (thing->thingClassId() == temperatureSensorThingClassId) { if (action.actionTypeId() == temperatureSensorInputActionTypeId) { @@ -363,6 +429,8 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) thing->setStateValue(temperatureSensorTemperatureStateTypeId, newValue); info->finish(Thing::ThingErrorNoError); return; + } else { + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } } else if (thing->thingClassId() == humiditySensorThingClassId) { if (action.actionTypeId() == humiditySensorInputActionTypeId) { @@ -376,6 +444,8 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) thing->setStateValue(humiditySensorHumidityStateTypeId, newValue); info->finish(Thing::ThingErrorNoError); return; + } else { + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } } else if (thing->thingClassId() == moistureSensorThingClassId) { if (action.actionTypeId() == moistureSensorInputActionTypeId) { @@ -389,6 +459,8 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) thing->setStateValue(moistureSensorMoistureStateTypeId, newValue); info->finish(Thing::ThingErrorNoError); return; + } else { + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } } else { Q_ASSERT_X(false, "setupThing", QString("Unhandled thingClassId: %1").arg(thing->thingClassId().toString()).toUtf8()); @@ -417,7 +489,6 @@ double IntegrationPluginGenericThings::mapDoubleValue(double value, double fromM void IntegrationPluginGenericThings::setBlindState(IntegrationPluginGenericThings::BlindState state, Thing *thing) { //If an ongoing "to percentage" actions is beeing executed, it is now overruled by another action - m_extendedBlindPercentageTimer.value(thing)->stop(); m_extendedBlindTargetPercentage.remove(thing); if (thing->thingClassId() == extendedBlindThingClassId) { @@ -427,120 +498,114 @@ void IntegrationPluginGenericThings::setBlindState(IntegrationPluginGenericThing thing->setStateValue(extendedBlindClosingOutputStateTypeId, false); thing->setStateValue(extendedBlindOpeningOutputStateTypeId, true); thing->setStateValue(extendedBlindMovingStateTypeId, true); + m_extendedBlindPercentageTimer.value(thing)->start(); break; case BlindStateClosing: thing->setStateValue(extendedBlindStatusStateTypeId, "Closing"); thing->setStateValue(extendedBlindClosingOutputStateTypeId, true); thing->setStateValue(extendedBlindOpeningOutputStateTypeId, false); thing->setStateValue(extendedBlindMovingStateTypeId, true); + m_extendedBlindPercentageTimer.value(thing)->start(); break; case BlindStateStopped: thing->setStateValue(extendedBlindStatusStateTypeId, "Stopped"); thing->setStateValue(extendedBlindClosingOutputStateTypeId, false); thing->setStateValue(extendedBlindOpeningOutputStateTypeId, false); thing->setStateValue(extendedBlindMovingStateTypeId, false); + m_extendedBlindPercentageTimer.value(thing)->stop(); break; } } else if (thing->thingClassId() == venetianBlindThingClassId) { + m_venetianBlindTargetAngle.remove(thing); switch (state) { case BlindStateOpening: thing->setStateValue(venetianBlindStatusStateTypeId, "Opening"); thing->setStateValue(venetianBlindClosingOutputStateTypeId, false); thing->setStateValue(venetianBlindOpeningOutputStateTypeId, true); thing->setStateValue(venetianBlindMovingStateTypeId, true); + m_extendedBlindPercentageTimer.value(thing)->start(); + m_venetianBlindAngleTimer.value(thing)->start(); break; case BlindStateClosing: thing->setStateValue(venetianBlindStatusStateTypeId, "Closing"); thing->setStateValue(venetianBlindClosingOutputStateTypeId, true); thing->setStateValue(venetianBlindOpeningOutputStateTypeId, false); thing->setStateValue(venetianBlindMovingStateTypeId, true); + m_extendedBlindPercentageTimer.value(thing)->start(); + m_venetianBlindAngleTimer.value(thing)->start(); break; case BlindStateStopped: thing->setStateValue(venetianBlindStatusStateTypeId, "Stopped"); thing->setStateValue(venetianBlindClosingOutputStateTypeId, false); thing->setStateValue(venetianBlindOpeningOutputStateTypeId, false); thing->setStateValue(venetianBlindMovingStateTypeId, false); + m_extendedBlindPercentageTimer.value(thing)->stop(); + m_venetianBlindAngleTimer.value(thing)->stop(); break; } } } -void IntegrationPluginGenericThings::setBlindMovingState(Action action, Thing *thing) -{ - if (thing->thingClassId() == extendedBlindThingClassId) { - int percentage = thing->stateValue(extendedBlindPercentageStateTypeId).toInt(); - if (action.actionTypeId() == extendedBlindOpenActionTypeId) { - if (percentage != 100) { - setBlindState(BlindStateOpening, thing); - } else { - // Blind already open - setBlindState(BlindStateStopped, thing); - } - } else if (action.actionTypeId() == extendedBlindStopActionTypeId) { - setBlindState(BlindStateStopped, thing); - thing->setStateValue(extendedBlindMovingStateTypeId, false); - - } else if (action.actionTypeId() == extendedBlindCloseActionTypeId) { - if (percentage != 0) { - setBlindState(BlindStateClosing, thing); - } else { - // Blind already closed - setBlindState(BlindStateStopped, thing); - thing->setStateValue(extendedBlindMovingStateTypeId, false); - } - } - - } else if (thing->thingClassId() == venetianBlindThingClassId) { - - } -} - void IntegrationPluginGenericThings::moveBlindToPercentage(Action action, Thing *thing) { if (thing->thingClassId() == extendedBlindThingClassId) { - int targetPercentage = action.param(extendedBlindPercentageActionPercentageParamTypeId).value().toBool(); - int currentPercentage = thing->stateValue(extendedBlindPercentageStateTypeId).toInt(); + uint targetPercentage = action.param(extendedBlindPercentageActionPercentageParamTypeId).value().toUInt(); + uint currentPercentage = thing->stateValue(extendedBlindPercentageStateTypeId).toUInt(); // 100% indicates the device is fully closed if (targetPercentage == currentPercentage) { - //Nothing to do + qCDebug(dcGenericThings()) << "Extended blind is already at given percentage" << targetPercentage; } else if (targetPercentage > currentPercentage) { setBlindState(BlindStateClosing, thing); m_extendedBlindTargetPercentage.insert(thing, targetPercentage); - m_extendedBlindPercentageTimer.value(thing)->start(); } else if (targetPercentage < currentPercentage) { setBlindState(BlindStateOpening, thing); m_extendedBlindTargetPercentage.insert(thing, targetPercentage); - m_extendedBlindPercentageTimer.value(thing)->start(); } else { setBlindState(BlindStateStopped, thing); } } else if (thing->thingClassId() == venetianBlindThingClassId) { - int targetPercentage = action.param(venetianBlindPercentageActionPercentageParamTypeId).value().toBool(); - int currentPercentage = thing->stateValue(venetianBlindPercentageStateTypeId).toInt(); + uint targetPercentage = action.param(venetianBlindPercentageActionPercentageParamTypeId).value().toUInt(); + uint currentPercentage = thing->stateValue(venetianBlindPercentageStateTypeId).toUInt(); + qCDebug(dcGenericThings()) << "Moving venetian blind to percentage" << targetPercentage << "Current percentage:" << currentPercentage; // 100% indicates the device is fully closed if (targetPercentage == currentPercentage) { - //Nothing to do + qCDebug(dcGenericThings()) << "Extended blind is already at given percentage" << targetPercentage; } else if (targetPercentage > currentPercentage) { setBlindState(BlindStateClosing, thing); m_extendedBlindTargetPercentage.insert(thing, targetPercentage); - m_extendedBlindPercentageTimer.value(thing)->start(); } else if (targetPercentage < currentPercentage) { setBlindState(BlindStateOpening, thing); m_extendedBlindTargetPercentage.insert(thing, targetPercentage); - m_extendedBlindPercentageTimer.value(thing)->start(); } else { setBlindState(BlindStateStopped, thing); } + } else { + qCDebug(dcGenericThings()) << "Move to percentage doesn't support this thingClass"; } } void IntegrationPluginGenericThings::moveBlindToAngle(Action action, Thing *thing) { - Q_UNUSED(action) - Q_UNUSED(thing) if (thing->thingClassId() == venetianBlindThingClassId) { if (action.actionTypeId() == venetianBlindAngleActionTypeId) { - + //NOTE moving percentage affects the angle but the angle doesnt affect the percentage + // opening -> -90 + // closing -> +90 + int targetAngle = action.param(venetianBlindAngleActionAngleParamTypeId).value().toInt(); + int currentAngle = thing->stateValue(venetianBlindAngleStateTypeId).toInt(); + if (targetAngle == currentAngle) { + qCDebug(dcGenericThings()) << "Venetian blind is already at given angle" << targetAngle; + } else if (targetAngle > currentAngle) { + setBlindState(BlindStateClosing, thing); + m_venetianBlindTargetAngle.insert(thing, targetAngle); + } else if (targetAngle < currentAngle) { + setBlindState(BlindStateOpening, thing); + m_venetianBlindTargetAngle.insert(thing, targetAngle); + } else { + setBlindState(BlindStateStopped, thing); + } } + } else { + qCDebug(dcGenericThings()) << "Move to angle doesn't support this thingClass"; } } diff --git a/genericthings/integrationplugingenericthings.h b/genericthings/integrationplugingenericthings.h index d4e5f98..a5fc34b 100644 --- a/genericthings/integrationplugingenericthings.h +++ b/genericthings/integrationplugingenericthings.h @@ -52,7 +52,8 @@ private: QHash m_extendedBlindPercentageTimer; QHash m_venetianBlindAngleTimer; - QHash m_extendedBlindTargetPercentage; + QHash m_extendedBlindTargetPercentage; + QHash m_venetianBlindTargetAngle; enum BlindState { BlindStateOpening, @@ -60,7 +61,6 @@ private: BlindStateStopped }; void setBlindState(BlindState state, Thing *thing); - void setBlindMovingState(Action action, Thing *thing); void moveBlindToPercentage(Action action, Thing *thing); void moveBlindToAngle(Action action, Thing *thing); }; diff --git a/genericthings/integrationplugingenericthings.json b/genericthings/integrationplugingenericthings.json index 846afd2..3c34c90 100644 --- a/genericthings/integrationplugingenericthings.json +++ b/genericthings/integrationplugingenericthings.json @@ -199,6 +199,7 @@ "minValue": 0, "maxValue": 100, "defaultValue": 0, + "unit": "Percentage", "writable": true } ], @@ -296,6 +297,7 @@ "minValue": 0, "maxValue": 100, "defaultValue": 0, + "unit": "Percentage", "writable": true }, { @@ -306,8 +308,8 @@ "displayNameAction": "Set angle", "type": "int", "unit": "Degree", - "minValue": "any", - "maxValue": "any", + "minValue": -90, + "maxValue": 90, "defaultValue": 0, "writable": true } diff --git a/genericthings/translations/b3188696-2585-4806-bf98-30ab576ce5c8-de.ts b/genericthings/translations/b3188696-2585-4806-bf98-30ab576ce5c8-de.ts index 9c98b7c..10f98ad 100644 --- a/genericthings/translations/b3188696-2585-4806-bf98-30ab576ce5c8-de.ts +++ b/genericthings/translations/b3188696-2585-4806-bf98-30ab576ce5c8-de.ts @@ -3,14 +3,46 @@ GenericThings + + Accuracy (decimal places) + The name of the ParamType (ThingClass: moistureSensor, Type: settings, ID: {3c967a68-9951-4c9a-b019-79b913e762b6}) +---------- +The name of the ParamType (ThingClass: humiditySensor, Type: settings, ID: {38064841-6121-4862-a639-08fb0b778511}) +---------- +The name of the ParamType (ThingClass: temperatureSensor, Type: settings, ID: {3b543c3a-1fc0-45b5-8c07-600a6045f82e}) + + + + Angle + The name of the ParamType (ThingClass: venetianBlind, ActionType: angle, ID: {fcb700c4-5da8-4385-85b0-6616e807974e}) +---------- +The name of the ParamType (ThingClass: venetianBlind, EventType: angle, ID: {fcb700c4-5da8-4385-85b0-6616e807974e}) +---------- +The name of the StateType ({fcb700c4-5da8-4385-85b0-6616e807974e}) of ThingClass venetianBlind + + + + Angle changed + The name of the EventType ({fcb700c4-5da8-4385-85b0-6616e807974e}) of ThingClass venetianBlind + + + + Angle end to end time [MilliSecond] + The name of the ParamType (ThingClass: venetianBlind, Type: thing, ID: {6c8340bf-7fd3-43e3-a75b-dfa2f6426e11}) + + Close The name of the ActionType ({cf5303f1-67c7-4cef-b11c-eb9de6fc8a87}) of ThingClass shutter ---------- +The name of the ActionType ({1c71f050-f6cb-4929-9c9d-7c262f77c143}) of ThingClass venetianBlind +---------- +The name of the ActionType ({97d6351d-7440-47f3-bdba-a31bb15368ac}) of ThingClass extendedBlind +---------- The name of the ActionType ({86e9cf21-7487-47c4-b4be-4a940d7235fb}) of ThingClass blind ---------- The name of the ActionType ({53b5ba77-9a34-4cd6-ad24-fb01fc465f98}) of ThingClass awning - Schließen + Closing output @@ -20,6 +52,18 @@ The name of the ParamType (ThingClass: shutter, EventType: closingOutput, ID: {1 ---------- The name of the StateType ({1c35df0e-4c41-455f-893a-0145377952a0}) of ThingClass shutter ---------- +The name of the ParamType (ThingClass: venetianBlind, ActionType: closingOutput, ID: {84dd2fa1-85fe-47f3-9e32-e6083432d39c}) +---------- +The name of the ParamType (ThingClass: venetianBlind, EventType: closingOutput, ID: {84dd2fa1-85fe-47f3-9e32-e6083432d39c}) +---------- +The name of the StateType ({84dd2fa1-85fe-47f3-9e32-e6083432d39c}) of ThingClass venetianBlind +---------- +The name of the ParamType (ThingClass: extendedBlind, ActionType: closingOutput, ID: {1a4a5839-a30d-4239-a124-63bfdc74a8f6}) +---------- +The name of the ParamType (ThingClass: extendedBlind, EventType: closingOutput, ID: {1a4a5839-a30d-4239-a124-63bfdc74a8f6}) +---------- +The name of the StateType ({1a4a5839-a30d-4239-a124-63bfdc74a8f6}) of ThingClass extendedBlind +---------- The name of the ParamType (ThingClass: blind, ActionType: closingOutput, ID: {9b673430-572d-4a9c-85d3-dafadbe541cd}) ---------- The name of the ParamType (ThingClass: blind, EventType: closingOutput, ID: {9b673430-572d-4a9c-85d3-dafadbe541cd}) @@ -31,117 +75,200 @@ The name of the ParamType (ThingClass: awning, ActionType: closingOutput, ID: {5 The name of the ParamType (ThingClass: awning, EventType: closingOutput, ID: {59bfd575-709f-4e43-9726-de26e6d4ca8b}) ---------- The name of the StateType ({59bfd575-709f-4e43-9726-de26e6d4ca8b}) of ThingClass awning - Schließender Ausgang + Closing output changed The name of the EventType ({1c35df0e-4c41-455f-893a-0145377952a0}) of ThingClass shutter ---------- +The name of the EventType ({84dd2fa1-85fe-47f3-9e32-e6083432d39c}) of ThingClass venetianBlind +---------- +The name of the EventType ({1a4a5839-a30d-4239-a124-63bfdc74a8f6}) of ThingClass extendedBlind +---------- The name of the EventType ({9b673430-572d-4a9c-85d3-dafadbe541cd}) of ThingClass blind ---------- The name of the EventType ({59bfd575-709f-4e43-9726-de26e6d4ca8b}) of ThingClass awning - Schließender Ausgang geändert + + + + Closing time [MilliSecond] + The name of the ParamType (ThingClass: venetianBlind, Type: thing, ID: {4c0bf07d-aaab-4f67-af65-00ceaefbaa84}) +---------- +The name of the ParamType (ThingClass: extendedBlind, Type: thing, ID: {27a95b8d-7f97-441b-a3be-0646c517cb06}) + Generic Things The name of the plugin GenericThings ({b3188696-2585-4806-bf98-30ab576ce5c8}) - Generische "Things" + Generic awning The name of the ThingClass ({9e69585f-90ba-44e4-ad90-5b4bffbe345a}) - Generische Markise + Generic blind The name of the ThingClass ({17ee3657-6ad8-4ae2-8959-3cf66cec8d13}) - Generischer Sichtschutz + + + + Generic extended blind + The name of the ThingClass ({40aa9f3c-a23c-4f7f-8786-fcf3554f3e19}) + Generic heating The name of the ThingClass ({392854c4-3d14-4cf8-96cd-d933526bd197}) - Generische Heizung + Generic humidity sensor The name of the ThingClass ({d295bc64-773c-42a9-83e2-80db5fa0d1ce}) - Generischer Feuchtigkeitssensor + + + + Generic irrigation + The name of the ThingClass ({d013b980-20d5-4791-9c4f-b411c39241d7}) + Generic light The name of the ThingClass ({c50d3216-f307-4f9f-8190-4391510c385c}) - Generisches Licht + Generic power socket The name of the ThingClass ({4e7261af-a27b-4446-8346-914ea59f7547}) - Generische Steckdose + Generic power switch The name of the ThingClass ({57daa147-dd6f-4673-a757-d8f01a2054c7}) - Generischer Ein-/Ausschalter + + + + Generic shutter + The name of the ThingClass ({7917c2e7-d7d2-4c47-a38d-41f7dd7693d9}) + Generic soil moisture sensor The name of the ThingClass ({33e610cf-ff30-481b-9f0b-d6857bcd41a5}) - Generischer Erdfeuchtigkeitssensor + Generic temperature sensor The name of the ThingClass ({cf3d65db-6f68-457b-968c-cfb66cbd5311}) - Generischer Temperatursensor + + + + Generic ventilation + The name of the ThingClass ({24af8dd3-ddf0-47f0-bf09-70fdfd8dceab}) + Humidity The name of the ParamType (ThingClass: humiditySensor, EventType: humidity, ID: {925225d9-2965-444a-9c42-63c2873700fb}) ---------- The name of the StateType ({925225d9-2965-444a-9c42-63c2873700fb}) of ThingClass humiditySensor - Luftfeuchtigkeit + Humidity changed The name of the EventType ({925225d9-2965-444a-9c42-63c2873700fb}) of ThingClass humiditySensor - Luftfeuchtigkeit geändert + + + + Input value + The name of the ParamType (ThingClass: moistureSensor, ActionType: input, ID: {ce64a425-d990-4fc1-966b-be6de445792b}) +---------- +The name of the ParamType (ThingClass: moistureSensor, EventType: input, ID: {ce64a425-d990-4fc1-966b-be6de445792b}) +---------- +The name of the StateType ({ce64a425-d990-4fc1-966b-be6de445792b}) of ThingClass moistureSensor +---------- +The name of the ParamType (ThingClass: humiditySensor, ActionType: input, ID: {a8223e65-e704-4f84-9bbe-d8fc42597047}) +---------- +The name of the ParamType (ThingClass: humiditySensor, EventType: input, ID: {a8223e65-e704-4f84-9bbe-d8fc42597047}) +---------- +The name of the StateType ({a8223e65-e704-4f84-9bbe-d8fc42597047}) of ThingClass humiditySensor +---------- +The name of the ParamType (ThingClass: temperatureSensor, ActionType: input, ID: {fed37466-1264-4ac1-84fd-aff3a1f7ff04}) +---------- +The name of the ParamType (ThingClass: temperatureSensor, EventType: input, ID: {fed37466-1264-4ac1-84fd-aff3a1f7ff04}) +---------- +The name of the StateType ({fed37466-1264-4ac1-84fd-aff3a1f7ff04}) of ThingClass temperatureSensor + + + + Input value changed + The name of the EventType ({ce64a425-d990-4fc1-966b-be6de445792b}) of ThingClass moistureSensor +---------- +The name of the EventType ({a8223e65-e704-4f84-9bbe-d8fc42597047}) of ThingClass humiditySensor +---------- +The name of the EventType ({fed37466-1264-4ac1-84fd-aff3a1f7ff04}) of ThingClass temperatureSensor + Maximum humidity The name of the ParamType (ThingClass: humiditySensor, Type: settings, ID: {10afc387-68d1-47ea-a816-0d1acad47b3c}) - Maximale Luftfeuchtigkeit + Maximum moisture The name of the ParamType (ThingClass: moistureSensor, Type: settings, ID: {3426817d-065e-4cfc-aa21-bb434de684d6}) - Maximale Feuchtigkeit + Maximum temperature The name of the ParamType (ThingClass: temperatureSensor, Type: settings, ID: {8b5947ab-127f-4995-853b-eeeb628811e3}) - Maximale Temperatur + Minimum humidity The name of the ParamType (ThingClass: humiditySensor, Type: settings, ID: {0218ffa9-3d49-4b25-a59f-c8831f190432}) - Minimale Luftfeuchtigkeit + Minimum moisture The name of the ParamType (ThingClass: moistureSensor, Type: settings, ID: {32153786-f1ae-4aa4-a84c-b9054102eb92}) - Minimale Feuchtigkeit + Minimum temperature The name of the ParamType (ThingClass: temperatureSensor, Type: settings, ID: {c86ae5d3-9335-4b6e-8231-bf3ed6670dff}) - Maximale Temperatur + + + + Moving + The name of the ParamType (ThingClass: venetianBlind, EventType: moving, ID: {6234c07e-4200-4f2c-8cbd-bff24c38c243}) +---------- +The name of the StateType ({6234c07e-4200-4f2c-8cbd-bff24c38c243}) of ThingClass venetianBlind +---------- +The name of the ParamType (ThingClass: extendedBlind, EventType: moving, ID: {941d1e1f-8dd7-4493-812f-6cefefd88c2e}) +---------- +The name of the StateType ({941d1e1f-8dd7-4493-812f-6cefefd88c2e}) of ThingClass extendedBlind + + + + Moving changed + The name of the EventType ({6234c07e-4200-4f2c-8cbd-bff24c38c243}) of ThingClass venetianBlind +---------- +The name of the EventType ({941d1e1f-8dd7-4493-812f-6cefefd88c2e}) of ThingClass extendedBlind + Open The name of the ActionType ({9deb662d-2378-4345-a898-8742d41e43c1}) of ThingClass shutter ---------- +The name of the ActionType ({3e728e50-3d45-4035-b215-1e604cf3159b}) of ThingClass venetianBlind +---------- +The name of the ActionType ({5a7599fa-8351-4ed6-9b98-fa2f3be54304}) of ThingClass extendedBlind +---------- The name of the ActionType ({120dc265-dbbb-4f19-9d31-c372c23479c0}) of ThingClass blind ---------- The name of the ActionType ({979e9c51-5a93-4635-85e3-01874306b229}) of ThingClass awning - Geöffnet + Opening output @@ -151,6 +278,18 @@ The name of the ParamType (ThingClass: shutter, EventType: openingOutput, ID: {c ---------- The name of the StateType ({cc547728-b309-4695-b355-49748ef2521c}) of ThingClass shutter ---------- +The name of the ParamType (ThingClass: venetianBlind, ActionType: openingOutput, ID: {6041dacf-5303-4dc0-ba3c-7ecaa438f2dd}) +---------- +The name of the ParamType (ThingClass: venetianBlind, EventType: openingOutput, ID: {6041dacf-5303-4dc0-ba3c-7ecaa438f2dd}) +---------- +The name of the StateType ({6041dacf-5303-4dc0-ba3c-7ecaa438f2dd}) of ThingClass venetianBlind +---------- +The name of the ParamType (ThingClass: extendedBlind, ActionType: openingOutput, ID: {e559f077-e904-4bbc-8ec3-344b814d2eab}) +---------- +The name of the ParamType (ThingClass: extendedBlind, EventType: openingOutput, ID: {e559f077-e904-4bbc-8ec3-344b814d2eab}) +---------- +The name of the StateType ({e559f077-e904-4bbc-8ec3-344b814d2eab}) of ThingClass extendedBlind +---------- The name of the ParamType (ThingClass: blind, ActionType: openingOutput, ID: {b2dbf25c-27e5-4f7e-a57d-2ef6d087fa2b}) ---------- The name of the ParamType (ThingClass: blind, EventType: openingOutput, ID: {b2dbf25c-27e5-4f7e-a57d-2ef6d087fa2b}) @@ -162,20 +301,52 @@ The name of the ParamType (ThingClass: awning, ActionType: openingOutput, ID: {4 The name of the ParamType (ThingClass: awning, EventType: openingOutput, ID: {4bb951a4-ea23-4cf0-9269-41d2c4eaf5a4}) ---------- The name of the StateType ({4bb951a4-ea23-4cf0-9269-41d2c4eaf5a4}) of ThingClass awning - Öffnender Ausgang + Opening output changed The name of the EventType ({cc547728-b309-4695-b355-49748ef2521c}) of ThingClass shutter ---------- +The name of the EventType ({6041dacf-5303-4dc0-ba3c-7ecaa438f2dd}) of ThingClass venetianBlind +---------- +The name of the EventType ({e559f077-e904-4bbc-8ec3-344b814d2eab}) of ThingClass extendedBlind +---------- The name of the EventType ({b2dbf25c-27e5-4f7e-a57d-2ef6d087fa2b}) of ThingClass blind ---------- The name of the EventType ({4bb951a4-ea23-4cf0-9269-41d2c4eaf5a4}) of ThingClass awning - Öffnender Ausgang geändert + + + + Percentage + The name of the ParamType (ThingClass: venetianBlind, ActionType: percentage, ID: {33dc8019-336d-4d50-8d60-dff8508338ca}) +---------- +The name of the ParamType (ThingClass: venetianBlind, EventType: percentage, ID: {33dc8019-336d-4d50-8d60-dff8508338ca}) +---------- +The name of the StateType ({33dc8019-336d-4d50-8d60-dff8508338ca}) of ThingClass venetianBlind +---------- +The name of the ParamType (ThingClass: extendedBlind, ActionType: percentage, ID: {181df603-d45f-4d3d-a358-97aa3e4ac0bd}) +---------- +The name of the ParamType (ThingClass: extendedBlind, EventType: percentage, ID: {181df603-d45f-4d3d-a358-97aa3e4ac0bd}) +---------- +The name of the StateType ({181df603-d45f-4d3d-a358-97aa3e4ac0bd}) of ThingClass extendedBlind + + + + Percentage changed + The name of the EventType ({33dc8019-336d-4d50-8d60-dff8508338ca}) of ThingClass venetianBlind +---------- +The name of the EventType ({181df603-d45f-4d3d-a358-97aa3e4ac0bd}) of ThingClass extendedBlind + Power - The name of the ParamType (ThingClass: irrigation, ActionType: power, ID: {0212a287-c5ae-4644-8803-adfdd8caeb9a}) + The name of the ParamType (ThingClass: ventilation, ActionType: power, ID: {846711b7-ea5a-4c66-a267-001c60406509}) +---------- +The name of the ParamType (ThingClass: ventilation, EventType: power, ID: {846711b7-ea5a-4c66-a267-001c60406509}) +---------- +The name of the StateType ({846711b7-ea5a-4c66-a267-001c60406509}) of ThingClass ventilation +---------- +The name of the ParamType (ThingClass: irrigation, ActionType: power, ID: {0212a287-c5ae-4644-8803-adfdd8caeb9a}) ---------- The name of the ParamType (ThingClass: irrigation, EventType: power, ID: {0212a287-c5ae-4644-8803-adfdd8caeb9a}) ---------- @@ -204,7 +375,7 @@ The name of the ParamType (ThingClass: socket, ActionType: power, ID: {018038d7- The name of the ParamType (ThingClass: socket, EventType: power, ID: {018038d7-1d02-4b17-8fe3-babca044b087}) ---------- The name of the StateType ({018038d7-1d02-4b17-8fe3-babca044b087}) of ThingClass socket - Einschalten + Power changed @@ -213,156 +384,35 @@ The name of the StateType ({018038d7-1d02-4b17-8fe3-babca044b087}) of ThingClass The name of the EventType ({8b6e4a67-6522-408b-b676-8d2f09ed2d54}) of ThingClass light ---------- The name of the EventType ({018038d7-1d02-4b17-8fe3-babca044b087}) of ThingClass socket - Ein- oder ausgeschaltet + Power on/off The name of the ActionType ({08087af6-6a3b-4e4a-ac6d-56f23ce63edf}) of ThingClass powerSwitch - Ein- oder ausschalten + Powered on/off The name of the EventType ({08087af6-6a3b-4e4a-ac6d-56f23ce63edf}) of ThingClass powerSwitch - Ein- oder ausgeschaltet + - Set power - The name of the ActionType ({409b635e-a754-4b5c-b3f0-d1c5a0fb3f03}) of ThingClass heating ----------- -The name of the ActionType ({8b6e4a67-6522-408b-b676-8d2f09ed2d54}) of ThingClass light ----------- -The name of the ActionType ({018038d7-1d02-4b17-8fe3-babca044b087}) of ThingClass socket - Ein- oder ausschalten - - - Soil moisture - The name of the ParamType (ThingClass: moistureSensor, EventType: moisture, ID: {7a62e1d2-92f2-424c-876c-870478a4b2bd}) ----------- -The name of the StateType ({7a62e1d2-92f2-424c-876c-870478a4b2bd}) of ThingClass moistureSensor - Feuchtigkeit - - - Soil moisture changed - The name of the EventType ({7a62e1d2-92f2-424c-876c-870478a4b2bd}) of ThingClass moistureSensor - Feuchtigkeit geändert - - - Status - The name of the ParamType (ThingClass: shutter, EventType: status, ID: {6d6e72dc-4d2b-4ec1-82c2-54405a682711}) ----------- -The name of the StateType ({6d6e72dc-4d2b-4ec1-82c2-54405a682711}) of ThingClass shutter ----------- -The name of the ParamType (ThingClass: blind, EventType: status, ID: {5fdec1e0-51f6-48b9-b743-ba572504b2c1}) ----------- -The name of the StateType ({5fdec1e0-51f6-48b9-b743-ba572504b2c1}) of ThingClass blind ----------- -The name of the ParamType (ThingClass: awning, EventType: status, ID: {ff6f2565-2a2e-4d34-b10f-d3f73b676399}) ----------- -The name of the StateType ({ff6f2565-2a2e-4d34-b10f-d3f73b676399}) of ThingClass awning - Zustand - - - Status changed - The name of the EventType ({6d6e72dc-4d2b-4ec1-82c2-54405a682711}) of ThingClass shutter ----------- -The name of the EventType ({5fdec1e0-51f6-48b9-b743-ba572504b2c1}) of ThingClass blind ----------- -The name of the EventType ({ff6f2565-2a2e-4d34-b10f-d3f73b676399}) of ThingClass awning - Zustand geändert - - - Stop - The name of the ActionType ({db5f3332-1f4e-4f9e-84d2-93c5d7de315c}) of ThingClass shutter ----------- -The name of the ActionType ({1a924c9a-5dcb-4b1c-8fd6-ab101098e007}) of ThingClass blind ----------- -The name of the ActionType ({555cafe4-bd12-42c6-bab1-8cd59af6468e}) of ThingClass awning - Stop - - - Temperature - The name of the ParamType (ThingClass: temperatureSensor, EventType: temperature, ID: {d0b6c4be-339e-4b0f-a234-0611b7565395}) ----------- -The name of the StateType ({d0b6c4be-339e-4b0f-a234-0611b7565395}) of ThingClass temperatureSensor - Temperatur - - - Temperature changed - The name of the EventType ({d0b6c4be-339e-4b0f-a234-0611b7565395}) of ThingClass temperatureSensor - Temperatur geändert - - - nymea - The name of the vendor ({2062d64d-3232-433c-88bc-0d33c0ba2ba6}) - nymea - - - Generic shutter - The name of the ThingClass ({7917c2e7-d7d2-4c47-a38d-41f7dd7693d9}) - Generischer Rolladen - - - Generic irrigation - The name of the ThingClass ({d013b980-20d5-4791-9c4f-b411c39241d7}) - Generische Bewässerung + Set angle + The name of the ActionType ({fcb700c4-5da8-4385-85b0-6616e807974e}) of ThingClass venetianBlind + Set closing output The name of the ActionType ({1c35df0e-4c41-455f-893a-0145377952a0}) of ThingClass shutter ---------- +The name of the ActionType ({84dd2fa1-85fe-47f3-9e32-e6083432d39c}) of ThingClass venetianBlind +---------- +The name of the ActionType ({1a4a5839-a30d-4239-a124-63bfdc74a8f6}) of ThingClass extendedBlind +---------- The name of the ActionType ({9b673430-572d-4a9c-85d3-dafadbe541cd}) of ThingClass blind ---------- The name of the ActionType ({59bfd575-709f-4e43-9726-de26e6d4ca8b}) of ThingClass awning - Setze schließenden Ausgang - - - Set opening output - The name of the ActionType ({cc547728-b309-4695-b355-49748ef2521c}) of ThingClass shutter ----------- -The name of the ActionType ({b2dbf25c-27e5-4f7e-a57d-2ef6d087fa2b}) of ThingClass blind ----------- -The name of the ActionType ({4bb951a4-ea23-4cf0-9269-41d2c4eaf5a4}) of ThingClass awning - Setze öffnenden Ausgang - - - Turn on or off - The name of the ActionType ({0212a287-c5ae-4644-8803-adfdd8caeb9a}) of ThingClass irrigation - Ein- oder ausschalten - - - Turned on or off - The name of the EventType ({0212a287-c5ae-4644-8803-adfdd8caeb9a}) of ThingClass irrigation - Ein- oder ausgeschaltet - - - Input value - The name of the ParamType (ThingClass: moistureSensor, ActionType: input, ID: {ce64a425-d990-4fc1-966b-be6de445792b}) ----------- -The name of the ParamType (ThingClass: moistureSensor, EventType: input, ID: {ce64a425-d990-4fc1-966b-be6de445792b}) ----------- -The name of the StateType ({ce64a425-d990-4fc1-966b-be6de445792b}) of ThingClass moistureSensor ----------- -The name of the ParamType (ThingClass: humiditySensor, ActionType: input, ID: {a8223e65-e704-4f84-9bbe-d8fc42597047}) ----------- -The name of the ParamType (ThingClass: humiditySensor, EventType: input, ID: {a8223e65-e704-4f84-9bbe-d8fc42597047}) ----------- -The name of the StateType ({a8223e65-e704-4f84-9bbe-d8fc42597047}) of ThingClass humiditySensor ----------- -The name of the ParamType (ThingClass: temperatureSensor, ActionType: input, ID: {fed37466-1264-4ac1-84fd-aff3a1f7ff04}) ----------- -The name of the ParamType (ThingClass: temperatureSensor, EventType: input, ID: {fed37466-1264-4ac1-84fd-aff3a1f7ff04}) ----------- -The name of the StateType ({fed37466-1264-4ac1-84fd-aff3a1f7ff04}) of ThingClass temperatureSensor - Eingangswert - - - Input value changed - The name of the EventType ({ce64a425-d990-4fc1-966b-be6de445792b}) of ThingClass moistureSensor ----------- -The name of the EventType ({a8223e65-e704-4f84-9bbe-d8fc42597047}) of ThingClass humiditySensor ----------- -The name of the EventType ({fed37466-1264-4ac1-84fd-aff3a1f7ff04}) of ThingClass temperatureSensor - Eingangswert geändert + Set input value @@ -371,16 +421,133 @@ The name of the EventType ({fed37466-1264-4ac1-84fd-aff3a1f7ff04}) of ThingClass The name of the ActionType ({a8223e65-e704-4f84-9bbe-d8fc42597047}) of ThingClass humiditySensor ---------- The name of the ActionType ({fed37466-1264-4ac1-84fd-aff3a1f7ff04}) of ThingClass temperatureSensor - Setze Eingangswert + - Accuracy (decimal places) - The name of the ParamType (ThingClass: moistureSensor, Type: settings, ID: {3c967a68-9951-4c9a-b019-79b913e762b6}) + Set opening output + The name of the ActionType ({cc547728-b309-4695-b355-49748ef2521c}) of ThingClass shutter ---------- -The name of the ParamType (ThingClass: humiditySensor, Type: settings, ID: {38064841-6121-4862-a639-08fb0b778511}) +The name of the ActionType ({6041dacf-5303-4dc0-ba3c-7ecaa438f2dd}) of ThingClass venetianBlind ---------- -The name of the ParamType (ThingClass: temperatureSensor, Type: settings, ID: {3b543c3a-1fc0-45b5-8c07-600a6045f82e}) - Genauigkeit (Nachkommastellen) +The name of the ActionType ({e559f077-e904-4bbc-8ec3-344b814d2eab}) of ThingClass extendedBlind +---------- +The name of the ActionType ({b2dbf25c-27e5-4f7e-a57d-2ef6d087fa2b}) of ThingClass blind +---------- +The name of the ActionType ({4bb951a4-ea23-4cf0-9269-41d2c4eaf5a4}) of ThingClass awning + + + + Set percentage + The name of the ActionType ({33dc8019-336d-4d50-8d60-dff8508338ca}) of ThingClass venetianBlind +---------- +The name of the ActionType ({181df603-d45f-4d3d-a358-97aa3e4ac0bd}) of ThingClass extendedBlind + + + + Set power + The name of the ActionType ({409b635e-a754-4b5c-b3f0-d1c5a0fb3f03}) of ThingClass heating +---------- +The name of the ActionType ({8b6e4a67-6522-408b-b676-8d2f09ed2d54}) of ThingClass light +---------- +The name of the ActionType ({018038d7-1d02-4b17-8fe3-babca044b087}) of ThingClass socket + + + + Soil moisture + The name of the ParamType (ThingClass: moistureSensor, EventType: moisture, ID: {7a62e1d2-92f2-424c-876c-870478a4b2bd}) +---------- +The name of the StateType ({7a62e1d2-92f2-424c-876c-870478a4b2bd}) of ThingClass moistureSensor + + + + Soil moisture changed + The name of the EventType ({7a62e1d2-92f2-424c-876c-870478a4b2bd}) of ThingClass moistureSensor + + + + Status + The name of the ParamType (ThingClass: shutter, EventType: status, ID: {6d6e72dc-4d2b-4ec1-82c2-54405a682711}) +---------- +The name of the StateType ({6d6e72dc-4d2b-4ec1-82c2-54405a682711}) of ThingClass shutter +---------- +The name of the ParamType (ThingClass: venetianBlind, EventType: status, ID: {6fb7826e-b6d8-42f8-b712-719496046436}) +---------- +The name of the StateType ({6fb7826e-b6d8-42f8-b712-719496046436}) of ThingClass venetianBlind +---------- +The name of the ParamType (ThingClass: extendedBlind, EventType: status, ID: {c2354d7e-198a-43ae-aa5f-c6710010c7e1}) +---------- +The name of the StateType ({c2354d7e-198a-43ae-aa5f-c6710010c7e1}) of ThingClass extendedBlind +---------- +The name of the ParamType (ThingClass: blind, EventType: status, ID: {5fdec1e0-51f6-48b9-b743-ba572504b2c1}) +---------- +The name of the StateType ({5fdec1e0-51f6-48b9-b743-ba572504b2c1}) of ThingClass blind +---------- +The name of the ParamType (ThingClass: awning, EventType: status, ID: {ff6f2565-2a2e-4d34-b10f-d3f73b676399}) +---------- +The name of the StateType ({ff6f2565-2a2e-4d34-b10f-d3f73b676399}) of ThingClass awning + + + + Status changed + The name of the EventType ({6d6e72dc-4d2b-4ec1-82c2-54405a682711}) of ThingClass shutter +---------- +The name of the EventType ({6fb7826e-b6d8-42f8-b712-719496046436}) of ThingClass venetianBlind +---------- +The name of the EventType ({c2354d7e-198a-43ae-aa5f-c6710010c7e1}) of ThingClass extendedBlind +---------- +The name of the EventType ({5fdec1e0-51f6-48b9-b743-ba572504b2c1}) of ThingClass blind +---------- +The name of the EventType ({ff6f2565-2a2e-4d34-b10f-d3f73b676399}) of ThingClass awning + + + + Stop + The name of the ActionType ({db5f3332-1f4e-4f9e-84d2-93c5d7de315c}) of ThingClass shutter +---------- +The name of the ActionType ({6e3eeb5d-d7ed-4175-9795-e76451e0a00b}) of ThingClass venetianBlind +---------- +The name of the ActionType ({ab67e4bf-c7b6-489b-9b49-3e0a1c7d33ca}) of ThingClass extendedBlind +---------- +The name of the ActionType ({1a924c9a-5dcb-4b1c-8fd6-ab101098e007}) of ThingClass blind +---------- +The name of the ActionType ({555cafe4-bd12-42c6-bab1-8cd59af6468e}) of ThingClass awning + + + + Temperature + The name of the ParamType (ThingClass: temperatureSensor, EventType: temperature, ID: {d0b6c4be-339e-4b0f-a234-0611b7565395}) +---------- +The name of the StateType ({d0b6c4be-339e-4b0f-a234-0611b7565395}) of ThingClass temperatureSensor + + + + Temperature changed + The name of the EventType ({d0b6c4be-339e-4b0f-a234-0611b7565395}) of ThingClass temperatureSensor + + + + Turn on or off + The name of the ActionType ({846711b7-ea5a-4c66-a267-001c60406509}) of ThingClass ventilation +---------- +The name of the ActionType ({0212a287-c5ae-4644-8803-adfdd8caeb9a}) of ThingClass irrigation + + + + Turned on or off + The name of the EventType ({846711b7-ea5a-4c66-a267-001c60406509}) of ThingClass ventilation +---------- +The name of the EventType ({0212a287-c5ae-4644-8803-adfdd8caeb9a}) of ThingClass irrigation + + + + Venetian blind + The name of the ThingClass ({e6b96ced-8d50-45da-91c8-792d364d2795}) + + + + nymea + The name of the vendor ({2062d64d-3232-433c-88bc-0d33c0ba2ba6}) + diff --git a/genericthings/translations/b3188696-2585-4806-bf98-30ab576ce5c8-en_US.ts b/genericthings/translations/b3188696-2585-4806-bf98-30ab576ce5c8-en_US.ts index 18005c2..0025225 100644 --- a/genericthings/translations/b3188696-2585-4806-bf98-30ab576ce5c8-en_US.ts +++ b/genericthings/translations/b3188696-2585-4806-bf98-30ab576ce5c8-en_US.ts @@ -3,10 +3,42 @@ GenericThings + + Accuracy (decimal places) + The name of the ParamType (ThingClass: moistureSensor, Type: settings, ID: {3c967a68-9951-4c9a-b019-79b913e762b6}) +---------- +The name of the ParamType (ThingClass: humiditySensor, Type: settings, ID: {38064841-6121-4862-a639-08fb0b778511}) +---------- +The name of the ParamType (ThingClass: temperatureSensor, Type: settings, ID: {3b543c3a-1fc0-45b5-8c07-600a6045f82e}) + + + + Angle + The name of the ParamType (ThingClass: venetianBlind, ActionType: angle, ID: {fcb700c4-5da8-4385-85b0-6616e807974e}) +---------- +The name of the ParamType (ThingClass: venetianBlind, EventType: angle, ID: {fcb700c4-5da8-4385-85b0-6616e807974e}) +---------- +The name of the StateType ({fcb700c4-5da8-4385-85b0-6616e807974e}) of ThingClass venetianBlind + + + + Angle changed + The name of the EventType ({fcb700c4-5da8-4385-85b0-6616e807974e}) of ThingClass venetianBlind + + + + Angle end to end time [MilliSecond] + The name of the ParamType (ThingClass: venetianBlind, Type: thing, ID: {6c8340bf-7fd3-43e3-a75b-dfa2f6426e11}) + + Close The name of the ActionType ({cf5303f1-67c7-4cef-b11c-eb9de6fc8a87}) of ThingClass shutter ---------- +The name of the ActionType ({1c71f050-f6cb-4929-9c9d-7c262f77c143}) of ThingClass venetianBlind +---------- +The name of the ActionType ({97d6351d-7440-47f3-bdba-a31bb15368ac}) of ThingClass extendedBlind +---------- The name of the ActionType ({86e9cf21-7487-47c4-b4be-4a940d7235fb}) of ThingClass blind ---------- The name of the ActionType ({53b5ba77-9a34-4cd6-ad24-fb01fc465f98}) of ThingClass awning @@ -20,6 +52,18 @@ The name of the ParamType (ThingClass: shutter, EventType: closingOutput, ID: {1 ---------- The name of the StateType ({1c35df0e-4c41-455f-893a-0145377952a0}) of ThingClass shutter ---------- +The name of the ParamType (ThingClass: venetianBlind, ActionType: closingOutput, ID: {84dd2fa1-85fe-47f3-9e32-e6083432d39c}) +---------- +The name of the ParamType (ThingClass: venetianBlind, EventType: closingOutput, ID: {84dd2fa1-85fe-47f3-9e32-e6083432d39c}) +---------- +The name of the StateType ({84dd2fa1-85fe-47f3-9e32-e6083432d39c}) of ThingClass venetianBlind +---------- +The name of the ParamType (ThingClass: extendedBlind, ActionType: closingOutput, ID: {1a4a5839-a30d-4239-a124-63bfdc74a8f6}) +---------- +The name of the ParamType (ThingClass: extendedBlind, EventType: closingOutput, ID: {1a4a5839-a30d-4239-a124-63bfdc74a8f6}) +---------- +The name of the StateType ({1a4a5839-a30d-4239-a124-63bfdc74a8f6}) of ThingClass extendedBlind +---------- The name of the ParamType (ThingClass: blind, ActionType: closingOutput, ID: {9b673430-572d-4a9c-85d3-dafadbe541cd}) ---------- The name of the ParamType (ThingClass: blind, EventType: closingOutput, ID: {9b673430-572d-4a9c-85d3-dafadbe541cd}) @@ -37,11 +81,22 @@ The name of the StateType ({59bfd575-709f-4e43-9726-de26e6d4ca8b}) of ThingClass Closing output changed The name of the EventType ({1c35df0e-4c41-455f-893a-0145377952a0}) of ThingClass shutter ---------- +The name of the EventType ({84dd2fa1-85fe-47f3-9e32-e6083432d39c}) of ThingClass venetianBlind +---------- +The name of the EventType ({1a4a5839-a30d-4239-a124-63bfdc74a8f6}) of ThingClass extendedBlind +---------- The name of the EventType ({9b673430-572d-4a9c-85d3-dafadbe541cd}) of ThingClass blind ---------- The name of the EventType ({59bfd575-709f-4e43-9726-de26e6d4ca8b}) of ThingClass awning + + Closing time [MilliSecond] + The name of the ParamType (ThingClass: venetianBlind, Type: thing, ID: {4c0bf07d-aaab-4f67-af65-00ceaefbaa84}) +---------- +The name of the ParamType (ThingClass: extendedBlind, Type: thing, ID: {27a95b8d-7f97-441b-a3be-0646c517cb06}) + + Generic Things The name of the plugin GenericThings ({b3188696-2585-4806-bf98-30ab576ce5c8}) @@ -57,6 +112,11 @@ The name of the EventType ({59bfd575-709f-4e43-9726-de26e6d4ca8b}) of ThingClass The name of the ThingClass ({17ee3657-6ad8-4ae2-8959-3cf66cec8d13}) + + Generic extended blind + The name of the ThingClass ({40aa9f3c-a23c-4f7f-8786-fcf3554f3e19}) + + Generic heating The name of the ThingClass ({392854c4-3d14-4cf8-96cd-d933526bd197}) @@ -67,6 +127,11 @@ The name of the EventType ({59bfd575-709f-4e43-9726-de26e6d4ca8b}) of ThingClass The name of the ThingClass ({d295bc64-773c-42a9-83e2-80db5fa0d1ce}) + + Generic irrigation + The name of the ThingClass ({d013b980-20d5-4791-9c4f-b411c39241d7}) + + Generic light The name of the ThingClass ({c50d3216-f307-4f9f-8190-4391510c385c}) @@ -82,6 +147,11 @@ The name of the EventType ({59bfd575-709f-4e43-9726-de26e6d4ca8b}) of ThingClass The name of the ThingClass ({57daa147-dd6f-4673-a757-d8f01a2054c7}) + + Generic shutter + The name of the ThingClass ({7917c2e7-d7d2-4c47-a38d-41f7dd7693d9}) + + Generic soil moisture sensor The name of the ThingClass ({33e610cf-ff30-481b-9f0b-d6857bcd41a5}) @@ -92,6 +162,11 @@ The name of the EventType ({59bfd575-709f-4e43-9726-de26e6d4ca8b}) of ThingClass The name of the ThingClass ({cf3d65db-6f68-457b-968c-cfb66cbd5311}) + + Generic ventilation + The name of the ThingClass ({24af8dd3-ddf0-47f0-bf09-70fdfd8dceab}) + + Humidity The name of the ParamType (ThingClass: humiditySensor, EventType: humidity, ID: {925225d9-2965-444a-9c42-63c2873700fb}) @@ -104,6 +179,36 @@ The name of the StateType ({925225d9-2965-444a-9c42-63c2873700fb}) of ThingClass The name of the EventType ({925225d9-2965-444a-9c42-63c2873700fb}) of ThingClass humiditySensor + + Input value + The name of the ParamType (ThingClass: moistureSensor, ActionType: input, ID: {ce64a425-d990-4fc1-966b-be6de445792b}) +---------- +The name of the ParamType (ThingClass: moistureSensor, EventType: input, ID: {ce64a425-d990-4fc1-966b-be6de445792b}) +---------- +The name of the StateType ({ce64a425-d990-4fc1-966b-be6de445792b}) of ThingClass moistureSensor +---------- +The name of the ParamType (ThingClass: humiditySensor, ActionType: input, ID: {a8223e65-e704-4f84-9bbe-d8fc42597047}) +---------- +The name of the ParamType (ThingClass: humiditySensor, EventType: input, ID: {a8223e65-e704-4f84-9bbe-d8fc42597047}) +---------- +The name of the StateType ({a8223e65-e704-4f84-9bbe-d8fc42597047}) of ThingClass humiditySensor +---------- +The name of the ParamType (ThingClass: temperatureSensor, ActionType: input, ID: {fed37466-1264-4ac1-84fd-aff3a1f7ff04}) +---------- +The name of the ParamType (ThingClass: temperatureSensor, EventType: input, ID: {fed37466-1264-4ac1-84fd-aff3a1f7ff04}) +---------- +The name of the StateType ({fed37466-1264-4ac1-84fd-aff3a1f7ff04}) of ThingClass temperatureSensor + + + + Input value changed + The name of the EventType ({ce64a425-d990-4fc1-966b-be6de445792b}) of ThingClass moistureSensor +---------- +The name of the EventType ({a8223e65-e704-4f84-9bbe-d8fc42597047}) of ThingClass humiditySensor +---------- +The name of the EventType ({fed37466-1264-4ac1-84fd-aff3a1f7ff04}) of ThingClass temperatureSensor + + Maximum humidity The name of the ParamType (ThingClass: humiditySensor, Type: settings, ID: {10afc387-68d1-47ea-a816-0d1acad47b3c}) @@ -134,10 +239,32 @@ The name of the StateType ({925225d9-2965-444a-9c42-63c2873700fb}) of ThingClass The name of the ParamType (ThingClass: temperatureSensor, Type: settings, ID: {c86ae5d3-9335-4b6e-8231-bf3ed6670dff}) + + Moving + The name of the ParamType (ThingClass: venetianBlind, EventType: moving, ID: {6234c07e-4200-4f2c-8cbd-bff24c38c243}) +---------- +The name of the StateType ({6234c07e-4200-4f2c-8cbd-bff24c38c243}) of ThingClass venetianBlind +---------- +The name of the ParamType (ThingClass: extendedBlind, EventType: moving, ID: {941d1e1f-8dd7-4493-812f-6cefefd88c2e}) +---------- +The name of the StateType ({941d1e1f-8dd7-4493-812f-6cefefd88c2e}) of ThingClass extendedBlind + + + + Moving changed + The name of the EventType ({6234c07e-4200-4f2c-8cbd-bff24c38c243}) of ThingClass venetianBlind +---------- +The name of the EventType ({941d1e1f-8dd7-4493-812f-6cefefd88c2e}) of ThingClass extendedBlind + + Open The name of the ActionType ({9deb662d-2378-4345-a898-8742d41e43c1}) of ThingClass shutter ---------- +The name of the ActionType ({3e728e50-3d45-4035-b215-1e604cf3159b}) of ThingClass venetianBlind +---------- +The name of the ActionType ({5a7599fa-8351-4ed6-9b98-fa2f3be54304}) of ThingClass extendedBlind +---------- The name of the ActionType ({120dc265-dbbb-4f19-9d31-c372c23479c0}) of ThingClass blind ---------- The name of the ActionType ({979e9c51-5a93-4635-85e3-01874306b229}) of ThingClass awning @@ -151,6 +278,18 @@ The name of the ParamType (ThingClass: shutter, EventType: openingOutput, ID: {c ---------- The name of the StateType ({cc547728-b309-4695-b355-49748ef2521c}) of ThingClass shutter ---------- +The name of the ParamType (ThingClass: venetianBlind, ActionType: openingOutput, ID: {6041dacf-5303-4dc0-ba3c-7ecaa438f2dd}) +---------- +The name of the ParamType (ThingClass: venetianBlind, EventType: openingOutput, ID: {6041dacf-5303-4dc0-ba3c-7ecaa438f2dd}) +---------- +The name of the StateType ({6041dacf-5303-4dc0-ba3c-7ecaa438f2dd}) of ThingClass venetianBlind +---------- +The name of the ParamType (ThingClass: extendedBlind, ActionType: openingOutput, ID: {e559f077-e904-4bbc-8ec3-344b814d2eab}) +---------- +The name of the ParamType (ThingClass: extendedBlind, EventType: openingOutput, ID: {e559f077-e904-4bbc-8ec3-344b814d2eab}) +---------- +The name of the StateType ({e559f077-e904-4bbc-8ec3-344b814d2eab}) of ThingClass extendedBlind +---------- The name of the ParamType (ThingClass: blind, ActionType: openingOutput, ID: {b2dbf25c-27e5-4f7e-a57d-2ef6d087fa2b}) ---------- The name of the ParamType (ThingClass: blind, EventType: openingOutput, ID: {b2dbf25c-27e5-4f7e-a57d-2ef6d087fa2b}) @@ -168,14 +307,46 @@ The name of the StateType ({4bb951a4-ea23-4cf0-9269-41d2c4eaf5a4}) of ThingClass Opening output changed The name of the EventType ({cc547728-b309-4695-b355-49748ef2521c}) of ThingClass shutter ---------- +The name of the EventType ({6041dacf-5303-4dc0-ba3c-7ecaa438f2dd}) of ThingClass venetianBlind +---------- +The name of the EventType ({e559f077-e904-4bbc-8ec3-344b814d2eab}) of ThingClass extendedBlind +---------- The name of the EventType ({b2dbf25c-27e5-4f7e-a57d-2ef6d087fa2b}) of ThingClass blind ---------- The name of the EventType ({4bb951a4-ea23-4cf0-9269-41d2c4eaf5a4}) of ThingClass awning + + Percentage + The name of the ParamType (ThingClass: venetianBlind, ActionType: percentage, ID: {33dc8019-336d-4d50-8d60-dff8508338ca}) +---------- +The name of the ParamType (ThingClass: venetianBlind, EventType: percentage, ID: {33dc8019-336d-4d50-8d60-dff8508338ca}) +---------- +The name of the StateType ({33dc8019-336d-4d50-8d60-dff8508338ca}) of ThingClass venetianBlind +---------- +The name of the ParamType (ThingClass: extendedBlind, ActionType: percentage, ID: {181df603-d45f-4d3d-a358-97aa3e4ac0bd}) +---------- +The name of the ParamType (ThingClass: extendedBlind, EventType: percentage, ID: {181df603-d45f-4d3d-a358-97aa3e4ac0bd}) +---------- +The name of the StateType ({181df603-d45f-4d3d-a358-97aa3e4ac0bd}) of ThingClass extendedBlind + + + + Percentage changed + The name of the EventType ({33dc8019-336d-4d50-8d60-dff8508338ca}) of ThingClass venetianBlind +---------- +The name of the EventType ({181df603-d45f-4d3d-a358-97aa3e4ac0bd}) of ThingClass extendedBlind + + Power - The name of the ParamType (ThingClass: irrigation, ActionType: power, ID: {0212a287-c5ae-4644-8803-adfdd8caeb9a}) + The name of the ParamType (ThingClass: ventilation, ActionType: power, ID: {846711b7-ea5a-4c66-a267-001c60406509}) +---------- +The name of the ParamType (ThingClass: ventilation, EventType: power, ID: {846711b7-ea5a-4c66-a267-001c60406509}) +---------- +The name of the StateType ({846711b7-ea5a-4c66-a267-001c60406509}) of ThingClass ventilation +---------- +The name of the ParamType (ThingClass: irrigation, ActionType: power, ID: {0212a287-c5ae-4644-8803-adfdd8caeb9a}) ---------- The name of the ParamType (ThingClass: irrigation, EventType: power, ID: {0212a287-c5ae-4644-8803-adfdd8caeb9a}) ---------- @@ -225,6 +396,53 @@ The name of the EventType ({018038d7-1d02-4b17-8fe3-babca044b087}) of ThingClass The name of the EventType ({08087af6-6a3b-4e4a-ac6d-56f23ce63edf}) of ThingClass powerSwitch + + Set angle + The name of the ActionType ({fcb700c4-5da8-4385-85b0-6616e807974e}) of ThingClass venetianBlind + + + + Set closing output + The name of the ActionType ({1c35df0e-4c41-455f-893a-0145377952a0}) of ThingClass shutter +---------- +The name of the ActionType ({84dd2fa1-85fe-47f3-9e32-e6083432d39c}) of ThingClass venetianBlind +---------- +The name of the ActionType ({1a4a5839-a30d-4239-a124-63bfdc74a8f6}) of ThingClass extendedBlind +---------- +The name of the ActionType ({9b673430-572d-4a9c-85d3-dafadbe541cd}) of ThingClass blind +---------- +The name of the ActionType ({59bfd575-709f-4e43-9726-de26e6d4ca8b}) of ThingClass awning + + + + Set input value + The name of the ActionType ({ce64a425-d990-4fc1-966b-be6de445792b}) of ThingClass moistureSensor +---------- +The name of the ActionType ({a8223e65-e704-4f84-9bbe-d8fc42597047}) of ThingClass humiditySensor +---------- +The name of the ActionType ({fed37466-1264-4ac1-84fd-aff3a1f7ff04}) of ThingClass temperatureSensor + + + + Set opening output + The name of the ActionType ({cc547728-b309-4695-b355-49748ef2521c}) of ThingClass shutter +---------- +The name of the ActionType ({6041dacf-5303-4dc0-ba3c-7ecaa438f2dd}) of ThingClass venetianBlind +---------- +The name of the ActionType ({e559f077-e904-4bbc-8ec3-344b814d2eab}) of ThingClass extendedBlind +---------- +The name of the ActionType ({b2dbf25c-27e5-4f7e-a57d-2ef6d087fa2b}) of ThingClass blind +---------- +The name of the ActionType ({4bb951a4-ea23-4cf0-9269-41d2c4eaf5a4}) of ThingClass awning + + + + Set percentage + The name of the ActionType ({33dc8019-336d-4d50-8d60-dff8508338ca}) of ThingClass venetianBlind +---------- +The name of the ActionType ({181df603-d45f-4d3d-a358-97aa3e4ac0bd}) of ThingClass extendedBlind + + Set power The name of the ActionType ({409b635e-a754-4b5c-b3f0-d1c5a0fb3f03}) of ThingClass heating @@ -252,6 +470,14 @@ The name of the StateType ({7a62e1d2-92f2-424c-876c-870478a4b2bd}) of ThingClass ---------- The name of the StateType ({6d6e72dc-4d2b-4ec1-82c2-54405a682711}) of ThingClass shutter ---------- +The name of the ParamType (ThingClass: venetianBlind, EventType: status, ID: {6fb7826e-b6d8-42f8-b712-719496046436}) +---------- +The name of the StateType ({6fb7826e-b6d8-42f8-b712-719496046436}) of ThingClass venetianBlind +---------- +The name of the ParamType (ThingClass: extendedBlind, EventType: status, ID: {c2354d7e-198a-43ae-aa5f-c6710010c7e1}) +---------- +The name of the StateType ({c2354d7e-198a-43ae-aa5f-c6710010c7e1}) of ThingClass extendedBlind +---------- The name of the ParamType (ThingClass: blind, EventType: status, ID: {5fdec1e0-51f6-48b9-b743-ba572504b2c1}) ---------- The name of the StateType ({5fdec1e0-51f6-48b9-b743-ba572504b2c1}) of ThingClass blind @@ -265,6 +491,10 @@ The name of the StateType ({ff6f2565-2a2e-4d34-b10f-d3f73b676399}) of ThingClass Status changed The name of the EventType ({6d6e72dc-4d2b-4ec1-82c2-54405a682711}) of ThingClass shutter ---------- +The name of the EventType ({6fb7826e-b6d8-42f8-b712-719496046436}) of ThingClass venetianBlind +---------- +The name of the EventType ({c2354d7e-198a-43ae-aa5f-c6710010c7e1}) of ThingClass extendedBlind +---------- The name of the EventType ({5fdec1e0-51f6-48b9-b743-ba572504b2c1}) of ThingClass blind ---------- The name of the EventType ({ff6f2565-2a2e-4d34-b10f-d3f73b676399}) of ThingClass awning @@ -274,6 +504,10 @@ The name of the EventType ({ff6f2565-2a2e-4d34-b10f-d3f73b676399}) of ThingClass Stop The name of the ActionType ({db5f3332-1f4e-4f9e-84d2-93c5d7de315c}) of ThingClass shutter ---------- +The name of the ActionType ({6e3eeb5d-d7ed-4175-9795-e76451e0a00b}) of ThingClass venetianBlind +---------- +The name of the ActionType ({ab67e4bf-c7b6-489b-9b49-3e0a1c7d33ca}) of ThingClass extendedBlind +---------- The name of the ActionType ({1a924c9a-5dcb-4b1c-8fd6-ab101098e007}) of ThingClass blind ---------- The name of the ActionType ({555cafe4-bd12-42c6-bab1-8cd59af6468e}) of ThingClass awning @@ -291,95 +525,28 @@ The name of the StateType ({d0b6c4be-339e-4b0f-a234-0611b7565395}) of ThingClass The name of the EventType ({d0b6c4be-339e-4b0f-a234-0611b7565395}) of ThingClass temperatureSensor - - nymea - The name of the vendor ({2062d64d-3232-433c-88bc-0d33c0ba2ba6}) - - - - Generic shutter - The name of the ThingClass ({7917c2e7-d7d2-4c47-a38d-41f7dd7693d9}) - - - - Generic irrigation - The name of the ThingClass ({d013b980-20d5-4791-9c4f-b411c39241d7}) - - - - Set closing output - The name of the ActionType ({1c35df0e-4c41-455f-893a-0145377952a0}) of ThingClass shutter ----------- -The name of the ActionType ({9b673430-572d-4a9c-85d3-dafadbe541cd}) of ThingClass blind ----------- -The name of the ActionType ({59bfd575-709f-4e43-9726-de26e6d4ca8b}) of ThingClass awning - - - - Set opening output - The name of the ActionType ({cc547728-b309-4695-b355-49748ef2521c}) of ThingClass shutter ----------- -The name of the ActionType ({b2dbf25c-27e5-4f7e-a57d-2ef6d087fa2b}) of ThingClass blind ----------- -The name of the ActionType ({4bb951a4-ea23-4cf0-9269-41d2c4eaf5a4}) of ThingClass awning - - Turn on or off - The name of the ActionType ({0212a287-c5ae-4644-8803-adfdd8caeb9a}) of ThingClass irrigation + The name of the ActionType ({846711b7-ea5a-4c66-a267-001c60406509}) of ThingClass ventilation +---------- +The name of the ActionType ({0212a287-c5ae-4644-8803-adfdd8caeb9a}) of ThingClass irrigation Turned on or off - The name of the EventType ({0212a287-c5ae-4644-8803-adfdd8caeb9a}) of ThingClass irrigation + The name of the EventType ({846711b7-ea5a-4c66-a267-001c60406509}) of ThingClass ventilation +---------- +The name of the EventType ({0212a287-c5ae-4644-8803-adfdd8caeb9a}) of ThingClass irrigation - Input value - The name of the ParamType (ThingClass: moistureSensor, ActionType: input, ID: {ce64a425-d990-4fc1-966b-be6de445792b}) ----------- -The name of the ParamType (ThingClass: moistureSensor, EventType: input, ID: {ce64a425-d990-4fc1-966b-be6de445792b}) ----------- -The name of the StateType ({ce64a425-d990-4fc1-966b-be6de445792b}) of ThingClass moistureSensor ----------- -The name of the ParamType (ThingClass: humiditySensor, ActionType: input, ID: {a8223e65-e704-4f84-9bbe-d8fc42597047}) ----------- -The name of the ParamType (ThingClass: humiditySensor, EventType: input, ID: {a8223e65-e704-4f84-9bbe-d8fc42597047}) ----------- -The name of the StateType ({a8223e65-e704-4f84-9bbe-d8fc42597047}) of ThingClass humiditySensor ----------- -The name of the ParamType (ThingClass: temperatureSensor, ActionType: input, ID: {fed37466-1264-4ac1-84fd-aff3a1f7ff04}) ----------- -The name of the ParamType (ThingClass: temperatureSensor, EventType: input, ID: {fed37466-1264-4ac1-84fd-aff3a1f7ff04}) ----------- -The name of the StateType ({fed37466-1264-4ac1-84fd-aff3a1f7ff04}) of ThingClass temperatureSensor + Venetian blind + The name of the ThingClass ({e6b96ced-8d50-45da-91c8-792d364d2795}) - Input value changed - The name of the EventType ({ce64a425-d990-4fc1-966b-be6de445792b}) of ThingClass moistureSensor ----------- -The name of the EventType ({a8223e65-e704-4f84-9bbe-d8fc42597047}) of ThingClass humiditySensor ----------- -The name of the EventType ({fed37466-1264-4ac1-84fd-aff3a1f7ff04}) of ThingClass temperatureSensor - - - - Set input value - The name of the ActionType ({ce64a425-d990-4fc1-966b-be6de445792b}) of ThingClass moistureSensor ----------- -The name of the ActionType ({a8223e65-e704-4f84-9bbe-d8fc42597047}) of ThingClass humiditySensor ----------- -The name of the ActionType ({fed37466-1264-4ac1-84fd-aff3a1f7ff04}) of ThingClass temperatureSensor - - - - Accuracy (decimal places) - The name of the ParamType (ThingClass: moistureSensor, Type: settings, ID: {3c967a68-9951-4c9a-b019-79b913e762b6}) ----------- -The name of the ParamType (ThingClass: humiditySensor, Type: settings, ID: {38064841-6121-4862-a639-08fb0b778511}) ----------- -The name of the ParamType (ThingClass: temperatureSensor, Type: settings, ID: {3b543c3a-1fc0-45b5-8c07-600a6045f82e}) + nymea + The name of the vendor ({2062d64d-3232-433c-88bc-0d33c0ba2ba6}) From 234bb155ffac2f703ce15b1dff97abf15a38eb5e Mon Sep 17 00:00:00 2001 From: "bernhard.trinnes" Date: Sat, 4 Jul 2020 13:24:32 +0200 Subject: [PATCH 5/9] added venetian blind angle logic --- .../integrationplugingenericthings.cpp | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/genericthings/integrationplugingenericthings.cpp b/genericthings/integrationplugingenericthings.cpp index 0e6a17e..feed4a1 100644 --- a/genericthings/integrationplugingenericthings.cpp +++ b/genericthings/integrationplugingenericthings.cpp @@ -113,15 +113,15 @@ void IntegrationPluginGenericThings::setupThing(ThingSetupInfo *info) qCWarning(dcGenericThings()) << "Venetian blind overshoot 100 percent"; } else { currentPercentage++; - thing->setStateValue(venetianBlindPercentageStateTypeId, currentPercentage); + thing->setStateValue(venetianBlindPercentageStateTypeId, currentPercentage); } } else if (thing->stateValue(venetianBlindStatusStateTypeId).toString() == "Opening") { - currentPercentage--; + if (currentPercentage == 0) { setBlindState(BlindStateStopped, thing); qCDebug(dcGenericThings()) << "Venetian blind is opened, stopping timer"; } else { - currentPercentage++; + currentPercentage--; thing->setStateValue(venetianBlindPercentageStateTypeId, currentPercentage); } } else { @@ -153,7 +153,7 @@ void IntegrationPluginGenericThings::setupThing(ThingSetupInfo *info) m_venetianBlindAngleTimer.value(thing)->stop(); qCWarning(dcGenericThings()) << "Venetian blind overshoot angle boundaries"; } - thing->setStateValue(venetianBlindPercentageStateTypeId, currentAngle); + thing->setStateValue(venetianBlindAngleStateTypeId, currentAngle); } else if (thing->stateValue(venetianBlindStatusStateTypeId).toString() == "Opening") { if (currentAngle > -90) { @@ -165,7 +165,7 @@ void IntegrationPluginGenericThings::setupThing(ThingSetupInfo *info) m_venetianBlindAngleTimer.value(thing)->stop(); qCWarning(dcGenericThings()) << "Venetian blind overshoot angle boundaries"; } - thing->setStateValue(venetianBlindPercentageStateTypeId, currentAngle); + thing->setStateValue(venetianBlindAngleStateTypeId, currentAngle); } if (m_venetianBlindTargetAngle.contains(thing)) { @@ -221,7 +221,7 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) } info->finish(Thing::ThingErrorNoError); } else { - Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } } else if (thing->thingClassId() == blindThingClassId ) { if (action.actionTypeId() == blindOpenActionTypeId) { @@ -370,28 +370,28 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) } info->finish(Thing::ThingErrorNoError); } else { - Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } } else if (thing->thingClassId() == socketThingClassId) { if (action.actionTypeId() == socketPowerActionTypeId) { thing->setStateValue(socketPowerStateTypeId, action.param(socketPowerActionPowerParamTypeId).value()); return info->finish(Thing::ThingErrorNoError); } else { - Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } } else if (thing->thingClassId() == lightThingClassId) { if (action.actionTypeId() == lightPowerActionTypeId) { thing->setStateValue(lightPowerStateTypeId, action.param(lightPowerActionPowerParamTypeId).value()); return info->finish(Thing::ThingErrorNoError); } else { - Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } } else if (thing->thingClassId() == heatingThingClassId) { if (action.actionTypeId() == heatingPowerActionTypeId) { thing->setStateValue(heatingPowerStateTypeId, action.param(heatingPowerActionPowerParamTypeId).value()); return info->finish(Thing::ThingErrorNoError); } else { - Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } } else if (thing->thingClassId() == powerSwitchThingClassId) { if (action.actionTypeId() == powerSwitchPowerActionTypeId) { @@ -399,7 +399,7 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) info->finish(Thing::ThingErrorNoError); return; } else { - Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } } else if (thing->thingClassId() == irrigationThingClassId) { if (action.actionTypeId() == irrigationPowerActionTypeId) { @@ -407,7 +407,7 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) info->finish(Thing::ThingErrorNoError); return; } else { - Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } } else if (thing->thingClassId() == ventilationThingClassId) { if (action.actionTypeId() == ventilationPowerActionTypeId) { @@ -415,7 +415,7 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) info->finish(Thing::ThingErrorNoError); return; } else { - Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } } else if (thing->thingClassId() == temperatureSensorThingClassId) { if (action.actionTypeId() == temperatureSensorInputActionTypeId) { @@ -430,7 +430,7 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) info->finish(Thing::ThingErrorNoError); return; } else { - Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } } else if (thing->thingClassId() == humiditySensorThingClassId) { if (action.actionTypeId() == humiditySensorInputActionTypeId) { @@ -445,7 +445,7 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) info->finish(Thing::ThingErrorNoError); return; } else { - Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } } else if (thing->thingClassId() == moistureSensorThingClassId) { if (action.actionTypeId() == moistureSensorInputActionTypeId) { @@ -460,7 +460,7 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) info->finish(Thing::ThingErrorNoError); return; } else { - Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } } else { Q_ASSERT_X(false, "setupThing", QString("Unhandled thingClassId: %1").arg(thing->thingClassId().toString()).toUtf8()); @@ -476,6 +476,7 @@ void IntegrationPluginGenericThings::thingRemoved(Thing *thing) m_extendedBlindPercentageTimer.take(thing)->deleteLater(); m_extendedBlindTargetPercentage.remove(thing); m_venetianBlindAngleTimer.take(thing)->deleteLater(); + m_venetianBlindTargetAngle.remove(thing); } } From 4726afbfa7874093379276a5cba8f887083bbcc4 Mon Sep 17 00:00:00 2001 From: "bernhard.trinnes" Date: Sat, 4 Jul 2020 13:35:46 +0200 Subject: [PATCH 6/9] added german translation --- ...b3188696-2585-4806-bf98-30ab576ce5c8-de.ts | 120 +++++++++--------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/genericthings/translations/b3188696-2585-4806-bf98-30ab576ce5c8-de.ts b/genericthings/translations/b3188696-2585-4806-bf98-30ab576ce5c8-de.ts index 10f98ad..e2076c9 100644 --- a/genericthings/translations/b3188696-2585-4806-bf98-30ab576ce5c8-de.ts +++ b/genericthings/translations/b3188696-2585-4806-bf98-30ab576ce5c8-de.ts @@ -10,7 +10,7 @@ The name of the ParamType (ThingClass: humiditySensor, Type: settings, ID: {38064841-6121-4862-a639-08fb0b778511}) ---------- The name of the ParamType (ThingClass: temperatureSensor, Type: settings, ID: {3b543c3a-1fc0-45b5-8c07-600a6045f82e}) - + Genauigkeit Angle @@ -19,17 +19,17 @@ The name of the ParamType (ThingClass: temperatureSensor, Type: settings, ID: {3 The name of the ParamType (ThingClass: venetianBlind, EventType: angle, ID: {fcb700c4-5da8-4385-85b0-6616e807974e}) ---------- The name of the StateType ({fcb700c4-5da8-4385-85b0-6616e807974e}) of ThingClass venetianBlind - + Winkel Angle changed The name of the EventType ({fcb700c4-5da8-4385-85b0-6616e807974e}) of ThingClass venetianBlind - + Winkel geändert Angle end to end time [MilliSecond] The name of the ParamType (ThingClass: venetianBlind, Type: thing, ID: {6c8340bf-7fd3-43e3-a75b-dfa2f6426e11}) - + End- zu Endwinkelzeit Close @@ -42,7 +42,7 @@ The name of the ActionType ({97d6351d-7440-47f3-bdba-a31bb15368ac}) of ThingClas The name of the ActionType ({86e9cf21-7487-47c4-b4be-4a940d7235fb}) of ThingClass blind ---------- The name of the ActionType ({53b5ba77-9a34-4cd6-ad24-fb01fc465f98}) of ThingClass awning - + Schließen Closing output @@ -75,7 +75,7 @@ The name of the ParamType (ThingClass: awning, ActionType: closingOutput, ID: {5 The name of the ParamType (ThingClass: awning, EventType: closingOutput, ID: {59bfd575-709f-4e43-9726-de26e6d4ca8b}) ---------- The name of the StateType ({59bfd575-709f-4e43-9726-de26e6d4ca8b}) of ThingClass awning - + Ausgang Schließen Closing output changed @@ -88,96 +88,96 @@ The name of the EventType ({1a4a5839-a30d-4239-a124-63bfdc74a8f6}) of ThingClass The name of the EventType ({9b673430-572d-4a9c-85d3-dafadbe541cd}) of ThingClass blind ---------- The name of the EventType ({59bfd575-709f-4e43-9726-de26e6d4ca8b}) of ThingClass awning - + Ausgang Schließen geändert Closing time [MilliSecond] The name of the ParamType (ThingClass: venetianBlind, Type: thing, ID: {4c0bf07d-aaab-4f67-af65-00ceaefbaa84}) ---------- The name of the ParamType (ThingClass: extendedBlind, Type: thing, ID: {27a95b8d-7f97-441b-a3be-0646c517cb06}) - + Schließdauer [Millisekunden] Generic Things The name of the plugin GenericThings ({b3188696-2585-4806-bf98-30ab576ce5c8}) - + Generische Dinge Generic awning The name of the ThingClass ({9e69585f-90ba-44e4-ad90-5b4bffbe345a}) - + Generische Markise Generic blind The name of the ThingClass ({17ee3657-6ad8-4ae2-8959-3cf66cec8d13}) - + Generische Beschattung Generic extended blind The name of the ThingClass ({40aa9f3c-a23c-4f7f-8786-fcf3554f3e19}) - + Generische erweiterte Beschattung Generic heating The name of the ThingClass ({392854c4-3d14-4cf8-96cd-d933526bd197}) - + Generische Heizung Generic humidity sensor The name of the ThingClass ({d295bc64-773c-42a9-83e2-80db5fa0d1ce}) - + Generischer Luftfeuchtigkeitssensor Generic irrigation The name of the ThingClass ({d013b980-20d5-4791-9c4f-b411c39241d7}) - + Generische Bewässerung Generic light The name of the ThingClass ({c50d3216-f307-4f9f-8190-4391510c385c}) - + Generisches Licht Generic power socket The name of the ThingClass ({4e7261af-a27b-4446-8346-914ea59f7547}) - + Generische Steckdose Generic power switch The name of the ThingClass ({57daa147-dd6f-4673-a757-d8f01a2054c7}) - + Generischer Schalter Generic shutter The name of the ThingClass ({7917c2e7-d7d2-4c47-a38d-41f7dd7693d9}) - + Gnerische Rollos Generic soil moisture sensor The name of the ThingClass ({33e610cf-ff30-481b-9f0b-d6857bcd41a5}) - + Gnerischer Erdbodenfeuchtesensor Generic temperature sensor The name of the ThingClass ({cf3d65db-6f68-457b-968c-cfb66cbd5311}) - + Gnerischer Temperaturesensor Generic ventilation The name of the ThingClass ({24af8dd3-ddf0-47f0-bf09-70fdfd8dceab}) - + Generische Lüftung Humidity The name of the ParamType (ThingClass: humiditySensor, EventType: humidity, ID: {925225d9-2965-444a-9c42-63c2873700fb}) ---------- The name of the StateType ({925225d9-2965-444a-9c42-63c2873700fb}) of ThingClass humiditySensor - + Luftfeuchte Humidity changed The name of the EventType ({925225d9-2965-444a-9c42-63c2873700fb}) of ThingClass humiditySensor - + Luftfeuchte geändert Input value @@ -198,7 +198,7 @@ The name of the ParamType (ThingClass: temperatureSensor, ActionType: input, ID: The name of the ParamType (ThingClass: temperatureSensor, EventType: input, ID: {fed37466-1264-4ac1-84fd-aff3a1f7ff04}) ---------- The name of the StateType ({fed37466-1264-4ac1-84fd-aff3a1f7ff04}) of ThingClass temperatureSensor - + Eingangswert Input value changed @@ -207,37 +207,37 @@ The name of the StateType ({fed37466-1264-4ac1-84fd-aff3a1f7ff04}) of ThingClass The name of the EventType ({a8223e65-e704-4f84-9bbe-d8fc42597047}) of ThingClass humiditySensor ---------- The name of the EventType ({fed37466-1264-4ac1-84fd-aff3a1f7ff04}) of ThingClass temperatureSensor - + Eingangswert geändert Maximum humidity The name of the ParamType (ThingClass: humiditySensor, Type: settings, ID: {10afc387-68d1-47ea-a816-0d1acad47b3c}) - + Maximale Luftfeuchte Maximum moisture The name of the ParamType (ThingClass: moistureSensor, Type: settings, ID: {3426817d-065e-4cfc-aa21-bb434de684d6}) - + Maximale Erdbodenfeuchte Maximum temperature The name of the ParamType (ThingClass: temperatureSensor, Type: settings, ID: {8b5947ab-127f-4995-853b-eeeb628811e3}) - + Maximale Temperatur Minimum humidity The name of the ParamType (ThingClass: humiditySensor, Type: settings, ID: {0218ffa9-3d49-4b25-a59f-c8831f190432}) - + Minimale Luftfeuchtigkeit Minimum moisture The name of the ParamType (ThingClass: moistureSensor, Type: settings, ID: {32153786-f1ae-4aa4-a84c-b9054102eb92}) - + Minimale Erdbodenfeuchte Minimum temperature The name of the ParamType (ThingClass: temperatureSensor, Type: settings, ID: {c86ae5d3-9335-4b6e-8231-bf3ed6670dff}) - + Minimale Temperatur Moving @@ -248,14 +248,14 @@ The name of the StateType ({6234c07e-4200-4f2c-8cbd-bff24c38c243}) of ThingClass The name of the ParamType (ThingClass: extendedBlind, EventType: moving, ID: {941d1e1f-8dd7-4493-812f-6cefefd88c2e}) ---------- The name of the StateType ({941d1e1f-8dd7-4493-812f-6cefefd88c2e}) of ThingClass extendedBlind - + Bewegung Moving changed The name of the EventType ({6234c07e-4200-4f2c-8cbd-bff24c38c243}) of ThingClass venetianBlind ---------- The name of the EventType ({941d1e1f-8dd7-4493-812f-6cefefd88c2e}) of ThingClass extendedBlind - + Bewegung geändert Open @@ -268,7 +268,7 @@ The name of the ActionType ({5a7599fa-8351-4ed6-9b98-fa2f3be54304}) of ThingClas The name of the ActionType ({120dc265-dbbb-4f19-9d31-c372c23479c0}) of ThingClass blind ---------- The name of the ActionType ({979e9c51-5a93-4635-85e3-01874306b229}) of ThingClass awning - + Opening output @@ -301,7 +301,7 @@ The name of the ParamType (ThingClass: awning, ActionType: openingOutput, ID: {4 The name of the ParamType (ThingClass: awning, EventType: openingOutput, ID: {4bb951a4-ea23-4cf0-9269-41d2c4eaf5a4}) ---------- The name of the StateType ({4bb951a4-ea23-4cf0-9269-41d2c4eaf5a4}) of ThingClass awning - + Öffungsausgang geändert Opening output changed @@ -314,7 +314,7 @@ The name of the EventType ({e559f077-e904-4bbc-8ec3-344b814d2eab}) of ThingClass The name of the EventType ({b2dbf25c-27e5-4f7e-a57d-2ef6d087fa2b}) of ThingClass blind ---------- The name of the EventType ({4bb951a4-ea23-4cf0-9269-41d2c4eaf5a4}) of ThingClass awning - + Öffnungsausgang geändert Percentage @@ -329,14 +329,14 @@ The name of the ParamType (ThingClass: extendedBlind, ActionType: percentage, ID The name of the ParamType (ThingClass: extendedBlind, EventType: percentage, ID: {181df603-d45f-4d3d-a358-97aa3e4ac0bd}) ---------- The name of the StateType ({181df603-d45f-4d3d-a358-97aa3e4ac0bd}) of ThingClass extendedBlind - + Prozent Percentage changed The name of the EventType ({33dc8019-336d-4d50-8d60-dff8508338ca}) of ThingClass venetianBlind ---------- The name of the EventType ({181df603-d45f-4d3d-a358-97aa3e4ac0bd}) of ThingClass extendedBlind - + Prozent geändert Power @@ -375,7 +375,7 @@ The name of the ParamType (ThingClass: socket, ActionType: power, ID: {018038d7- The name of the ParamType (ThingClass: socket, EventType: power, ID: {018038d7-1d02-4b17-8fe3-babca044b087}) ---------- The name of the StateType ({018038d7-1d02-4b17-8fe3-babca044b087}) of ThingClass socket - + Eingeschalten Power changed @@ -384,22 +384,22 @@ The name of the StateType ({018038d7-1d02-4b17-8fe3-babca044b087}) of ThingClass The name of the EventType ({8b6e4a67-6522-408b-b676-8d2f09ed2d54}) of ThingClass light ---------- The name of the EventType ({018038d7-1d02-4b17-8fe3-babca044b087}) of ThingClass socket - + Eingeschalten geändert Power on/off The name of the ActionType ({08087af6-6a3b-4e4a-ac6d-56f23ce63edf}) of ThingClass powerSwitch - + Eingeschalten Ein/Aus Powered on/off The name of the EventType ({08087af6-6a3b-4e4a-ac6d-56f23ce63edf}) of ThingClass powerSwitch - + Eingeschalten Ein/Aus Set angle The name of the ActionType ({fcb700c4-5da8-4385-85b0-6616e807974e}) of ThingClass venetianBlind - + Setzte Winkel Set closing output @@ -412,7 +412,7 @@ The name of the ActionType ({1a4a5839-a30d-4239-a124-63bfdc74a8f6}) of ThingClas The name of the ActionType ({9b673430-572d-4a9c-85d3-dafadbe541cd}) of ThingClass blind ---------- The name of the ActionType ({59bfd575-709f-4e43-9726-de26e6d4ca8b}) of ThingClass awning - + Setze Schließausgang Set input value @@ -421,7 +421,7 @@ The name of the ActionType ({59bfd575-709f-4e43-9726-de26e6d4ca8b}) of ThingClas The name of the ActionType ({a8223e65-e704-4f84-9bbe-d8fc42597047}) of ThingClass humiditySensor ---------- The name of the ActionType ({fed37466-1264-4ac1-84fd-aff3a1f7ff04}) of ThingClass temperatureSensor - + Setze Eingangswert Set opening output @@ -434,14 +434,14 @@ The name of the ActionType ({e559f077-e904-4bbc-8ec3-344b814d2eab}) of ThingClas The name of the ActionType ({b2dbf25c-27e5-4f7e-a57d-2ef6d087fa2b}) of ThingClass blind ---------- The name of the ActionType ({4bb951a4-ea23-4cf0-9269-41d2c4eaf5a4}) of ThingClass awning - + Setze Öffnungsausgang Set percentage The name of the ActionType ({33dc8019-336d-4d50-8d60-dff8508338ca}) of ThingClass venetianBlind ---------- The name of the ActionType ({181df603-d45f-4d3d-a358-97aa3e4ac0bd}) of ThingClass extendedBlind - + Setze Prozent Set power @@ -450,19 +450,19 @@ The name of the ActionType ({181df603-d45f-4d3d-a358-97aa3e4ac0bd}) of ThingClas The name of the ActionType ({8b6e4a67-6522-408b-b676-8d2f09ed2d54}) of ThingClass light ---------- The name of the ActionType ({018038d7-1d02-4b17-8fe3-babca044b087}) of ThingClass socket - + Setze Eingeschalten Soil moisture The name of the ParamType (ThingClass: moistureSensor, EventType: moisture, ID: {7a62e1d2-92f2-424c-876c-870478a4b2bd}) ---------- The name of the StateType ({7a62e1d2-92f2-424c-876c-870478a4b2bd}) of ThingClass moistureSensor - + Erdbodenfeuchte Soil moisture changed The name of the EventType ({7a62e1d2-92f2-424c-876c-870478a4b2bd}) of ThingClass moistureSensor - + Erdbodenfeuchte geändert Status @@ -485,7 +485,7 @@ The name of the StateType ({5fdec1e0-51f6-48b9-b743-ba572504b2c1}) of ThingClass The name of the ParamType (ThingClass: awning, EventType: status, ID: {ff6f2565-2a2e-4d34-b10f-d3f73b676399}) ---------- The name of the StateType ({ff6f2565-2a2e-4d34-b10f-d3f73b676399}) of ThingClass awning - + Status Status changed @@ -498,7 +498,7 @@ The name of the EventType ({c2354d7e-198a-43ae-aa5f-c6710010c7e1}) of ThingClass The name of the EventType ({5fdec1e0-51f6-48b9-b743-ba572504b2c1}) of ThingClass blind ---------- The name of the EventType ({ff6f2565-2a2e-4d34-b10f-d3f73b676399}) of ThingClass awning - + Status geändert Stop @@ -511,43 +511,43 @@ The name of the ActionType ({ab67e4bf-c7b6-489b-9b49-3e0a1c7d33ca}) of ThingClas The name of the ActionType ({1a924c9a-5dcb-4b1c-8fd6-ab101098e007}) of ThingClass blind ---------- The name of the ActionType ({555cafe4-bd12-42c6-bab1-8cd59af6468e}) of ThingClass awning - + Stop Temperature The name of the ParamType (ThingClass: temperatureSensor, EventType: temperature, ID: {d0b6c4be-339e-4b0f-a234-0611b7565395}) ---------- The name of the StateType ({d0b6c4be-339e-4b0f-a234-0611b7565395}) of ThingClass temperatureSensor - + Temperatur Temperature changed The name of the EventType ({d0b6c4be-339e-4b0f-a234-0611b7565395}) of ThingClass temperatureSensor - + Temperatur geändert Turn on or off The name of the ActionType ({846711b7-ea5a-4c66-a267-001c60406509}) of ThingClass ventilation ---------- The name of the ActionType ({0212a287-c5ae-4644-8803-adfdd8caeb9a}) of ThingClass irrigation - + Schalte ein oder aus Turned on or off The name of the EventType ({846711b7-ea5a-4c66-a267-001c60406509}) of ThingClass ventilation ---------- The name of the EventType ({0212a287-c5ae-4644-8803-adfdd8caeb9a}) of ThingClass irrigation - + Ein- oder Ausgeschalten Venetian blind The name of the ThingClass ({e6b96ced-8d50-45da-91c8-792d364d2795}) - + Jalousie nymea The name of the vendor ({2062d64d-3232-433c-88bc-0d33c0ba2ba6}) - + nymea From ac0c1e90bf7e87cf2d8f852d03289cee6e842a40 Mon Sep 17 00:00:00 2001 From: "bernhard.trinnes" Date: Thu, 9 Jul 2020 20:15:13 +0200 Subject: [PATCH 7/9] fixed remarks from review --- genericthings/integrationplugingenericthings.cpp | 12 ++++-------- genericthings/integrationplugingenericthings.json | 15 +++++++++------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/genericthings/integrationplugingenericthings.cpp b/genericthings/integrationplugingenericthings.cpp index feed4a1..04d5d5d 100644 --- a/genericthings/integrationplugingenericthings.cpp +++ b/genericthings/integrationplugingenericthings.cpp @@ -46,7 +46,7 @@ void IntegrationPluginGenericThings::setupThing(ThingSetupInfo *info) Thing *thing = info->thing(); if (thing->thingClassId() == extendedBlindThingClassId) { uint closingTime = thing->paramValue(extendedBlindThingClosingTimeParamTypeId).toUInt(); - if (closingTime <= 0) { + if (closingTime == 0) { return info->finish(Thing::ThingErrorSetupFailed, tr("Invalid closing time")); } QTimer* timer = new QTimer(this); @@ -60,10 +60,6 @@ void IntegrationPluginGenericThings::setupThing(ThingSetupInfo *info) if (currentPercentage == 100) { setBlindState(BlindStateStopped, thing); qCDebug(dcGenericThings()) << "Extended blind is closed, stopping timer"; - } else if (currentPercentage > 100) { - currentPercentage = 100; - setBlindState(BlindStateStopped, thing); - qCWarning(dcGenericThings()) << "Extended blind overshoot 100 percent"; } else { currentPercentage++; thing->setStateValue(extendedBlindPercentageStateTypeId, currentPercentage); @@ -99,7 +95,7 @@ void IntegrationPluginGenericThings::setupThing(ThingSetupInfo *info) timer->setInterval(closingTime/100.00); // closing timer / 100 to update on every percent m_extendedBlindPercentageTimer.insert(thing, timer); - connect(timer, &QTimer::timeout, this, [thing, this] { + connect(timer, &QTimer::timeout, thing, [thing, this] { uint currentPercentage = thing->stateValue(venetianBlindPercentageStateTypeId).toUInt(); if (thing->stateValue(venetianBlindStatusStateTypeId).toString() == "Closing") { @@ -140,7 +136,7 @@ void IntegrationPluginGenericThings::setupThing(ThingSetupInfo *info) QTimer* angleTimer = new QTimer(this); angleTimer->setInterval(angleTime/180.00); // -90 to 90 degree -> 180 degree total m_venetianBlindAngleTimer.insert(thing, angleTimer); - connect(angleTimer, &QTimer::timeout, this, [thing, this] { + connect(angleTimer, &QTimer::timeout, thing, [thing, this] { int currentAngle = thing->stateValue(venetianBlindAngleStateTypeId).toInt(); if (thing->stateValue(venetianBlindStatusStateTypeId).toString() == "Closing") { @@ -463,7 +459,7 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } } else { - Q_ASSERT_X(false, "setupThing", QString("Unhandled thingClassId: %1").arg(thing->thingClassId().toString()).toUtf8()); + Q_ASSERT_X(false, "executeAction", QString("Unhandled thingClassId: %1").arg(thing->thingClassId().toString()).toUtf8()); } } diff --git a/genericthings/integrationplugingenericthings.json b/genericthings/integrationplugingenericthings.json index 3c34c90..cc54042 100644 --- a/genericthings/integrationplugingenericthings.json +++ b/genericthings/integrationplugingenericthings.json @@ -141,8 +141,9 @@ "id": "27a95b8d-7f97-441b-a3be-0646c517cb06", "name": "closingTime", "displayName": "Closing time [MilliSecond]", - "type": "int", - "defaultValue": 0 + "type": "uint", + "minValue": 1, + "defaultValue": 5000 } ], "stateTypes": [ @@ -232,15 +233,17 @@ "id": "4c0bf07d-aaab-4f67-af65-00ceaefbaa84", "name": "closingTime", "displayName": "Closing time [MilliSecond]", - "type": "int", - "defaultValue": 0 + "minValue": 1, + "type": "uint", + "defaultValue": 5000 }, { "id": "6c8340bf-7fd3-43e3-a75b-dfa2f6426e11", "name": "angleTime", "displayName": "Angle end to end time [MilliSecond]", - "type": "int", - "defaultValue": 0 + "minValue": 1, + "type": "uint", + "defaultValue": 1000 } ], "stateTypes": [ From 1c2b690b6160db24865992024a966cb51803181d Mon Sep 17 00:00:00 2001 From: "bernhard.trinnes" Date: Thu, 9 Jul 2020 20:50:36 +0200 Subject: [PATCH 8/9] changed closing time from param to setting --- .../integrationplugingenericthings.cpp | 31 ++++++++++++++----- .../integrationplugingenericthings.h | 1 + .../integrationplugingenericthings.json | 4 +-- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/genericthings/integrationplugingenericthings.cpp b/genericthings/integrationplugingenericthings.cpp index 04d5d5d..b2cc342 100644 --- a/genericthings/integrationplugingenericthings.cpp +++ b/genericthings/integrationplugingenericthings.cpp @@ -40,18 +40,28 @@ IntegrationPluginGenericThings::IntegrationPluginGenericThings() } +void IntegrationPluginGenericThings::init() +{ + +} + void IntegrationPluginGenericThings::setupThing(ThingSetupInfo *info) { info->finish(Thing::ThingErrorNoError); Thing *thing = info->thing(); if (thing->thingClassId() == extendedBlindThingClassId) { - uint closingTime = thing->paramValue(extendedBlindThingClosingTimeParamTypeId).toUInt(); + uint closingTime = thing->setting(extendedBlindSettingsClosingTimeParamTypeId).toUInt(); if (closingTime == 0) { return info->finish(Thing::ThingErrorSetupFailed, tr("Invalid closing time")); } QTimer* timer = new QTimer(this); timer->setInterval(closingTime/100.00); // closing timer / 100 to update on every percent m_extendedBlindPercentageTimer.insert(thing, timer); + connect(thing, &Thing::settingChanged, thing, [timer] (const ParamTypeId ¶mTypeId, const QVariant &value) { + if (paramTypeId == extendedBlindSettingsClosingTimeParamTypeId) { + timer->setInterval(value.toUInt()/100.00); + } + }); connect(timer, &QTimer::timeout, this, [thing, this] { uint currentPercentage = thing->stateValue(extendedBlindPercentageStateTypeId).toUInt(); @@ -86,16 +96,16 @@ void IntegrationPluginGenericThings::setupThing(ThingSetupInfo *info) } }); } else if (info->thing()->thingClassId() == venetianBlindThingClassId) { - uint closingTime = thing->paramValue(venetianBlindThingClosingTimeParamTypeId).toUInt(); - uint angleTime = thing->paramValue(venetianBlindThingAngleTimeParamTypeId).toUInt(); + uint closingTime = thing->setting(venetianBlindSettingsClosingTimeParamTypeId).toUInt(); + uint angleTime = thing->setting(venetianBlindSettingsAngleTimeParamTypeId).toUInt(); if (closingTime <=0 || closingTime < angleTime || angleTime <= 0) { return info->finish(Thing::ThingErrorSetupFailed, tr("Invalid closing or angle time")); } - QTimer* timer = new QTimer(this); - timer->setInterval(closingTime/100.00); // closing timer / 100 to update on every percent - m_extendedBlindPercentageTimer.insert(thing, timer); + QTimer* closingTimer = new QTimer(this); + closingTimer->setInterval(closingTime/100.00); // closing timer / 100 to update on every percent + m_extendedBlindPercentageTimer.insert(thing, closingTimer); - connect(timer, &QTimer::timeout, thing, [thing, this] { + connect(closingTimer, &QTimer::timeout, thing, [thing, this] { uint currentPercentage = thing->stateValue(venetianBlindPercentageStateTypeId).toUInt(); if (thing->stateValue(venetianBlindStatusStateTypeId).toString() == "Closing") { @@ -136,6 +146,13 @@ void IntegrationPluginGenericThings::setupThing(ThingSetupInfo *info) QTimer* angleTimer = new QTimer(this); angleTimer->setInterval(angleTime/180.00); // -90 to 90 degree -> 180 degree total m_venetianBlindAngleTimer.insert(thing, angleTimer); + connect(thing, &Thing::settingChanged, thing, [closingTimer, angleTimer] (const ParamTypeId ¶mTypeId, const QVariant &value) { + if (paramTypeId == venetianBlindSettingsClosingTimeParamTypeId) { + closingTimer->setInterval(value.toUInt()/100.00); + } else if (paramTypeId == venetianBlindSettingsAngleTimeParamTypeId) { + angleTimer->setInterval(value.toUInt()/180.00); + } + }); connect(angleTimer, &QTimer::timeout, thing, [thing, this] { int currentAngle = thing->stateValue(venetianBlindAngleStateTypeId).toInt(); if (thing->stateValue(venetianBlindStatusStateTypeId).toString() == "Closing") { diff --git a/genericthings/integrationplugingenericthings.h b/genericthings/integrationplugingenericthings.h index a5fc34b..a98c466 100644 --- a/genericthings/integrationplugingenericthings.h +++ b/genericthings/integrationplugingenericthings.h @@ -43,6 +43,7 @@ class IntegrationPluginGenericThings: public IntegrationPlugin public: explicit IntegrationPluginGenericThings(); + void init() override; void setupThing(ThingSetupInfo *info) override; void executeAction(ThingActionInfo *info) override; void thingRemoved(Thing *thing) override; diff --git a/genericthings/integrationplugingenericthings.json b/genericthings/integrationplugingenericthings.json index cc54042..fc4cfec 100644 --- a/genericthings/integrationplugingenericthings.json +++ b/genericthings/integrationplugingenericthings.json @@ -136,7 +136,7 @@ "displayName": "Generic extended blind", "createMethods": ["user"], "interfaces": ["extendedblind"], - "paramTypes": [ + "settingsTypes": [ { "id": "27a95b8d-7f97-441b-a3be-0646c517cb06", "name": "closingTime", @@ -228,7 +228,7 @@ "displayName": "Venetian blind", "createMethods": ["user"], "interfaces": ["venetianblind"], - "paramTypes": [ + "settingsTypes": [ { "id": "4c0bf07d-aaab-4f67-af65-00ceaefbaa84", "name": "closingTime", From 8a301a76d4ff899c3a46339ff25794d7712ff2bb Mon Sep 17 00:00:00 2001 From: "bernhard.trinnes" Date: Thu, 9 Jul 2020 21:07:14 +0200 Subject: [PATCH 9/9] removed unnecessary checks --- genericthings/integrationplugingenericthings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genericthings/integrationplugingenericthings.cpp b/genericthings/integrationplugingenericthings.cpp index b2cc342..f224ee1 100644 --- a/genericthings/integrationplugingenericthings.cpp +++ b/genericthings/integrationplugingenericthings.cpp @@ -98,7 +98,7 @@ void IntegrationPluginGenericThings::setupThing(ThingSetupInfo *info) } else if (info->thing()->thingClassId() == venetianBlindThingClassId) { uint closingTime = thing->setting(venetianBlindSettingsClosingTimeParamTypeId).toUInt(); uint angleTime = thing->setting(venetianBlindSettingsAngleTimeParamTypeId).toUInt(); - if (closingTime <=0 || closingTime < angleTime || angleTime <= 0) { + if (closingTime < angleTime) { return info->finish(Thing::ThingErrorSetupFailed, tr("Invalid closing or angle time")); } QTimer* closingTimer = new QTimer(this);