From ea2171cea27dfe96b11456cea5e14c66756c4134 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Wed, 27 Jan 2021 23:35:46 +0100 Subject: [PATCH 1/3] Tuya: Add light devices --- tuya/integrationplugintuya.cpp | 136 ++++++++++++++++++++++++-------- tuya/integrationplugintuya.h | 6 +- tuya/integrationplugintuya.json | 73 +++++++++++++++++ 3 files changed, 176 insertions(+), 39 deletions(-) diff --git a/tuya/integrationplugintuya.cpp b/tuya/integrationplugintuya.cpp index 35a8cc78..c3dab1b4 100644 --- a/tuya/integrationplugintuya.cpp +++ b/tuya/integrationplugintuya.cpp @@ -49,15 +49,25 @@ const int queryInterval = 130; const int discoveryInterval = 610; +QHash idParamTypeIdsMap = { + {tuyaClosableThingClassId, tuyaClosableThingIdParamTypeId}, + {tuyaSwitchThingClassId, tuyaSwitchThingIdParamTypeId}, + {tuyaLightThingClassId, tuyaLightThingIdParamTypeId} +}; + +QHash connectedStateTypeIdsMap = { + {tuyaClosableThingClassId, tuyaClosableConnectedStateTypeId}, + {tuyaSwitchThingClassId, tuyaSwitchConnectedStateTypeId}, + {tuyaLightThingClassId, tuyaLightConnectedStateTypeId} +}; + +QHash powerStateTypeIdsMap = { + {tuyaSwitchThingClassId, tuyaSwitchPowerStateTypeId}, + {tuyaLightThingClassId, tuyaLightPowerStateTypeId} +}; + IntegrationPluginTuya::IntegrationPluginTuya(QObject *parent): IntegrationPlugin(parent) { - m_devIdParamTypeIdsMap[tuyaClosableThingClassId] = tuyaClosableThingIdParamTypeId; - m_devIdParamTypeIdsMap[tuyaSwitchThingClassId] = tuyaSwitchThingIdParamTypeId; - - m_connectedStateTypeIdsMap[tuyaClosableThingClassId] = tuyaClosableConnectedStateTypeId; - m_connectedStateTypeIdsMap[tuyaSwitchThingClassId] = tuyaSwitchConnectedStateTypeId; - - m_powerStateTypeIdsMap[tuyaSwitchThingClassId] = tuyaSwitchPowerStateTypeId; } IntegrationPluginTuya::~IntegrationPluginTuya() @@ -236,19 +246,20 @@ void IntegrationPluginTuya::confirmPairing(ThingPairingInfo *info, const QString void IntegrationPluginTuya::executeAction(ThingActionInfo *info) { - if (info->action().actionTypeId() == tuyaSwitchPowerActionTypeId) { - bool on = info->action().param(tuyaSwitchPowerActionPowerParamTypeId).value().toBool(); - QString devId = info->thing()->paramValue(tuyaSwitchThingIdParamTypeId).toString(); + QString devId = info->thing()->paramValue(idParamTypeIdsMap.value(info->thing()->thingClassId())).toString(); + + if (powerStateTypeIdsMap.values().contains(info->action().actionTypeId())) { + bool on = info->action().paramValue(info->action().actionTypeId()).toBool(); controlTuyaSwitch(devId, "turnOnOff", on ? "1" : "0", info); connect(info, &ThingActionInfo::finished, [info, on](){ if (info->status() == Thing::ThingErrorNoError) { - info->thing()->setStateValue(tuyaSwitchPowerStateTypeId, on); + info->thing()->setStateValue(powerStateTypeIdsMap.value(info->thing()->thingClassId()), on); } }); return; } + if (info->thing()->thingClassId() == tuyaClosableThingClassId) { - QString devId = info->thing()->paramValue(tuyaClosableThingIdParamTypeId).toString(); if (info->action().actionTypeId() == tuyaClosableOpenActionTypeId) { controlTuyaSwitch(devId, "turnOnOff", "1", info); return; @@ -261,7 +272,45 @@ void IntegrationPluginTuya::executeAction(ThingActionInfo *info) controlTuyaSwitch(devId, "startStop", "0", info); return; } + } + if (info->action().actionTypeId() == tuyaLightBrightnessActionTypeId) { + int brightness = info->action().paramValue(tuyaLightBrightnessActionBrightnessParamTypeId).toInt() * 10; + controlTuyaSwitch(devId, "brightnessSet", QString::number(qMax(10, brightness)), info); + connect(info, &ThingActionInfo::finished, [info, brightness](){ + if (info->status() == Thing::ThingErrorNoError) { + info->thing()->setStateValue(tuyaLightBrightnessStateTypeId, brightness / 10); + } + }); + return; + } + + if (info->action().actionTypeId() == tuyaLightColorActionTypeId) { + QColor color = info->action().paramValue(tuyaLightColorActionColorParamTypeId).value(); + QVariantMap colorMap; + colorMap.insert("hue", color.hsvHue()); + colorMap.insert("saturation", color.hsvSaturation()); + colorMap.insert("brightness", qMax(10, info->thing()->stateValue(tuyaLightBrightnessStateTypeId).toInt() * 10)); + controlTuyaSwitch(devId, "colorSet", colorMap, info); + connect(info, &ThingActionInfo::finished, [info, color](){ + if (info->status() == Thing::ThingErrorNoError) { + info->thing()->setStateValue(tuyaLightColorStateTypeId, color); + } + }); + return; + } + + if (info->action().actionTypeId() == tuyaLightColorTemperatureActionTypeId) { + int ct = info->action().paramValue(tuyaLightColorTemperatureStateTypeId).toInt(); + QVariantMap params; + params.insert("value", ct * 10); + controlTuyaSwitch(devId, "colorTemperatureSet", params, info); + connect(info, &ThingActionInfo::finished, [info, ct](){ + if (info->status() == Thing::ThingErrorNoError) { + info->thing()->setStateValue(tuyaLightColorTemperatureStateTypeId, ct); + } + }); + return; } Q_ASSERT_X(false, "tuyaplugin", "Unhandled action type " + info->action().actionTypeId().toByteArray()); } @@ -406,33 +455,50 @@ void IntegrationPluginTuya::updateChildDevices(Thing *thing) QString name = deviceMap.value("name").toString(); if (devType == "switch") { - bool online = deviceMap.value("data").toMap().value("online").toBool(); - bool state = deviceMap.value("data").toMap().value("state").toBool(); - Thing *d = myThings().findByParams(ParamList() << Param(tuyaSwitchThingIdParamTypeId, id)); - if (d) { - qCDebug(dcTuya()) << "Found existing Tuya switch" << d->name() << id << name << (online ? "online:" : "offline") << (state ? "on": "off"); - d->setStateValue(tuyaSwitchConnectedStateTypeId, online); - d->setStateValue(tuyaSwitchPowerStateTypeId, state); - } else { + if (!d) { qCDebug(dcTuya()) << "Found new Tuya switch" << id << name; ThingDescriptor descriptor(tuyaSwitchThingClassId, name, QString(), thing->id()); descriptor.setParams(ParamList() << Param(tuyaSwitchThingIdParamTypeId, id)); unknownDevices.append(descriptor); - } - } else if (devType == "cover") { - bool online = deviceMap.value("data").toMap().value("online").toBool(); - - Thing *d = myThings().findByParams(ParamList() << Param(tuyaClosableThingIdParamTypeId, id)); - if (d) { - qCDebug(dcTuya()) << "Found existing Tuya cover" << d->name() << id << name << (online ? "online" : "offline"); - d->setStateValue(tuyaClosableConnectedStateTypeId, online); } else { + bool online = deviceMap.value("data").toMap().value("online").toBool(); + bool state = deviceMap.value("data").toMap().value("state").toBool(); + qCDebug(dcTuya()) << "Found existing Tuya switch" << d->name() << id << name << (online ? "online:" : "offline") << (state ? "on": "off"); + d->setStateValue(tuyaSwitchConnectedStateTypeId, online); + d->setStateValue(tuyaSwitchPowerStateTypeId, state); + } + + } else if (devType == "cover") { + Thing *d = myThings().findByParams(ParamList() << Param(tuyaClosableThingIdParamTypeId, id)); + if (!d) { qCDebug(dcTuya()) << "Found new Tuya cover" << id << name; ThingDescriptor descriptor(tuyaClosableThingClassId, name, QString(), thing->id()); descriptor.setParams(ParamList() << Param(tuyaClosableThingIdParamTypeId, id)); unknownDevices.append(descriptor); + } else { + bool online = deviceMap.value("data").toMap().value("online").toBool(); + qCDebug(dcTuya()) << "Found existing Tuya cover" << d->name() << id << name << (online ? "online" : "offline"); + d->setStateValue(tuyaClosableConnectedStateTypeId, online); } + + } else if (devType == "light") { + Thing *d = myThings().findByParams(ParamList() << Param(tuyaLightThingIdParamTypeId, id)); + if (!d) { + qCDebug(dcTuya()) << "Found new color Tuya light" << id << name; + ThingDescriptor descriptor(tuyaLightThingClassId, name, QString(), thing->id()); + descriptor.setParams(ParamList() << Param(tuyaLightThingIdParamTypeId, id)); + unknownDevices.append(descriptor); + } else { + bool online = deviceMap.value("data").toMap().value("online").toBool(); + bool state = deviceMap.value("data").toMap().value("state").toBool(); + qCDebug(dcTuya()) << "Found existing Tuya color light" << d->name() << id << name << (online ? "online" : "offline"); + int brightness = deviceMap.value("data").toMap().value("brightness").toInt() / 10; // Apparently the value in the tuya cloud is 10 - 1000 + d->setStateValue(tuyaLightConnectedStateTypeId, online); + d->setStateValue(tuyaLightPowerStateTypeId, state); + d->setStateValue(tuyaLightBrightnessStateTypeId, brightness); + } + } else { qCWarning(dcTuya()) << "Skipping unsupported thing type:" << devType; qCWarning(dcTuya()) << "Please report this including the following data:\n" << qUtf8Printable(QJsonDocument::fromVariant(deviceVariant).toJson()); @@ -451,7 +517,7 @@ void IntegrationPluginTuya::queryDevice(Thing *thing) { qCDebug(dcTuya()) << "Updating thing:" << thing; - QString devId = thing->paramValue(m_devIdParamTypeIdsMap.value(thing->thingClassId())).toString(); + QString devId = thing->paramValue(idParamTypeIdsMap.value(thing->thingClassId())).toString(); pluginStorage()->beginGroup(thing->parentId().toString()); QString accesToken = pluginStorage()->value("accessToken").toString(); @@ -510,15 +576,15 @@ void IntegrationPluginTuya::queryDevice(Thing *thing) bool state = result.value("payload").toMap().value("data").toMap().value("state").toBool(); qCDebug(dcTuya()) << "Device" << thing->name() << "is online:" << connected << "on:" << state; - thing->setStateValue(m_connectedStateTypeIdsMap.value(thing->thingClassId()), connected); + thing->setStateValue(connectedStateTypeIdsMap.value(thing->thingClassId()), connected); - if (m_powerStateTypeIdsMap.contains(thing->thingClassId())) { - thing->setStateValue(m_powerStateTypeIdsMap.value(thing->thingClassId()), state); + if (powerStateTypeIdsMap.contains(thing->thingClassId())) { + thing->setStateValue(powerStateTypeIdsMap.value(thing->thingClassId()), state); } }); } -void IntegrationPluginTuya::controlTuyaSwitch(const QString &devId, const QString &command, const QString &value, ThingActionInfo *info) +void IntegrationPluginTuya::controlTuyaSwitch(const QString &devId, const QString &command, const QVariant &value, ThingActionInfo *info) { Thing *thing = info->thing(); Thing *parentDevice = myThings().findById(thing->parentId()); @@ -550,6 +616,8 @@ void IntegrationPluginTuya::controlTuyaSwitch(const QString &devId, const QStrin QJsonDocument jsonDoc = QJsonDocument::fromVariant(data); + qCDebug(dcTuya()) << "Controlling payload:" << qUtf8Printable(jsonDoc.toJson(QJsonDocument::Indented)); + QNetworkReply *reply = hardwareManager()->networkManager()->post(request, jsonDoc.toJson(QJsonDocument::Compact)); connect(reply, &QNetworkReply::finished, [reply](){reply->deleteLater();}); connect(reply, &QNetworkReply::finished, info, [info, reply](){ @@ -571,7 +639,7 @@ void IntegrationPluginTuya::controlTuyaSwitch(const QString &devId, const QStrin QVariantMap dataMap = jsonDoc.toVariant().toMap(); bool success = dataMap.value("header").toMap().value("code").toString() == "SUCCESS"; if (!success) { - qCWarning(dcTuya()) << "Tuya response indicates an issue..."; + qCWarning(dcTuya()) << "Tuya response indicates an issue:" << qUtf8Printable(jsonDoc.toJson(QJsonDocument::Indented)); info->finish(Thing::ThingErrorHardwareFailure); return; } diff --git a/tuya/integrationplugintuya.h b/tuya/integrationplugintuya.h index a10bcf96..f2d3bbe3 100644 --- a/tuya/integrationplugintuya.h +++ b/tuya/integrationplugintuya.h @@ -64,16 +64,12 @@ private: void updateChildDevices(Thing *thing); void queryDevice(Thing *thing); - void controlTuyaSwitch(const QString &devId, const QString &command, const QString &value, ThingActionInfo *info); + void controlTuyaSwitch(const QString &devId, const QString &command, const QVariant &value, ThingActionInfo *info); QHash m_tokenExpiryTimers; PluginTimer *m_pluginTimerQuery = nullptr; PluginTimer *m_pluginTimerDiscovery = nullptr; - QHash m_devIdParamTypeIdsMap; - QHash m_connectedStateTypeIdsMap; - QHash m_powerStateTypeIdsMap; - QHash> m_pollQueue; }; diff --git a/tuya/integrationplugintuya.json b/tuya/integrationplugintuya.json index cf0a1576..d02497f4 100644 --- a/tuya/integrationplugintuya.json +++ b/tuya/integrationplugintuya.json @@ -124,6 +124,79 @@ "displayName": "Stop" } ] + }, + { + "id": "6aaa67b5-b1ef-41e8-af72-0915e529b3c9", + "name": "tuyaLight", + "displayName": "Tuya color light", + "createMethods": ["auto"], + "interfaces": ["colorlight", "connectable"], + "paramTypes": [ + { + "id": "7fda1e07-6e80-465a-8322-872d8ab42583", + "name": "id", + "displayName": "ID", + "type": "QString", + "defaultValue": "" + } + ], + "stateTypes": [ + { + "id": "6735b5eb-091b-4cad-aaa4-33ff76690e68", + "name": "connected", + "displayName": "Connected", + "displayNameEvent": "Connected changed", + "type": "bool", + "defaultValue": false, + "cached": false + }, + { + "id": "5b2f7c3e-6701-447f-9158-53abb5e81395", + "name": "power", + "displayName": "Power", + "displayNameEvent": "Power changed", + "displayNameAction": "Set power", + "type": "bool", + "defaultValue": false, + "writable": true, + "ioType": "digitalOutput" + }, + { + "id": "e2eba44d-73f9-43bc-97a3-ac4ff347b02c", + "name": "brightness", + "displayName": "Brightness", + "displayNameEvent": "Brightness changed", + "displayNameAction": "Set brightness", + "type": "int", + "minValue": 0, + "maxValue": 100, + "unit": "Percentage", + "defaultValue": "0", + "writable": true + }, + { + "id": "7ccf9dc3-6b3f-4793-b0d5-3c97afb34cf0", + "name": "color", + "displayName": "Color", + "displayNameEvent": "Color changed", + "displayNameAction": "Set color", + "type": "QColor", + "defaultValue": "white", + "writable": true + }, + { + "id": "8a07b6ca-3cb1-43f1-9b49-405349c2f146", + "name": "colorTemperature", + "displayName": "Color temperature", + "displayNameEvent": "Color temperature changed", + "displayNameAction": "Set color temperature", + "type": "int", + "minValue": 0, + "maxValue": 100, + "defaultValue": "50", + "writable": true + } + ] } ] } From 21b9f3bb03ba332c294eb7f26f6ceb673de68da7 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sun, 14 Feb 2021 14:59:06 +0100 Subject: [PATCH 2/3] update translations --- ...643b3-22ec-4a36-9808-e8b1405b01c9-en_US.ts | 191 ++++++++++++++---- 1 file changed, 148 insertions(+), 43 deletions(-) diff --git a/tuya/translations/405643b3-22ec-4a36-9808-e8b1405b01c9-en_US.ts b/tuya/translations/405643b3-22ec-4a36-9808-e8b1405b01c9-en_US.ts index 4e39bd4c..75f696ff 100644 --- a/tuya/translations/405643b3-22ec-4a36-9808-e8b1405b01c9-en_US.ts +++ b/tuya/translations/405643b3-22ec-4a36-9808-e8b1405b01c9-en_US.ts @@ -4,33 +4,33 @@ IntegrationPluginTuya - + Error authenticating to Tuya thing. - + Please enter username and password for your Tuya (Smart Life) account. - - + + Error communicating with Tuya server. - + Wrong username or password. - + Error connecting to Tuya switch. - + Received an unexpected reply from the Tuya switch. @@ -38,20 +38,80 @@ tuya - + + + + Brightness + The name of the ParamType (ThingClass: tuyaLight, ActionType: brightness, ID: {e2eba44d-73f9-43bc-97a3-ac4ff347b02c}) +---------- +The name of the ParamType (ThingClass: tuyaLight, EventType: brightness, ID: {e2eba44d-73f9-43bc-97a3-ac4ff347b02c}) +---------- +The name of the StateType ({e2eba44d-73f9-43bc-97a3-ac4ff347b02c}) of ThingClass tuyaLight + + + + + Brightness changed + The name of the EventType ({e2eba44d-73f9-43bc-97a3-ac4ff347b02c}) of ThingClass tuyaLight + + + + Close blinds The name of the ActionType ({f266ea4a-052f-466b-bf31-8c5c7e80a843}) of ThingClass tuyaClosable - - - - - - + + + + Color + The name of the ParamType (ThingClass: tuyaLight, ActionType: color, ID: {7ccf9dc3-6b3f-4793-b0d5-3c97afb34cf0}) +---------- +The name of the ParamType (ThingClass: tuyaLight, EventType: color, ID: {7ccf9dc3-6b3f-4793-b0d5-3c97afb34cf0}) +---------- +The name of the StateType ({7ccf9dc3-6b3f-4793-b0d5-3c97afb34cf0}) of ThingClass tuyaLight + + + + + Color changed + The name of the EventType ({7ccf9dc3-6b3f-4793-b0d5-3c97afb34cf0}) of ThingClass tuyaLight + + + + + + + Color temperature + The name of the ParamType (ThingClass: tuyaLight, ActionType: colorTemperature, ID: {8a07b6ca-3cb1-43f1-9b49-405349c2f146}) +---------- +The name of the ParamType (ThingClass: tuyaLight, EventType: colorTemperature, ID: {8a07b6ca-3cb1-43f1-9b49-405349c2f146}) +---------- +The name of the StateType ({8a07b6ca-3cb1-43f1-9b49-405349c2f146}) of ThingClass tuyaLight + + + + + Color temperature changed + The name of the EventType ({8a07b6ca-3cb1-43f1-9b49-405349c2f146}) of ThingClass tuyaLight + + + + + + + + + + + Connected - The name of the ParamType (ThingClass: tuyaClosable, EventType: connected, ID: {cf051676-3041-4e90-8c37-63e98412dfe8}) + The name of the ParamType (ThingClass: tuyaLight, EventType: connected, ID: {6735b5eb-091b-4cad-aaa4-33ff76690e68}) +---------- +The name of the StateType ({6735b5eb-091b-4cad-aaa4-33ff76690e68}) of ThingClass tuyaLight +---------- +The name of the ParamType (ThingClass: tuyaClosable, EventType: connected, ID: {cf051676-3041-4e90-8c37-63e98412dfe8}) ---------- The name of the StateType ({cf051676-3041-4e90-8c37-63e98412dfe8}) of ThingClass tuyaClosable ---------- @@ -65,11 +125,14 @@ The name of the StateType ({c844a23a-301b-4e6c-ba18-2926a38e6bf5}) of ThingClass - - - + + + + Connected changed - The name of the EventType ({cf051676-3041-4e90-8c37-63e98412dfe8}) of ThingClass tuyaClosable + The name of the EventType ({6735b5eb-091b-4cad-aaa4-33ff76690e68}) of ThingClass tuyaLight +---------- +The name of the EventType ({cf051676-3041-4e90-8c37-63e98412dfe8}) of ThingClass tuyaClosable ---------- The name of the EventType ({b5ac83c4-e1ff-4682-80f2-61cca097ed8f}) of ThingClass tuyaSwitch ---------- @@ -77,17 +140,20 @@ The name of the EventType ({c844a23a-301b-4e6c-ba18-2926a38e6bf5}) of ThingClass - - + + + ID - The name of the ParamType (ThingClass: tuyaClosable, Type: thing, ID: {b9b2bb1f-b44b-43d7-8bbb-e67cf1b5d0a0}) + The name of the ParamType (ThingClass: tuyaLight, Type: thing, ID: {7fda1e07-6e80-465a-8322-872d8ab42583}) +---------- +The name of the ParamType (ThingClass: tuyaClosable, Type: thing, ID: {b9b2bb1f-b44b-43d7-8bbb-e67cf1b5d0a0}) ---------- The name of the ParamType (ThingClass: tuyaSwitch, Type: thing, ID: {bfdb02b0-d12d-4385-a03d-d2c147c2aca2}) - - + + Logged in The name of the ParamType (ThingClass: tuyaCloud, EventType: loggedIn, ID: {33e9d30c-c988-4cd4-8d39-ce84bcfa79c5}) ---------- @@ -95,23 +161,32 @@ The name of the StateType ({33e9d30c-c988-4cd4-8d39-ce84bcfa79c5}) of ThingClass - + Logged in changed The name of the EventType ({33e9d30c-c988-4cd4-8d39-ce84bcfa79c5}) of ThingClass tuyaCloud - + Open blinds The name of the ActionType ({f9f34515-670d-439e-851a-0bf82f867882}) of ThingClass tuyaClosable - - - + + + + + + Power - The name of the ParamType (ThingClass: tuyaSwitch, ActionType: power, ID: {c84a703a-d1c7-491d-9507-5a69b217ac53}) + The name of the ParamType (ThingClass: tuyaLight, ActionType: power, ID: {5b2f7c3e-6701-447f-9158-53abb5e81395}) +---------- +The name of the ParamType (ThingClass: tuyaLight, EventType: power, ID: {5b2f7c3e-6701-447f-9158-53abb5e81395}) +---------- +The name of the StateType ({5b2f7c3e-6701-447f-9158-53abb5e81395}) of ThingClass tuyaLight +---------- +The name of the ParamType (ThingClass: tuyaSwitch, ActionType: power, ID: {c84a703a-d1c7-491d-9507-5a69b217ac53}) ---------- The name of the ParamType (ThingClass: tuyaSwitch, EventType: power, ID: {c84a703a-d1c7-491d-9507-5a69b217ac53}) ---------- @@ -119,26 +194,50 @@ The name of the StateType ({c84a703a-d1c7-491d-9507-5a69b217ac53}) of ThingClass - + + Power changed - The name of the EventType ({c84a703a-d1c7-491d-9507-5a69b217ac53}) of ThingClass tuyaSwitch + The name of the EventType ({5b2f7c3e-6701-447f-9158-53abb5e81395}) of ThingClass tuyaLight +---------- +The name of the EventType ({c84a703a-d1c7-491d-9507-5a69b217ac53}) of ThingClass tuyaSwitch - + + Set brightness + The name of the ActionType ({e2eba44d-73f9-43bc-97a3-ac4ff347b02c}) of ThingClass tuyaLight + + + + + Set color + The name of the ActionType ({7ccf9dc3-6b3f-4793-b0d5-3c97afb34cf0}) of ThingClass tuyaLight + + + + + Set color temperature + The name of the ActionType ({8a07b6ca-3cb1-43f1-9b49-405349c2f146}) of ThingClass tuyaLight + + + + + Set power - The name of the ActionType ({c84a703a-d1c7-491d-9507-5a69b217ac53}) of ThingClass tuyaSwitch + The name of the ActionType ({5b2f7c3e-6701-447f-9158-53abb5e81395}) of ThingClass tuyaLight +---------- +The name of the ActionType ({c84a703a-d1c7-491d-9507-5a69b217ac53}) of ThingClass tuyaSwitch - + Stop The name of the ActionType ({8fc2ea7d-b945-41c8-bbda-820bdadc9e02}) of ThingClass tuyaClosable - - + + Tuya The name of the vendor ({d5dd33a7-e5f6-48be-bdd9-1a1ec04152c9}) ---------- @@ -146,32 +245,38 @@ The name of the plugin tuya ({405643b3-22ec-4a36-9808-e8b1405b01c9}) - + Tuya blinds The name of the ThingClass ({d4bb0170-596d-4904-8fd0-fd8e7ad39f72}) - + Tuya cloud login The name of the ThingClass ({dd6dcd91-f667-45a5-9594-12b95f94337e}) - + + Tuya color light + The name of the ThingClass ({6aaa67b5-b1ef-41e8-af72-0915e529b3c9}) + + + + Tuya switch The name of the ThingClass ({393d7256-e792-4dca-adb5-b13750e05391}) - + User changed The name of the EventType ({15bc38a7-0962-4f3b-a0b1-4f164958493b}) of ThingClass tuyaCloud - - + + Username The name of the ParamType (ThingClass: tuyaCloud, EventType: userDisplayName, ID: {15bc38a7-0962-4f3b-a0b1-4f164958493b}) ---------- From 96ef438d4326d99011466bf7ea62636764bc2d46 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sun, 14 Feb 2021 15:00:25 +0100 Subject: [PATCH 3/3] Update readme --- tuya/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tuya/README.md b/tuya/README.md index da9d555b..5b8acb1a 100644 --- a/tuya/README.md +++ b/tuya/README.md @@ -3,3 +3,12 @@ This plugin allows to make use of Tuya based devices through the Tuya cloud. This includes all the devices that work with the Smart Life app. The plugin will allow logging in with the Smart Life app account and fetch all the devices connected to the Tuya/Smart Life cloud. + +Currently supported devices: + +* Smart plugs +* Lights [1] +* Roller shutters + + +[1] Please note, that light support is somewhat rudimentary as the Tuya cloud api does not allow integrating that very well.