From 2fe97975fef3e8107e2e76e7814247ba82b3cd81 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Fri, 31 Jul 2020 13:09:51 +0200 Subject: [PATCH 1/2] Shelly: Allow setting the roller shutter percentage --- shelly/integrationpluginshelly.cpp | 9 +++++++++ shelly/integrationpluginshelly.json | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/shelly/integrationpluginshelly.cpp b/shelly/integrationpluginshelly.cpp index 824ce060..4d0132cb 100644 --- a/shelly/integrationpluginshelly.cpp +++ b/shelly/integrationpluginshelly.cpp @@ -414,6 +414,15 @@ void IntegrationPluginShelly::executeAction(ThingActionInfo *info) return; } + if (action.actionTypeId() == shellyRollerPercentageActionTypeId) { + Thing *parentDevice = myThings().findById(thing->parentId()); + MqttChannel *channel = m_mqttChannels.value(parentDevice); + QString shellyId = parentDevice->paramValue(m_idParamTypeMap.value(parentDevice->thingClassId())).toString(); + channel->publish("shellies/" + shellyId + "/roller/0/command/pos", QByteArray::number(action.param(shellyRollerPercentageActionPercentageParamTypeId).value().toInt())); + info->finish(Thing::ThingErrorNoError); + return; + } + qCWarning(dcShelly()) << "Unhandled execute action call for device" << thing; } diff --git a/shelly/integrationpluginshelly.json b/shelly/integrationpluginshelly.json index 83160a1d..c0ffa023 100644 --- a/shelly/integrationpluginshelly.json +++ b/shelly/integrationpluginshelly.json @@ -901,8 +901,12 @@ "name": "percentage", "displayName": "Position", "displayNameEvent": "Position changed", + "displayNameAction": "Set position", "type": "int", - "defaultValue": 0 + "defaultValue": 0, + "minValue": 0, + "maxValue": 100, + "writable": true } ], "actionTypes": [ From 00c758c2abdad8155189fd14b3c4e276bffec1ad Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Fri, 31 Jul 2020 13:11:12 +0200 Subject: [PATCH 2/2] Update translations --- ...2773b-0435-408c-a4f8-7860d38031a9-en_US.ts | 467 +++++++++--------- 1 file changed, 238 insertions(+), 229 deletions(-) diff --git a/shelly/translations/6162773b-0435-408c-a4f8-7860d38031a9-en_US.ts b/shelly/translations/6162773b-0435-408c-a4f8-7860d38031a9-en_US.ts index c963e6c8..22aa103c 100644 --- a/shelly/translations/6162773b-0435-408c-a4f8-7860d38031a9-en_US.ts +++ b/shelly/translations/6162773b-0435-408c-a4f8-7860d38031a9-en_US.ts @@ -4,38 +4,38 @@ IntegrationPluginShelly - + Unable to find the thing in the network. - + Roller shutter mode can't be mixed with relay mode. Please configure both connected devices to control a shutter or relays. - - + + For using a roller shutter, one channel must be set to up, the other to down. - + Error creating MQTT channel. Please check MQTT server settings. - + Username and password not set correctly. - + Error connecting to Shelly device. - + Unexpected data received from Shelly device. @@ -43,12 +43,12 @@ shelly - - - - - - + + + + + + Brightness The name of the ParamType (ThingClass: shellyDimmer, ActionType: brightness, ID: {f41c93ac-6911-45fc-9221-7dd26bf65fd0}) ---------- @@ -64,8 +64,8 @@ The name of the StateType ({3f74eb92-d95b-48c2-8ac6-29bea9f65ce3}) of ThingClass - - + + Brightness changed The name of the EventType ({f41c93ac-6911-45fc-9221-7dd26bf65fd0}) of ThingClass shellyDimmer ---------- @@ -73,26 +73,26 @@ The name of the EventType ({3f74eb92-d95b-48c2-8ac6-29bea9f65ce3}) of ThingClass - + Button type The name of the ParamType (ThingClass: shellySwitch, Type: settings, ID: {ce9f1650-5e12-40f4-97de-27af86afa40b}) - + Calibrate The name of the ActionType ({4e2d8a7b-821e-4ee8-9f9b-f774d631845f}) of ThingClass shellyRoller - - - - - - - - + + + + + + + + Channel The name of the ParamType (ThingClass: shellyRoller, Type: thing, ID: {281385a5-5084-4ded-80a4-66c0dc1096a8}) ---------- @@ -112,15 +112,15 @@ The name of the ParamType (ThingClass: shellySwitch, Type: thing, ID: {be6bdd43- - + Close The name of the ActionType ({87eb0290-615e-4c98-9ec8-a21104fcf05d}) of ThingClass shellyRoller - - - + + + Color The name of the ParamType (ThingClass: shellyRgbw2, ActionType: color, ID: {6ef7c686-350d-4069-9c41-9b90b3906748}) ---------- @@ -130,15 +130,15 @@ The name of the StateType ({6ef7c686-350d-4069-9c41-9b90b3906748}) of ThingClass - + Color changed The name of the EventType ({6ef7c686-350d-4069-9c41-9b90b3906748}) of ThingClass shellyRgbw2 - - - + + + Color temperature The name of the ParamType (ThingClass: shellyRgbw2, ActionType: colorTemperature, ID: {a32a457f-fdc0-46ce-9106-6f9d4f4a6b16}) ---------- @@ -148,40 +148,40 @@ The name of the StateType ({a32a457f-fdc0-46ce-9106-6f9d4f4a6b16}) of ThingClass - + Color temperature changed The name of the EventType ({a32a457f-fdc0-46ce-9106-6f9d4f4a6b16}) of ThingClass shellyRgbw2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + Connected The name of the ParamType (ThingClass: shellyRoller, EventType: connected, ID: {d446719d-628e-477d-882c-a84210c85869}) ---------- @@ -241,10 +241,10 @@ The name of the StateType ({e5d41e05-2296-457e-97d8-98a5ac0de615}) of ThingClass - - - - + + + + Connected changed The name of the EventType ({584b3558-5fb5-40a9-81ad-dc71ba68fd45}) of ThingClass shellyPlug ---------- @@ -256,9 +256,9 @@ The name of the EventType ({e5d41e05-2296-457e-97d8-98a5ac0de615}) of ThingClass - - - + + + Connected device The name of the ParamType (ThingClass: shellyPlug, Type: thing, ID: {9686b1ca-e71f-4e62-beb0-6a20f21550e9}) ---------- @@ -268,26 +268,26 @@ The name of the ParamType (ThingClass: shelly1, Type: thing, ID: {d0e0499e-faa0- - + Connected device 1 The name of the ParamType (ThingClass: shelly25, Type: thing, ID: {dc8a02fb-baa4-40bf-9e00-684b17794287}) - + Connected device 2 The name of the ParamType (ThingClass: shelly25, Type: thing, ID: {1e6925f8-1613-4fe4-8234-e4a4e973ef83}) - - - - - - - - + + + + + + + + Connected or disconnected The name of the EventType ({d446719d-628e-477d-882c-a84210c85869}) of ThingClass shellyRoller ---------- @@ -307,8 +307,8 @@ The name of the EventType ({0c233312-7b8f-4ca3-880d-523cab9b3ccb}) of ThingClass - - + + Connected/disconnected The name of the EventType ({49ff0891-1798-459f-a97c-f1cc4e643a46}) of ThingClass shellyDimmer ---------- @@ -316,24 +316,24 @@ The name of the EventType ({98b6e1ba-8d5c-4cb1-82a0-2d06c71cdba6}) of ThingClass - + Consumed energy changed The name of the EventType ({962fec29-6be0-452e-87c5-5ff71435c40f}) of ThingClass shellyPlug - - - - - - - - - - - - + + + + + + + + + + + + Current power consumption The name of the ParamType (ThingClass: shellyRoller, EventType: currentPower, ID: {0d7cb1cf-3fff-4d0b-96c2-c02e9a92af57}) ---------- @@ -361,8 +361,8 @@ The name of the StateType ({82ce0c4f-cb81-43c7-bc07-003f8a3cfbc8}) of ThingClass - - + + Current power consumption changed The name of the EventType ({b3336ca6-1577-4230-8708-98875148606e}) of ThingClass shellyDimmer ---------- @@ -370,13 +370,13 @@ The name of the EventType ({82ce0c4f-cb81-43c7-bc07-003f8a3cfbc8}) of ThingClass - - - - - - - + + + + + + + Default state The name of the ParamType (ThingClass: shellySocketPM, Type: settings, ID: {9880a51b-57da-4b65-a0ec-23eb0fdcb8ac}) ---------- @@ -394,14 +394,14 @@ The name of the ParamType (ThingClass: shellyPlug, Type: settings, ID: {40f251db - + Invert button The name of the ParamType (ThingClass: shellySwitch, Type: settings, ID: {f31eb52b-9aaf-409d-8bba-badda7c1a249}) - - + + Moving The name of the ParamType (ThingClass: shellyRoller, EventType: moving, ID: {2729d4e0-c38c-47b8-a0e8-26959090fe74}) ---------- @@ -409,18 +409,18 @@ The name of the StateType ({2729d4e0-c38c-47b8-a0e8-26959090fe74}) of ThingClass - + Moving changed The name of the EventType ({2729d4e0-c38c-47b8-a0e8-26959090fe74}) of ThingClass shellyRoller - - - - - - + + + + + + On The name of the ParamType (ThingClass: shellyDimmer, ActionType: power, ID: {e4a6ac87-31fb-4516-9cf3-f135621e902c}) ---------- @@ -436,8 +436,8 @@ The name of the StateType ({14abcd30-9db2-4065-ae81-501a55fbb145}) of ThingClass - - + + On/Off The name of the ParamType (ThingClass: shellySwitch, EventType: power, ID: {20f74d88-0683-4d3a-9513-6b29b5112b7b}) ---------- @@ -445,24 +445,24 @@ The name of the StateType ({20f74d88-0683-4d3a-9513-6b29b5112b7b}) of ThingClass - + On/Off toggled The name of the EventType ({20f74d88-0683-4d3a-9513-6b29b5112b7b}) of ThingClass shellySwitch - + Open The name of the ActionType ({b96a8f85-c39e-499b-abbd-40b18788e907}) of ThingClass shellyRoller - - - - - - + + + + + + Password (optional) The name of the ParamType (ThingClass: shellyDimmer, Type: thing, ID: {b181bf78-a19c-4f97-9264-f16fbac64ee2}) ---------- @@ -478,39 +478,42 @@ The name of the ParamType (ThingClass: shelly1, Type: thing, ID: {d29b8399-bfa6- - - + + + Position - The name of the ParamType (ThingClass: shellyRoller, EventType: percentage, ID: {86270b8b-bce4-4d8a-9bc9-d72af36b991c}) + The name of the ParamType (ThingClass: shellyRoller, ActionType: percentage, ID: {86270b8b-bce4-4d8a-9bc9-d72af36b991c}) +---------- +The name of the ParamType (ThingClass: shellyRoller, EventType: percentage, ID: {86270b8b-bce4-4d8a-9bc9-d72af36b991c}) ---------- The name of the StateType ({86270b8b-bce4-4d8a-9bc9-d72af36b991c}) of ThingClass shellyRoller - + Position changed The name of the EventType ({86270b8b-bce4-4d8a-9bc9-d72af36b991c}) of ThingClass shellyRoller - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + Power The name of the ParamType (ThingClass: shellySocketPM, ActionType: power, ID: {d6adeab6-c91d-44ba-8d01-9b5b9b7368be}) ---------- @@ -550,8 +553,8 @@ The name of the StateType ({72d7dbba-757c-4b03-a092-1d3f374fa961}) of ThingClass - - + + Power consumption The name of the ParamType (ThingClass: shellyPlug, EventType: currentPower, ID: {202ea409-650e-48b2-9aae-d4ebe9d505fd}) ---------- @@ -559,11 +562,11 @@ The name of the StateType ({202ea409-650e-48b2-9aae-d4ebe9d505fd}) of ThingClass - - - - - + + + + + Power consumption changed The name of the EventType ({0d7cb1cf-3fff-4d0b-96c2-c02e9a92af57}) of ThingClass shellyRoller ---------- @@ -577,9 +580,9 @@ The name of the EventType ({202ea409-650e-48b2-9aae-d4ebe9d505fd}) of ThingClass - - - + + + Powered The name of the ParamType (ThingClass: shellyPlug, ActionType: power, ID: {d813b35f-e11e-4783-b3b3-dbecb956ffb5}) ---------- @@ -589,18 +592,18 @@ The name of the StateType ({d813b35f-e11e-4783-b3b3-dbecb956ffb5}) of ThingClass - + Pressed The name of the EventType ({41498655-1943-4b46-ac36-adea7bafab87}) of ThingClass shellySwitch - - - - - - + + + + + + Reboot The name of the ActionType ({dca1d1bb-b377-41b8-ac26-579060448fd7}) of ThingClass shellyDimmer ---------- @@ -616,8 +619,8 @@ The name of the ActionType ({b4067d54-36c5-4d30-bbc3-c8c712d6fd32}) of ThingClas - - + + Set brightness The name of the ActionType ({f41c93ac-6911-45fc-9221-7dd26bf65fd0}) of ThingClass shellyDimmer ---------- @@ -625,20 +628,26 @@ The name of the ActionType ({3f74eb92-d95b-48c2-8ac6-29bea9f65ce3}) of ThingClas - + Set color The name of the ActionType ({6ef7c686-350d-4069-9c41-9b90b3906748}) of ThingClass shellyRgbw2 - + Set color temperature The name of the ActionType ({a32a457f-fdc0-46ce-9106-6f9d4f4a6b16}) of ThingClass shellyRgbw2 - - + + Set position + The name of the ActionType ({86270b8b-bce4-4d8a-9bc9-d72af36b991c}) of ThingClass shellyRoller + + + + + Shelly The name of the vendor ({d8e45fc2-90af-492e-8305-50baa1ec4c18}) ---------- @@ -646,36 +655,36 @@ The name of the plugin shelly ({6162773b-0435-408c-a4f8-7860d38031a9}) - + Shelly 1 The name of the ThingClass ({f810b66a-7177-4397-9771-4229abaabbb6}) - + Shelly 1PM The name of the ThingClass ({30e74e9f-57f4-4bbc-b0df-f2c4f28b2f06}) - + Shelly 2.5 The name of the ThingClass ({465efb0d-da68-4177-a040-940c7f451e29}) - - Shelly Dimmer / Dimmer 2 + + Shelly Dimmer The name of the ThingClass ({3a1d6fc1-c623-4b45-9c81-1573fcc15f99}) - - - - - - + + + + + + Shelly ID The name of the ParamType (ThingClass: shellyDimmer, Type: thing, ID: {32e328be-2357-4d94-b438-3fe1ae94d97b}) ---------- @@ -691,26 +700,26 @@ The name of the ParamType (ThingClass: shelly1, Type: thing, ID: {1d301dc0-5e48- - + Shelly Plug/PlugS The name of the ThingClass ({22229a6d-2af8-44e0-bea9-310a0f2769ef}) - + Shelly RGBW2 The name of the ThingClass ({17f24cec-e6ed-4abd-9d42-60999f391dba}) - + Shelly connected Roller Shutter The name of the ThingClass ({d681a4cb-481a-4469-a49a-e6bbb11eb9c9}) - - + + Shelly connected device The name of the ThingClass ({3bd614e0-72c4-4fbe-8c70-ce6c48d04bce}) ---------- @@ -718,8 +727,8 @@ The name of the ThingClass ({512c3c7d-d6a6-4d2a-bccd-83147e5f9a25}) - - + + Shelly connected light The name of the ThingClass ({5ab05c19-71aa-4a85-a02f-a108f039a69a}) ---------- @@ -727,8 +736,8 @@ The name of the ThingClass ({62a2d6b8-d70d-45fc-ba8c-1c680282a399}) - - + + Shelly connected power socket The name of the ThingClass ({ae6e55fe-1a0b-43bc-bdfb-605661b96905}) ---------- @@ -736,16 +745,16 @@ The name of the ThingClass ({3e13206c-a6cd-49a0-b653-2ccb5bb4bbc1}) - + Shelly switch The name of the ThingClass ({6de35a17-0f54-4397-894d-4321b64c53d1}) - - - - + + + + Total energy changed The name of the EventType ({a7d88654-7503-474d-9a7c-02150d61a6dc}) of ThingClass shellyRoller ---------- @@ -757,16 +766,16 @@ The name of the EventType ({54b0b02e-1dfe-4172-bdfd-8129709e5d9f}) of ThingClass - - - - - - - - - - + + + + + + + + + + Total energy consumed The name of the ParamType (ThingClass: shellyRoller, EventType: totalEnergyConsumed, ID: {a7d88654-7503-474d-9a7c-02150d61a6dc}) ---------- @@ -790,15 +799,15 @@ The name of the StateType ({962fec29-6be0-452e-87c5-5ff71435c40f}) of ThingClass - - - - - - - - - + + + + + + + + + Turn on or off The name of the ActionType ({d6adeab6-c91d-44ba-8d01-9b5b9b7368be}) of ThingClass shellySocketPM ---------- @@ -820,15 +829,15 @@ The name of the ActionType ({d813b35f-e11e-4783-b3b3-dbecb956ffb5}) of ThingClas - - - - - - - - - + + + + + + + + + Turned on or off The name of the EventType ({d6adeab6-c91d-44ba-8d01-9b5b9b7368be}) of ThingClass shellySocketPM ---------- @@ -850,12 +859,12 @@ The name of the EventType ({d813b35f-e11e-4783-b3b3-dbecb956ffb5}) of ThingClass - - - - - - + + + + + + Username (optional) The name of the ParamType (ThingClass: shellyDimmer, Type: thing, ID: {2df0d509-d4b5-407a-835a-6b6392653e10}) ---------- @@ -871,7 +880,7 @@ The name of the ParamType (ThingClass: shelly1, Type: thing, ID: {fa1aa0f6-93b2- - + stop The name of the ActionType ({2266303c-df0c-4eae-b15e-6a86e73c9699}) of ThingClass shellyRoller