removed all 433MHz plug-ins
This commit is contained in:
parent
748e3614ba
commit
b6b79a2d48
@ -1,17 +0,0 @@
|
||||
# Conrad
|
||||
|
||||
This plugin allows to controll RF 433 MHz actors an receive remote signals from Conrad devices
|
||||
|
||||
## Supported Things
|
||||
|
||||
* Conrad Shutter (RSM900R)
|
||||
* Up/Down/Sync
|
||||
|
||||
## Requirements
|
||||
|
||||
* 433 MHz Transceiver
|
||||
|
||||
## More
|
||||
|
||||
http://www.conrad.de
|
||||
|
||||
@ -1,11 +0,0 @@
|
||||
include(../plugins.pri)
|
||||
|
||||
TARGET = $$qtLibraryTarget(nymea_integrationpluginconrad)
|
||||
|
||||
SOURCES += \
|
||||
integrationpluginconrad.cpp
|
||||
|
||||
HEADERS += \
|
||||
integrationpluginconrad.h
|
||||
|
||||
|
||||
@ -1,176 +0,0 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* 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
|
||||
* reproduction, publication, editing and translation, are reserved. The use of
|
||||
* this project is subject to the terms of a license agreement to be concluded
|
||||
* with nymea GmbH in accordance with the terms of use of nymea GmbH, available
|
||||
* under https://nymea.io/license
|
||||
*
|
||||
* GNU Lesser General Public License Usage
|
||||
* Alternatively, this project may be redistributed and/or modified under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free
|
||||
* Software Foundation; version 3. This project is distributed in the hope that
|
||||
* it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this project. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For any further details and any questions please contact us under
|
||||
* contact@nymea.io or see our FAQ/Licensing Information on
|
||||
* https://nymea.io/license/faq
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include "integrationpluginconrad.h"
|
||||
|
||||
#include "integrations/thing.h"
|
||||
#include "plugininfo.h"
|
||||
#include "hardware/radio433/radio433.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
|
||||
|
||||
IntegrationPluginConrad::IntegrationPluginConrad(): IntegrationPlugin()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void IntegrationPluginConrad::setupThing(ThingSetupInfo *info)
|
||||
{
|
||||
if (info->thing()->thingClassId() == conradShutterThingClassId) {
|
||||
info->finish(Thing::ThingErrorNoError);
|
||||
return;
|
||||
}
|
||||
|
||||
info->finish(Thing::ThingErrorThingClassNotFound);
|
||||
}
|
||||
|
||||
void IntegrationPluginConrad::executeAction(ThingActionInfo *info)
|
||||
{
|
||||
Thing *thing = info->thing();
|
||||
Action action = info->action();
|
||||
|
||||
if (!hardwareManager()->radio433()->available()) {
|
||||
info->finish(Thing::ThingErrorHardwareNotAvailable);
|
||||
return;
|
||||
}
|
||||
|
||||
QList<int> rawData;
|
||||
QByteArray binCode;
|
||||
|
||||
int repetitions = 10;
|
||||
|
||||
if (action.actionTypeId() == conradShutterUpActionTypeId) {
|
||||
binCode = "10101000";
|
||||
} else if (action.actionTypeId() == conradShutterDownActionTypeId) {
|
||||
binCode = "10100000";
|
||||
} else if (action.actionTypeId() == conradShutterSyncActionTypeId) {
|
||||
binCode = "10100000";
|
||||
repetitions = 20;
|
||||
} else {
|
||||
info->finish(Thing::ThingErrorActionTypeNotFound);
|
||||
return;
|
||||
}
|
||||
|
||||
// append ID
|
||||
binCode.append("100101010110011000000001");
|
||||
|
||||
//QByteArray remoteId = "100101010110011000000001";
|
||||
// QByteArray motionDetectorId = "100100100101101101101010";
|
||||
//QByteArray wallSwitchId = "000001001101000010110110";
|
||||
// QByteArray randomID = "100010101010111010101010";
|
||||
|
||||
|
||||
|
||||
// =======================================
|
||||
//create rawData timings list
|
||||
int delay = 650;
|
||||
|
||||
// sync signal
|
||||
rawData.append(1);
|
||||
rawData.append(10);
|
||||
|
||||
// add the code
|
||||
foreach (QChar c, binCode) {
|
||||
if(c == '0'){
|
||||
rawData.append(1);
|
||||
rawData.append(2);
|
||||
}
|
||||
if(c == '1'){
|
||||
rawData.append(2);
|
||||
rawData.append(1);
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================
|
||||
// send data to driver
|
||||
if(hardwareManager()->radio433()->sendData(delay, rawData, repetitions)){
|
||||
qCDebug(dcConrad) << "Transmitted successfully" << thing->name() << action.actionTypeId();
|
||||
}else{
|
||||
qCWarning(dcConrad) << "Could not transmitt" << pluginName() << thing->name() << action.actionTypeId();
|
||||
info->finish(Thing::ThingErrorHardwareNotAvailable);
|
||||
return;
|
||||
}
|
||||
info->finish(Thing::ThingErrorNoError);
|
||||
}
|
||||
|
||||
void IntegrationPluginConrad::radioData(const QList<int> &rawData)
|
||||
{
|
||||
// filter right here a wrong signal length
|
||||
if(rawData.length() != 65){
|
||||
return;
|
||||
}
|
||||
|
||||
qCDebug(dcConrad) << rawData;
|
||||
|
||||
int delay = rawData.first()/10;
|
||||
QByteArray binCode;
|
||||
|
||||
// =======================================
|
||||
// average 650
|
||||
if(delay > 600 && delay < 750){
|
||||
// go trough all 64 timings (without sync signal)
|
||||
for(int i = 1; i <= 64; i+=2 ){
|
||||
int div;
|
||||
int divNext;
|
||||
|
||||
// if short
|
||||
if(rawData.at(i) <= 900){
|
||||
div = 1;
|
||||
}else{
|
||||
div = 2;
|
||||
}
|
||||
// if long
|
||||
if(rawData.at(i+1) < 900){
|
||||
divNext = 1;
|
||||
}else{
|
||||
divNext = 2;
|
||||
}
|
||||
|
||||
// _
|
||||
// if we have | |__ = 0 -> in 4 delays => 100
|
||||
// __
|
||||
// if we have | |_ = 1 -> in 4 delays => 110
|
||||
|
||||
if(div == 1 && divNext == 2){
|
||||
binCode.append('0');
|
||||
}else if(div == 2 && divNext == 1){
|
||||
binCode.append('1');
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
|
||||
qCDebug(dcConrad) << binCode.left(binCode.length() - 24) << " ID = " << binCode.right(24);
|
||||
}
|
||||
@ -1,53 +0,0 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* 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
|
||||
* reproduction, publication, editing and translation, are reserved. The use of
|
||||
* this project is subject to the terms of a license agreement to be concluded
|
||||
* with nymea GmbH in accordance with the terms of use of nymea GmbH, available
|
||||
* under https://nymea.io/license
|
||||
*
|
||||
* GNU Lesser General Public License Usage
|
||||
* Alternatively, this project may be redistributed and/or modified under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free
|
||||
* Software Foundation; version 3. This project is distributed in the hope that
|
||||
* it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this project. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For any further details and any questions please contact us under
|
||||
* contact@nymea.io or see our FAQ/Licensing Information on
|
||||
* https://nymea.io/license/faq
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef INTEGRATIONPLUGINCONRAD_H
|
||||
#define INTEGRATIONPLUGINCONRAD_H
|
||||
|
||||
#include "integrations/integrationplugin.h"
|
||||
|
||||
class IntegrationPluginConrad : public IntegrationPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PLUGIN_METADATA(IID "io.nymea.IntegrationPlugin" FILE "integrationpluginconrad.json")
|
||||
Q_INTERFACES(IntegrationPlugin)
|
||||
|
||||
public:
|
||||
explicit IntegrationPluginConrad();
|
||||
|
||||
void setupThing(ThingSetupInfo *info) override;
|
||||
void radioData(const QList<int> &rawData);
|
||||
|
||||
void executeAction(ThingActionInfo *info) override;
|
||||
|
||||
};
|
||||
|
||||
#endif // INTEGRATIONPLUGINCONRAD_H
|
||||
@ -1,38 +0,0 @@
|
||||
{
|
||||
"name": "Conrad",
|
||||
"displayName": "Conrad",
|
||||
"id": "1fd1a076-f229-4ec6-b501-48ddd15935e4",
|
||||
"vendors": [
|
||||
{
|
||||
"name": "Conrad",
|
||||
"displayName": "Conrad Electronic",
|
||||
"id": "986cf06f-3ef1-4271-b2a3-2cc277ebecb6",
|
||||
"thingClasses": [
|
||||
{
|
||||
"id": "2bb14180-aa5d-4999-992d-e6d464cff486",
|
||||
"name": "conradShutter",
|
||||
"displayName": "Shutter (RSM900R)",
|
||||
"createMethods": ["user"],
|
||||
"paramTypes": [ ],
|
||||
"actionTypes": [
|
||||
{
|
||||
"id": "e015419c-9df9-4bf5-a439-f1f32aedd1db",
|
||||
"name": "up",
|
||||
"displayName": "up"
|
||||
},
|
||||
{
|
||||
"id": "c58a463a-f765-4a61-b2e2-883cc23878c0",
|
||||
"name": "down",
|
||||
"displayName": "down"
|
||||
},
|
||||
{
|
||||
"id": "4125a18e-fa2d-4b25-acd1-e148d5d665f5",
|
||||
"name": "sync",
|
||||
"displayName": "Send sync signal"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,43 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="de_DE">
|
||||
<context>
|
||||
<name>Conrad</name>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/conrad/plugininfo.h" line="26"/>
|
||||
<source>Conrad</source>
|
||||
<extracomment>The name of the plugin Conrad ({1fd1a076-f229-4ec6-b501-48ddd15935e4})</extracomment>
|
||||
<translation>Conrad</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/conrad/plugininfo.h" line="29"/>
|
||||
<source>Conrad Electronic</source>
|
||||
<extracomment>The name of the vendor ({986cf06f-3ef1-4271-b2a3-2cc277ebecb6})</extracomment>
|
||||
<translation>Conrad Electronic</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/conrad/plugininfo.h" line="35"/>
|
||||
<source>Shutter (RSM900R)</source>
|
||||
<extracomment>The name of the ThingClass ({2bb14180-aa5d-4999-992d-e6d464cff486})</extracomment>
|
||||
<translation>Jalousieschalter (RSM900R)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/conrad/plugininfo.h" line="41"/>
|
||||
<source>up</source>
|
||||
<extracomment>The name of the ActionType ({e015419c-9df9-4bf5-a439-f1f32aedd1db}) of ThingClass conradShutter</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/conrad/plugininfo.h" line="38"/>
|
||||
<source>down</source>
|
||||
<extracomment>The name of the ActionType ({c58a463a-f765-4a61-b2e2-883cc23878c0}) of ThingClass conradShutter</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/conrad/plugininfo.h" line="32"/>
|
||||
<source>Send sync signal</source>
|
||||
<extracomment>The name of the ActionType ({4125a18e-fa2d-4b25-acd1-e148d5d665f5}) of ThingClass conradShutter</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
@ -1,43 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>Conrad</name>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/conrad/plugininfo.h" line="26"/>
|
||||
<source>Conrad</source>
|
||||
<extracomment>The name of the plugin Conrad ({1fd1a076-f229-4ec6-b501-48ddd15935e4})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/conrad/plugininfo.h" line="29"/>
|
||||
<source>Conrad Electronic</source>
|
||||
<extracomment>The name of the vendor ({986cf06f-3ef1-4271-b2a3-2cc277ebecb6})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/conrad/plugininfo.h" line="35"/>
|
||||
<source>Shutter (RSM900R)</source>
|
||||
<extracomment>The name of the ThingClass ({2bb14180-aa5d-4999-992d-e6d464cff486})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/conrad/plugininfo.h" line="41"/>
|
||||
<source>up</source>
|
||||
<extracomment>The name of the ActionType ({e015419c-9df9-4bf5-a439-f1f32aedd1db}) of ThingClass conradShutter</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/conrad/plugininfo.h" line="38"/>
|
||||
<source>down</source>
|
||||
<extracomment>The name of the ActionType ({c58a463a-f765-4a61-b2e2-883cc23878c0}) of ThingClass conradShutter</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/conrad/plugininfo.h" line="32"/>
|
||||
<source>Send sync signal</source>
|
||||
<extracomment>The name of the ActionType ({4125a18e-fa2d-4b25-acd1-e148d5d665f5}) of ThingClass conradShutter</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
100
debian/control
vendored
100
debian/control
vendored
@ -151,22 +151,6 @@ Description: nymea.io plugin for commandlauncher
|
||||
This package will install the nymea.io plugin for commandlauncher
|
||||
|
||||
|
||||
Package: nymea-plugin-conrad
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
nymea-plugins-translations,
|
||||
Replaces: guh-plugin-conrad
|
||||
Description: nymea.io plugin for conrad
|
||||
The nymea daemon is a plugin based IoT (Internet of Things) server. The
|
||||
server works like a translator for devices, things and services and
|
||||
allows them to interact.
|
||||
With the powerful rule engine you are able to connect any device available
|
||||
in the system and create individual scenes and behaviors for your environment.
|
||||
.
|
||||
This package will install the nymea.io plugin for conrad
|
||||
|
||||
|
||||
Package: nymea-plugin-datetime
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
@ -262,22 +246,6 @@ Description: nymea.io plugin for elgato
|
||||
This package will install the nymea.io plugin for elgato
|
||||
|
||||
|
||||
Package: nymea-plugin-elro
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
nymea-plugins-translations,
|
||||
Replaces: guh-plugin-elro
|
||||
Description: nymea.io plugin for elro
|
||||
The nymea daemon is a plugin based IoT (Internet of Things) server. The
|
||||
server works like a translator for devices, things and services and
|
||||
allows them to interact.
|
||||
With the powerful rule engine you are able to connect any device available
|
||||
in the system and create individual scenes and behaviors for your environment.
|
||||
.
|
||||
This package will install the nymea.io plugin for elro
|
||||
|
||||
|
||||
Package: nymea-plugin-flowercare
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
@ -357,22 +325,6 @@ Description: nymea.io plugin for gpio
|
||||
This package will install the nymea.io plugin for gpio
|
||||
|
||||
|
||||
Package: nymea-plugin-intertechno
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
nymea-plugins-translations,
|
||||
Replaces: guh-plugin-intertechno
|
||||
Description: nymea.io plugin for intertechno
|
||||
The nymea daemon is a plugin based IoT (Internet of Things) server. The
|
||||
server works like a translator for devices, things and services and
|
||||
allows them to interact.
|
||||
With the powerful rule engine you are able to connect any device available
|
||||
in the system and create individual scenes and behaviors for your environment.
|
||||
.
|
||||
This package will install the nymea.io plugin for intertechno
|
||||
|
||||
|
||||
Package: nymea-plugin-kodi
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
@ -389,22 +341,6 @@ Description: nymea.io plugin for kodi
|
||||
This package will install the nymea.io plugin for kodi
|
||||
|
||||
|
||||
Package: nymea-plugin-leynew
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
nymea-plugins-translations,
|
||||
Replaces: guh-plugin-leynew
|
||||
Description: nymea.io plugin for leynew
|
||||
The nymea daemon is a plugin based IoT (Internet of Things) server. The
|
||||
server works like a translator for devices, things and services and
|
||||
allows them to interact.
|
||||
With the powerful rule engine you are able to connect any device available
|
||||
in the system and create individual scenes and behaviors for your environment.
|
||||
.
|
||||
This package will install the nymea.io plugin for leynew
|
||||
|
||||
|
||||
Package: nymea-plugin-lgsmarttv
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
@ -704,22 +640,6 @@ Description: nymea.io plugin for UniFi network controllers
|
||||
This package will install the nymea.io plugin for UniFi network controllers
|
||||
|
||||
|
||||
Package: nymea-plugin-unitec
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
nymea-plugins-translations,
|
||||
Replaces: guh-plugin-unitec
|
||||
Description: nymea.io plugin for unitec
|
||||
The nymea daemon is a plugin based IoT (Internet of Things) server. The
|
||||
server works like a translator for devices, things and services and
|
||||
allows them to interact.
|
||||
With the powerful rule engine you are able to connect any device available
|
||||
in the system and create individual scenes and behaviors for your environment.
|
||||
.
|
||||
This package will install the nymea.io plugin for unitec
|
||||
|
||||
|
||||
Package: nymea-plugin-usbrelay
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
@ -1078,32 +998,12 @@ Description: Plugins for nymea IoT server - Meta package for 6LoWPAN Merkur boar
|
||||
This package will install the 6LoWPAN Merkur board plugins for nymea.
|
||||
|
||||
|
||||
Package: nymea-plugins-433mhz
|
||||
Section: libs
|
||||
Architecture: all
|
||||
Depends: nymea-plugin-elro,
|
||||
nymea-plugin-conrad,
|
||||
nymea-plugin-intertechno,
|
||||
nymea-plugin-leynew,
|
||||
nymea-plugin-unitec,
|
||||
Replaces: guh-plugins-433mhz
|
||||
Description: Plugins for nymea IoT server - Meta package for RF 433 MHz plugins
|
||||
The nymea daemon is a plugin based IoT (Internet of Things) server. The
|
||||
server works like a translator for devices, things and services and
|
||||
allows them to interact.
|
||||
With the powerful rule engine you are able to connect any device available
|
||||
in the system and create individual scenes and behaviors for your environment.
|
||||
.
|
||||
This package will install the RF 433 MHz plugins for nymea.
|
||||
|
||||
|
||||
Package: nymea-plugins-all
|
||||
Section: libs
|
||||
Architecture: all
|
||||
Depends: nymea-plugins,
|
||||
nymea-plugin-simulation,
|
||||
nymea-plugin-snapd,
|
||||
nymea-plugins-433mhz,
|
||||
nymea-plugins-maker,
|
||||
nymea-plugins-merkurboard,
|
||||
Replaces: guh-plugins-all
|
||||
|
||||
1
debian/nymea-plugin-conrad.install.in
vendored
1
debian/nymea-plugin-conrad.install.in
vendored
@ -1 +0,0 @@
|
||||
usr/lib/@DEB_HOST_MULTIARCH@/nymea/plugins/libnymea_integrationpluginconrad.so
|
||||
1
debian/nymea-plugin-elro.install.in
vendored
1
debian/nymea-plugin-elro.install.in
vendored
@ -1 +0,0 @@
|
||||
usr/lib/@DEB_HOST_MULTIARCH@/nymea/plugins/libnymea_integrationpluginelro.so
|
||||
1
debian/nymea-plugin-intertechno.install.in
vendored
1
debian/nymea-plugin-intertechno.install.in
vendored
@ -1 +0,0 @@
|
||||
usr/lib/@DEB_HOST_MULTIARCH@/nymea/plugins/libnymea_integrationpluginintertechno.so
|
||||
1
debian/nymea-plugin-leynew.install.in
vendored
1
debian/nymea-plugin-leynew.install.in
vendored
@ -1 +0,0 @@
|
||||
usr/lib/@DEB_HOST_MULTIARCH@/nymea/plugins/libnymea_integrationpluginleynew.so
|
||||
1
debian/nymea-plugin-unitec.install.in
vendored
1
debian/nymea-plugin-unitec.install.in
vendored
@ -1 +0,0 @@
|
||||
usr/lib/@DEB_HOST_MULTIARCH@/nymea/plugins/libnymea_integrationpluginunitec.so
|
||||
@ -1,4 +0,0 @@
|
||||
# Elro
|
||||
|
||||
This plugin allows to controll RF 433 MHz actors an receive remote signals from [Elro](http://www.elroshop.eu/) devices.
|
||||
|
||||
@ -1,11 +0,0 @@
|
||||
include(../plugins.pri)
|
||||
|
||||
TARGET = $$qtLibraryTarget(nymea_integrationpluginelro)
|
||||
|
||||
SOURCES += \
|
||||
integrationpluginelro.cpp
|
||||
|
||||
HEADERS += \
|
||||
integrationpluginelro.h
|
||||
|
||||
|
||||
@ -1,246 +0,0 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* 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
|
||||
* reproduction, publication, editing and translation, are reserved. The use of
|
||||
* this project is subject to the terms of a license agreement to be concluded
|
||||
* with nymea GmbH in accordance with the terms of use of nymea GmbH, available
|
||||
* under https://nymea.io/license
|
||||
*
|
||||
* GNU Lesser General Public License Usage
|
||||
* Alternatively, this project may be redistributed and/or modified under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free
|
||||
* Software Foundation; version 3. This project is distributed in the hope that
|
||||
* it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this project. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For any further details and any questions please contact us under
|
||||
* contact@nymea.io or see our FAQ/Licensing Information on
|
||||
* https://nymea.io/license/faq
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include "integrationpluginelro.h"
|
||||
#include "plugininfo.h"
|
||||
#include "hardware/radio433/radio433.h"
|
||||
|
||||
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
|
||||
IntegrationPluginElro::IntegrationPluginElro()
|
||||
{
|
||||
}
|
||||
|
||||
void IntegrationPluginElro::executeAction(ThingActionInfo *info)
|
||||
{
|
||||
Thing *thing = info->thing();
|
||||
Action action = info->action();
|
||||
|
||||
if (!hardwareManager()->radio433()->available())
|
||||
return info->finish(Thing::ThingErrorHardwareNotAvailable);
|
||||
|
||||
if (action.actionTypeId() != elroSocketPowerActionTypeId)
|
||||
return info->finish(Thing::ThingErrorActionTypeNotFound);
|
||||
|
||||
QList<int> rawData;
|
||||
QByteArray binCode;
|
||||
|
||||
// create the bincode
|
||||
// channels
|
||||
if (thing->paramValue(elroSocketThingChan1ParamTypeId).toBool()) {
|
||||
binCode.append("00");
|
||||
} else {
|
||||
binCode.append("01");
|
||||
}
|
||||
if (thing->paramValue(elroSocketThingChan2ParamTypeId).toBool()) {
|
||||
binCode.append("00");
|
||||
} else {
|
||||
binCode.append("01");
|
||||
}
|
||||
if (thing->paramValue(elroSocketThingChan3ParamTypeId).toBool()) {
|
||||
binCode.append("00");
|
||||
}else{
|
||||
binCode.append("01");
|
||||
}
|
||||
if(thing->paramValue(elroSocketThingChan4ParamTypeId).toBool()){
|
||||
binCode.append("00");
|
||||
} else {
|
||||
binCode.append("01");
|
||||
}
|
||||
if (thing->paramValue(elroSocketThingChan5ParamTypeId).toBool()) {
|
||||
binCode.append("00");
|
||||
} else {
|
||||
binCode.append("01");
|
||||
}
|
||||
|
||||
// Buttons
|
||||
if (thing->paramValue(elroSocketThingAParamTypeId).toBool()) {
|
||||
binCode.append("00");
|
||||
} else {
|
||||
binCode.append("01");
|
||||
}
|
||||
if (thing->paramValue(elroSocketThingBParamTypeId).toBool()) {
|
||||
binCode.append("00");
|
||||
} else {
|
||||
binCode.append("01");
|
||||
}
|
||||
if (thing->paramValue(elroSocketThingCParamTypeId).toBool()) {
|
||||
binCode.append("00");
|
||||
} else {
|
||||
binCode.append("01");
|
||||
}
|
||||
if (thing->paramValue(elroSocketThingDParamTypeId).toBool()) {
|
||||
binCode.append("00");
|
||||
} else {
|
||||
binCode.append("01");
|
||||
}
|
||||
if (thing->paramValue(elroSocketThingEParamTypeId).toBool()) {
|
||||
binCode.append("00");
|
||||
} else {
|
||||
binCode.append("01");
|
||||
}
|
||||
|
||||
// Power
|
||||
if (action.param(elroSocketPowerActionPowerParamTypeId).value().toBool()) {
|
||||
binCode.append("0001");
|
||||
} else {
|
||||
binCode.append("0100");
|
||||
}
|
||||
|
||||
//create rawData timings list
|
||||
int delay = 350;
|
||||
|
||||
// sync signal
|
||||
rawData.append(1);
|
||||
rawData.append(31);
|
||||
|
||||
// add the code
|
||||
foreach (QChar c, binCode) {
|
||||
if (c == '0') {
|
||||
rawData.append(1);
|
||||
rawData.append(3);
|
||||
} else {
|
||||
rawData.append(3);
|
||||
rawData.append(1);
|
||||
}
|
||||
}
|
||||
|
||||
// send data to hardware resource
|
||||
if (hardwareManager()->radio433()->sendData(delay, rawData, 10)) {
|
||||
qCDebug(dcElro) << "Transmitted" << pluginName() << thing->name() << "power: " << action.param(elroSocketPowerActionPowerParamTypeId).value().toBool();
|
||||
} else {
|
||||
qCWarning(dcElro) << "Could not transmitt" << pluginName() << thing->name() << "power: " << action.param(elroSocketPowerActionPowerParamTypeId).value().toBool();
|
||||
return info->finish(Thing::ThingErrorHardwareNotAvailable);
|
||||
}
|
||||
|
||||
info->finish(Thing::ThingErrorNoError);
|
||||
}
|
||||
|
||||
void IntegrationPluginElro::radioData(const QList<int> &rawData)
|
||||
{
|
||||
// filter right here a wrong signal length
|
||||
if (rawData.length() != 49) {
|
||||
return;
|
||||
}
|
||||
|
||||
int delay = rawData.first()/31;
|
||||
QByteArray binCode;
|
||||
|
||||
// average 314
|
||||
if (delay > 290 && delay < 400) {
|
||||
// go trough all 48 timings (without sync signal)
|
||||
for (int i = 1; i <= 48; i+=2 ) {
|
||||
int div;
|
||||
int divNext;
|
||||
|
||||
// if short
|
||||
if (rawData.at(i) <= 700) {
|
||||
div = 1;
|
||||
} else {
|
||||
div = 3;
|
||||
}
|
||||
// if long
|
||||
if (rawData.at(i+1) < 700) {
|
||||
divNext = 1;
|
||||
} else {
|
||||
divNext = 3;
|
||||
}
|
||||
|
||||
// _
|
||||
// | |___ = 0 -> in 4 delays => 1000
|
||||
// _
|
||||
// ___| | = 1 -> in 4 delays => 0001
|
||||
|
||||
if (div == 1 && divNext == 3) {
|
||||
binCode.append('0');
|
||||
} else if(div == 3 && divNext == 1) {
|
||||
binCode.append('1');
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
qCDebug(dcElro) << "Understands this protocol: " << binCode;
|
||||
|
||||
if (binCode.left(20) == "00000100000000000001") {
|
||||
if (binCode.right(4) == "0100") {
|
||||
qCDebug(dcElro) << "Motion Detector OFF";
|
||||
} else {
|
||||
qCDebug(dcElro) << "Motion Detector ON";
|
||||
}
|
||||
}
|
||||
|
||||
// get the channel of the remote signal (5 channels, true=1, false=0)
|
||||
QList<bool> group;
|
||||
for (int i = 1; i < 10; i+=2) {
|
||||
if (binCode.at(i-1) == '0' && binCode.at(i) == '1') {
|
||||
group << false;
|
||||
} else if(binCode.at(i-1) == '0' && binCode.at(i) == '0') {
|
||||
group << true;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// get the button letter
|
||||
QString button;
|
||||
QByteArray buttonCode = binCode.mid(10,10);
|
||||
|
||||
if (buttonCode == "0001010101") {
|
||||
button = "A";
|
||||
} else if (buttonCode == "0100010101") {
|
||||
button = "B";
|
||||
} else if (buttonCode == "0101000101") {
|
||||
button = "C";
|
||||
} else if(buttonCode == "0101010001") {
|
||||
button = "D";
|
||||
} else if(buttonCode == "0101010100") {
|
||||
button = "E";
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
// get power status -> On = 0100, Off = 0001
|
||||
bool power;
|
||||
if (binCode.right(4).toInt(0,2) == 1) {
|
||||
power = true;
|
||||
} else if(binCode.right(4).toInt(0,2) == 4) {
|
||||
power = false;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
qCDebug(dcElro) << group << buttonCode << power;
|
||||
}
|
||||
@ -1,53 +0,0 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* 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
|
||||
* reproduction, publication, editing and translation, are reserved. The use of
|
||||
* this project is subject to the terms of a license agreement to be concluded
|
||||
* with nymea GmbH in accordance with the terms of use of nymea GmbH, available
|
||||
* under https://nymea.io/license
|
||||
*
|
||||
* GNU Lesser General Public License Usage
|
||||
* Alternatively, this project may be redistributed and/or modified under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free
|
||||
* Software Foundation; version 3. This project is distributed in the hope that
|
||||
* it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this project. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For any further details and any questions please contact us under
|
||||
* contact@nymea.io or see our FAQ/Licensing Information on
|
||||
* https://nymea.io/license/faq
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef INTEGRATIONPLUGINELRO_H
|
||||
#define INTEGRATIONPLUGINELRO_H
|
||||
|
||||
#include "integrations/integrationplugin.h"
|
||||
|
||||
class IntegrationPluginElro : public IntegrationPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PLUGIN_METADATA(IID "io.nymea.IntegrationPlugin" FILE "integrationpluginelro.json")
|
||||
Q_INTERFACES(IntegrationPlugin)
|
||||
|
||||
public:
|
||||
explicit IntegrationPluginElro();
|
||||
|
||||
void radioData(const QList<int> &rawData);
|
||||
|
||||
public slots:
|
||||
void executeAction(ThingActionInfo *info) override;
|
||||
|
||||
};
|
||||
|
||||
#endif // INTEGRATIONPLUGINELRO_H
|
||||
@ -1,97 +0,0 @@
|
||||
{
|
||||
"name": "Elro",
|
||||
"displayName": "Elro",
|
||||
"id": "2b267f81-d9ae-4f4f-89a0-7386b547cfd3",
|
||||
"vendors": [
|
||||
{
|
||||
"name": "Elro",
|
||||
"displayName": "Elro",
|
||||
"id": "435a13a0-65ca-4f0c-94c1-e5873b258db5",
|
||||
"thingClasses": [
|
||||
{
|
||||
"id": "308ae6e6-38b3-4b3a-a513-3199da2764f8",
|
||||
"name": "elroSocket",
|
||||
"displayName": "Elro Power Socket",
|
||||
"createMethods": ["user"],
|
||||
"paramTypes": [
|
||||
{
|
||||
"id": "66b2a017-658a-46d9-9e98-33aaed6345ad",
|
||||
"name": "chan1",
|
||||
"displayName": "channel 1",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"id": "bda44f42-b608-4c70-a370-8d8d2e406205",
|
||||
"name": "chan2",
|
||||
"displayName": "channel 2",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"id": "4165bfb7-f1db-49ce-bad7-34956ea45d03",
|
||||
"name": "chan3",
|
||||
"displayName": "channel 3",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"id": "69960183-8fba-4f94-94b4-6d536e28f3a0",
|
||||
"name": "chan4",
|
||||
"displayName": "channel 4",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"id": "41a9706c-e6e8-4de8-b280-789f1434f6ed",
|
||||
"name": "chan5",
|
||||
"displayName": "channel 5",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"id": "906811d6-e232-42e6-829c-2cdaa9ee5340",
|
||||
"name": "a",
|
||||
"displayName": "A",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"id": "0d9b27f7-01cc-44bc-99f6-65612dee0027",
|
||||
"name": "b",
|
||||
"displayName": "B",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"id": "d82d95db-b6b5-4d0b-9ea6-a00fc455a0ff",
|
||||
"name": "c",
|
||||
"displayName": "C",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"id": "a4a13ee3-605f-4b42-b81b-a26e66f74b26",
|
||||
"name": "d",
|
||||
"displayName": "D",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"id": "e71ee50f-5c54-4a35-877a-743fe928a528",
|
||||
"name": "e",
|
||||
"displayName": "E",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"actionTypes": [
|
||||
{
|
||||
"id": "31c9758e-6567-4f89-85bb-29e1a7c55d44",
|
||||
"name": "power",
|
||||
"displayName": "set power",
|
||||
"paramTypes": [
|
||||
{
|
||||
"id": "004ad008-0084-40be-9b1a-b60e1b30579d",
|
||||
"name": "power",
|
||||
"displayName": "power",
|
||||
"type": "bool"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,94 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="de_DE">
|
||||
<context>
|
||||
<name>Elro</name>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="50"/>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="53"/>
|
||||
<source>Elro</source>
|
||||
<extracomment>The name of the vendor ({435a13a0-65ca-4f0c-94c1-e5873b258db5})
|
||||
----------
|
||||
The name of the plugin Elro ({2b267f81-d9ae-4f4f-89a0-7386b547cfd3})</extracomment>
|
||||
<translation>Elro</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="56"/>
|
||||
<source>Elro Power Socket</source>
|
||||
<extracomment>The name of the ThingClass ({308ae6e6-38b3-4b3a-a513-3199da2764f8})</extracomment>
|
||||
<translation>Elro Steckdose</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="59"/>
|
||||
<source>channel 1</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, Type: thing, ID: {66b2a017-658a-46d9-9e98-33aaed6345ad})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="62"/>
|
||||
<source>channel 2</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, Type: thing, ID: {bda44f42-b608-4c70-a370-8d8d2e406205})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="65"/>
|
||||
<source>channel 3</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, Type: thing, ID: {4165bfb7-f1db-49ce-bad7-34956ea45d03})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="68"/>
|
||||
<source>channel 4</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, Type: thing, ID: {69960183-8fba-4f94-94b4-6d536e28f3a0})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="71"/>
|
||||
<source>channel 5</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, Type: thing, ID: {41a9706c-e6e8-4de8-b280-789f1434f6ed})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="35"/>
|
||||
<source>A</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, Type: thing, ID: {906811d6-e232-42e6-829c-2cdaa9ee5340})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="38"/>
|
||||
<source>B</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, Type: thing, ID: {0d9b27f7-01cc-44bc-99f6-65612dee0027})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="41"/>
|
||||
<source>C</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, Type: thing, ID: {d82d95db-b6b5-4d0b-9ea6-a00fc455a0ff})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="44"/>
|
||||
<source>D</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, Type: thing, ID: {a4a13ee3-605f-4b42-b81b-a26e66f74b26})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="47"/>
|
||||
<source>E</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, Type: thing, ID: {e71ee50f-5c54-4a35-877a-743fe928a528})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="77"/>
|
||||
<source>set power</source>
|
||||
<extracomment>The name of the ActionType ({31c9758e-6567-4f89-85bb-29e1a7c55d44}) of ThingClass elroSocket</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="74"/>
|
||||
<source>power</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, ActionType: power, ID: {004ad008-0084-40be-9b1a-b60e1b30579d})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
@ -1,94 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>Elro</name>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="50"/>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="53"/>
|
||||
<source>Elro</source>
|
||||
<extracomment>The name of the vendor ({435a13a0-65ca-4f0c-94c1-e5873b258db5})
|
||||
----------
|
||||
The name of the plugin Elro ({2b267f81-d9ae-4f4f-89a0-7386b547cfd3})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="56"/>
|
||||
<source>Elro Power Socket</source>
|
||||
<extracomment>The name of the ThingClass ({308ae6e6-38b3-4b3a-a513-3199da2764f8})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="59"/>
|
||||
<source>channel 1</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, Type: thing, ID: {66b2a017-658a-46d9-9e98-33aaed6345ad})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="62"/>
|
||||
<source>channel 2</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, Type: thing, ID: {bda44f42-b608-4c70-a370-8d8d2e406205})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="65"/>
|
||||
<source>channel 3</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, Type: thing, ID: {4165bfb7-f1db-49ce-bad7-34956ea45d03})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="68"/>
|
||||
<source>channel 4</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, Type: thing, ID: {69960183-8fba-4f94-94b4-6d536e28f3a0})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="71"/>
|
||||
<source>channel 5</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, Type: thing, ID: {41a9706c-e6e8-4de8-b280-789f1434f6ed})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="35"/>
|
||||
<source>A</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, Type: thing, ID: {906811d6-e232-42e6-829c-2cdaa9ee5340})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="38"/>
|
||||
<source>B</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, Type: thing, ID: {0d9b27f7-01cc-44bc-99f6-65612dee0027})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="41"/>
|
||||
<source>C</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, Type: thing, ID: {d82d95db-b6b5-4d0b-9ea6-a00fc455a0ff})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="44"/>
|
||||
<source>D</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, Type: thing, ID: {a4a13ee3-605f-4b42-b81b-a26e66f74b26})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="47"/>
|
||||
<source>E</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, Type: thing, ID: {e71ee50f-5c54-4a35-877a-743fe928a528})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="77"/>
|
||||
<source>set power</source>
|
||||
<extracomment>The name of the ActionType ({31c9758e-6567-4f89-85bb-29e1a7c55d44}) of ThingClass elroSocket</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/elro/plugininfo.h" line="74"/>
|
||||
<source>power</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: elroSocket, ActionType: power, ID: {004ad008-0084-40be-9b1a-b60e1b30579d})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
@ -1,4 +0,0 @@
|
||||
# Intertechno
|
||||
|
||||
This plugin allows to control RF 433 MHz actors an receive remote signals from [Intertechno](http://www.intertechno.at) devices.
|
||||
|
||||
@ -1,375 +0,0 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* 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
|
||||
* reproduction, publication, editing and translation, are reserved. The use of
|
||||
* this project is subject to the terms of a license agreement to be concluded
|
||||
* with nymea GmbH in accordance with the terms of use of nymea GmbH, available
|
||||
* under https://nymea.io/license
|
||||
*
|
||||
* GNU Lesser General Public License Usage
|
||||
* Alternatively, this project may be redistributed and/or modified under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free
|
||||
* Software Foundation; version 3. This project is distributed in the hope that
|
||||
* it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this project. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For any further details and any questions please contact us under
|
||||
* contact@nymea.io or see our FAQ/Licensing Information on
|
||||
* https://nymea.io/license/faq
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include "integrationpluginintertechno.h"
|
||||
|
||||
#include "integrations/thing.h"
|
||||
#include "hardware/radio433/radio433.h"
|
||||
#include "plugininfo.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
|
||||
IntegrationPluginIntertechno::IntegrationPluginIntertechno()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void IntegrationPluginIntertechno::executeAction(ThingActionInfo *info)
|
||||
{
|
||||
Thing *thing = info->thing();
|
||||
Action action = info->action();
|
||||
|
||||
if (!hardwareManager()->radio433()->available())
|
||||
return info->finish(Thing::ThingErrorHardwareNotAvailable, QT_TR_NOOP("No 433MHz radio available on this system."));
|
||||
|
||||
QList<int> rawData;
|
||||
QByteArray binCode;
|
||||
|
||||
QString familyCode = thing->paramValue(switchThingFamilyCodeParamTypeId).toString();
|
||||
|
||||
// =======================================
|
||||
// generate bin from family code
|
||||
if (familyCode == "A") {
|
||||
binCode.append("00000000");
|
||||
} else if (familyCode == "B") {
|
||||
binCode.append("01000000");
|
||||
} else if (familyCode == "C") {
|
||||
binCode.append("00010000");
|
||||
} else if (familyCode == "D") {
|
||||
binCode.append("01010000");
|
||||
} else if (familyCode == "E") {
|
||||
binCode.append("00000100");
|
||||
} else if (familyCode == "F") {
|
||||
binCode.append("01000100");
|
||||
} else if (familyCode == "G") {
|
||||
binCode.append("01000000");
|
||||
} else if (familyCode == "H") {
|
||||
binCode.append("01010100");
|
||||
} else if (familyCode == "I") {
|
||||
binCode.append("00000001");
|
||||
} else if (familyCode == "J") {
|
||||
binCode.append("01000001");
|
||||
} else if (familyCode == "K") {
|
||||
binCode.append("00010001");
|
||||
} else if (familyCode == "L") {
|
||||
binCode.append("01010001");
|
||||
} else if (familyCode == "M") {
|
||||
binCode.append("00000101");
|
||||
} else if (familyCode == "N") {
|
||||
binCode.append("01000101");
|
||||
} else if (familyCode == "O") {
|
||||
binCode.append("00010101");
|
||||
} else if (familyCode == "P") {
|
||||
binCode.append("01010101");
|
||||
}
|
||||
|
||||
QString buttonCode = thing->paramValue(switchThingButtonCodeParamTypeId).toString();
|
||||
|
||||
// =======================================
|
||||
// generate bin from button code
|
||||
if (buttonCode == "1") {
|
||||
binCode.append("00000000");
|
||||
} else if (buttonCode == "2") {
|
||||
binCode.append("01000000");
|
||||
} else if (buttonCode == "3") {
|
||||
binCode.append("00010000");
|
||||
} else if (buttonCode == "4") {
|
||||
binCode.append("01010000");
|
||||
} else if (buttonCode == "5") {
|
||||
binCode.append("00000100");
|
||||
} else if (buttonCode == "6") {
|
||||
binCode.append("01000100");
|
||||
} else if (buttonCode == "7") {
|
||||
binCode.append("01000000");
|
||||
} else if (buttonCode == "8") {
|
||||
binCode.append("01010100");
|
||||
} else if (buttonCode == "9") {
|
||||
binCode.append("00000001");
|
||||
} else if (buttonCode == "10") {
|
||||
binCode.append("01000001");
|
||||
} else if (buttonCode == "11") {
|
||||
binCode.append("00010001");
|
||||
} else if (buttonCode == "12") {
|
||||
binCode.append("01010001");
|
||||
} else if (buttonCode == "13") {
|
||||
binCode.append("00000101");
|
||||
} else if (buttonCode == "14") {
|
||||
binCode.append("01000101");
|
||||
} else if (buttonCode == "15") {
|
||||
binCode.append("00010101");
|
||||
} else if (buttonCode == "16") {
|
||||
binCode.append("01010101");
|
||||
}
|
||||
|
||||
if (binCode.length() != 16){
|
||||
return info->finish(Thing::ThingErrorInvalidParameter);
|
||||
}
|
||||
|
||||
// =======================================
|
||||
// add fix nibble (0F)
|
||||
binCode.append("0001");
|
||||
|
||||
// =======================================
|
||||
// add power nibble
|
||||
if (action.param(switchSetPowerActionPowerParamTypeId).value().toBool()) {
|
||||
binCode.append("0101");
|
||||
} else {
|
||||
binCode.append("0100");
|
||||
}
|
||||
// =======================================
|
||||
//create rawData timings list
|
||||
int delay = 350;
|
||||
|
||||
// sync signal
|
||||
rawData.append(1);
|
||||
rawData.append(31);
|
||||
|
||||
// add the code
|
||||
foreach (QChar c, binCode) {
|
||||
if (c == '0') {
|
||||
rawData.append(1);
|
||||
rawData.append(3);
|
||||
} else {
|
||||
rawData.append(3);
|
||||
rawData.append(1);
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================
|
||||
// send data to hardware resource
|
||||
if (hardwareManager()->radio433()->sendData(delay, rawData, 10)) {
|
||||
qCDebug(dcIntertechno) << "transmitted" << pluginName() << thing->name() << "power: " << action.param(switchSetPowerActionPowerParamTypeId).value().toBool();
|
||||
} else {
|
||||
qCWarning(dcIntertechno) << "could not transmitt" << pluginName() << thing->name() << "power: " << action.param(switchSetPowerActionPowerParamTypeId).value().toBool();
|
||||
return info->finish(Thing::ThingErrorHardwareFailure, QT_TR_NOOP("Error sending data."));
|
||||
}
|
||||
return info->finish(Thing::ThingErrorNoError);
|
||||
}
|
||||
|
||||
void IntegrationPluginIntertechno::radioData(const QList<int> &rawData)
|
||||
{
|
||||
// filter right here a wrong signal length
|
||||
if (rawData.length() != 49) {
|
||||
return;
|
||||
}
|
||||
|
||||
// QList<Thing*> deviceList = deviceManager()->findConfiguredDevices(intertechnoRemoteThingClassId);
|
||||
// if (deviceList.isEmpty()) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
int delay = rawData.first()/31;
|
||||
QByteArray binCode;
|
||||
|
||||
// =======================================
|
||||
// average 314
|
||||
if (delay > 300 && delay < 400) {
|
||||
// go trough all 48 timings (without sync signal)
|
||||
for (int i = 1; i <= 48; i+=2 ) {
|
||||
int div;
|
||||
int divNext;
|
||||
|
||||
// if short
|
||||
if (rawData.at(i) <= 700) {
|
||||
div = 1;
|
||||
} else {
|
||||
div = 3;
|
||||
}
|
||||
// if long
|
||||
if (rawData.at(i+1) < 700) {
|
||||
divNext = 1;
|
||||
} else {
|
||||
divNext = 3;
|
||||
}
|
||||
|
||||
// _
|
||||
// if we have | |___ = 0 -> in 4 delays => 1000
|
||||
// _
|
||||
// if we have ___| | = 1 -> in 4 delays => 0001
|
||||
|
||||
if (div == 1 && divNext == 3) {
|
||||
binCode.append('0');
|
||||
} else if (div == 3 && divNext == 1) {
|
||||
binCode.append('1');
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
// =======================================
|
||||
// Check nibble 16-19, must be 0001
|
||||
if (binCode.mid(16,4) != "0001") {
|
||||
return;
|
||||
}
|
||||
|
||||
// =======================================
|
||||
// Get family code
|
||||
QString familyCode;
|
||||
bool ok;
|
||||
QByteArray familyCodeBin = binCode.left(8);
|
||||
int famiyCodeInt = familyCodeBin.toInt(&ok,2);
|
||||
|
||||
if (!ok)
|
||||
return;
|
||||
|
||||
switch (famiyCodeInt) {
|
||||
case 0b00000000:
|
||||
familyCode = "A";
|
||||
break;
|
||||
case 0b01000000:
|
||||
familyCode = "B";
|
||||
break;
|
||||
case 0b00010000:
|
||||
familyCode = "C";
|
||||
break;
|
||||
case 0b01010000:
|
||||
familyCode = "D";
|
||||
break;
|
||||
case 0b00000100:
|
||||
familyCode = "E";
|
||||
break;
|
||||
case 0b01000100:
|
||||
familyCode = "F";
|
||||
break;
|
||||
case 0b00010100:
|
||||
familyCode = "G";
|
||||
break;
|
||||
case 0b01010100:
|
||||
familyCode = "H";
|
||||
break;
|
||||
case 0b00000001:
|
||||
familyCode = "I";
|
||||
break;
|
||||
case 0b01000001:
|
||||
familyCode = "J";
|
||||
break;
|
||||
case 0b00010001:
|
||||
familyCode = "K";
|
||||
break;
|
||||
case 0b01010001:
|
||||
familyCode = "L";
|
||||
break;
|
||||
case 0b00000101:
|
||||
familyCode = "M";
|
||||
break;
|
||||
case 0b01000101:
|
||||
familyCode = "N";
|
||||
break;
|
||||
case 0b00010101:
|
||||
familyCode = "O";
|
||||
break;
|
||||
case 0b01010101:
|
||||
familyCode = "P";
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
// =======================================
|
||||
// Get button code
|
||||
QString buttonCode;
|
||||
QByteArray buttonCodeBin = binCode.mid(8,8);
|
||||
int buttonCodeInt = buttonCodeBin.toInt(&ok,2);
|
||||
|
||||
if (!ok)
|
||||
return;
|
||||
|
||||
switch (buttonCodeInt) {
|
||||
case 0b00000000:
|
||||
buttonCode = "1";
|
||||
break;
|
||||
case 0b01000000:
|
||||
buttonCode = "2";
|
||||
break;
|
||||
case 0b00010000:
|
||||
buttonCode = "3";
|
||||
break;
|
||||
case 0b01010000:
|
||||
buttonCode = "4";
|
||||
break;
|
||||
case 0b00000100:
|
||||
buttonCode = "5";
|
||||
break;
|
||||
case 0b01000100:
|
||||
buttonCode = "6";
|
||||
break;
|
||||
case 0b00010100:
|
||||
buttonCode = "7";
|
||||
break;
|
||||
case 0b01010100:
|
||||
buttonCode = "8";
|
||||
break;
|
||||
case 0b00000001:
|
||||
buttonCode = "9";
|
||||
break;
|
||||
case 0b01000001:
|
||||
buttonCode = "10";
|
||||
break;
|
||||
case 0b00010001:
|
||||
buttonCode = "11";
|
||||
break;
|
||||
case 0b01010001:
|
||||
buttonCode = "12";
|
||||
break;
|
||||
case 0b00000101:
|
||||
buttonCode = "13";
|
||||
break;
|
||||
case 0b01000101:
|
||||
buttonCode = "14";
|
||||
break;
|
||||
case 0b00010101:
|
||||
buttonCode = "15";
|
||||
break;
|
||||
case 0b01010101:
|
||||
buttonCode = "16";
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
// =======================================
|
||||
// get power status -> On = 0100, Off = 0001
|
||||
bool power;
|
||||
if (binCode.right(4).toInt(0,2) == 5) {
|
||||
power = true;
|
||||
} else if (binCode.right(4).toInt(0,2) == 4) {
|
||||
power = false;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
qCDebug(dcIntertechno) << "Intertechno: family code = " << familyCode << "button code =" << buttonCode << power;
|
||||
|
||||
}
|
||||
@ -1,53 +0,0 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* 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
|
||||
* reproduction, publication, editing and translation, are reserved. The use of
|
||||
* this project is subject to the terms of a license agreement to be concluded
|
||||
* with nymea GmbH in accordance with the terms of use of nymea GmbH, available
|
||||
* under https://nymea.io/license
|
||||
*
|
||||
* GNU Lesser General Public License Usage
|
||||
* Alternatively, this project may be redistributed and/or modified under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free
|
||||
* Software Foundation; version 3. This project is distributed in the hope that
|
||||
* it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this project. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For any further details and any questions please contact us under
|
||||
* contact@nymea.io or see our FAQ/Licensing Information on
|
||||
* https://nymea.io/license/faq
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef INTEGRATIONPLUGININTERTECHNO_H
|
||||
#define INTEGRATIONPLUGININTERTECHNO_H
|
||||
|
||||
#include "integrations/integrationplugin.h"
|
||||
|
||||
class IntegrationPluginIntertechno : public IntegrationPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PLUGIN_METADATA(IID "io.nymea.IntegrationPlugin" FILE "integrationpluginintertechno.json")
|
||||
Q_INTERFACES(IntegrationPlugin)
|
||||
|
||||
public:
|
||||
explicit IntegrationPluginIntertechno();
|
||||
|
||||
void radioData(const QList<int> &rawData);
|
||||
|
||||
public slots:
|
||||
void executeAction(ThingActionInfo *info) override;
|
||||
|
||||
};
|
||||
|
||||
#endif // INTEGRATIONPLUGININTERTECHNO_H
|
||||
@ -1,52 +0,0 @@
|
||||
{
|
||||
"name": "Intertechno",
|
||||
"displayName": "Intertechno",
|
||||
"id": "e998d934-0397-42c1-ad63-9141bcac8563",
|
||||
"vendors": [
|
||||
{
|
||||
"name": "Intertechno",
|
||||
"displayName": "Intertechno",
|
||||
"id": "6a852bc2-34dd-4f4c-9ac9-dd4c32ddbcba",
|
||||
"thingClasses": [
|
||||
{
|
||||
"id": "324219e8-7c53-41b5-b314-c2900cd15252",
|
||||
"name": "switch",
|
||||
"displayName": "Intertechno switch",
|
||||
"createMethods": ["user"],
|
||||
"paramTypes": [
|
||||
{
|
||||
"id": "c4e2ec44-5e8e-4168-9f6d-a905ea3329c9",
|
||||
"name": "familyCode",
|
||||
"displayName": "family code",
|
||||
"type": "QString",
|
||||
"allowedValues": ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P"]
|
||||
},
|
||||
{
|
||||
"id": "abb67f92-2e3b-40e2-9106-e538e1882d11",
|
||||
"name": "buttonCode",
|
||||
"displayName": "button code",
|
||||
"type": "int",
|
||||
"minValue": 1,
|
||||
"maxValue": 16
|
||||
}
|
||||
],
|
||||
"actionTypes": [
|
||||
{
|
||||
"id": "df19fb51-c3cd-4b95-8d88-ebbb535f4789",
|
||||
"name": "setPower",
|
||||
"displayName": "set power",
|
||||
"paramTypes": [
|
||||
{
|
||||
"id": "8de21063-631c-4419-be5d-235cea3cd906",
|
||||
"name": "power",
|
||||
"displayName": "power",
|
||||
"type": "bool"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
include(../plugins.pri)
|
||||
|
||||
TARGET = $$qtLibraryTarget(nymea_integrationpluginintertechno)
|
||||
|
||||
SOURCES += \
|
||||
integrationpluginintertechno.cpp
|
||||
|
||||
HEADERS += \
|
||||
integrationpluginintertechno.h
|
||||
|
||||
|
||||
@ -1,59 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="de_DE">
|
||||
<context>
|
||||
<name>IntegrationPluginIntertechno</name>
|
||||
<message>
|
||||
<location filename="../integrationpluginintertechno.cpp" line="52"/>
|
||||
<source>No 433MHz radio available on this system.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../integrationpluginintertechno.cpp" line="173"/>
|
||||
<source>Error sending data.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Intertechno</name>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/intertechno/plugininfo.h" line="27"/>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/intertechno/plugininfo.h" line="30"/>
|
||||
<source>Intertechno</source>
|
||||
<extracomment>The name of the vendor ({6a852bc2-34dd-4f4c-9ac9-dd4c32ddbcba})
|
||||
----------
|
||||
The name of the plugin Intertechno ({e998d934-0397-42c1-ad63-9141bcac8563})</extracomment>
|
||||
<translation>Intertechno</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/intertechno/plugininfo.h" line="33"/>
|
||||
<source>Intertechno switch</source>
|
||||
<extracomment>The name of the ThingClass ({324219e8-7c53-41b5-b314-c2900cd15252})</extracomment>
|
||||
<translation>Intertechno Steckdose</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/intertechno/plugininfo.h" line="39"/>
|
||||
<source>family code</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: switch, Type: thing, ID: {c4e2ec44-5e8e-4168-9f6d-a905ea3329c9})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/intertechno/plugininfo.h" line="36"/>
|
||||
<source>button code</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: switch, Type: thing, ID: {abb67f92-2e3b-40e2-9106-e538e1882d11})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/intertechno/plugininfo.h" line="45"/>
|
||||
<source>set power</source>
|
||||
<extracomment>The name of the ActionType ({df19fb51-c3cd-4b95-8d88-ebbb535f4789}) of ThingClass switch</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/intertechno/plugininfo.h" line="42"/>
|
||||
<source>power</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: switch, ActionType: setPower, ID: {8de21063-631c-4419-be5d-235cea3cd906})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
@ -1,59 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>IntegrationPluginIntertechno</name>
|
||||
<message>
|
||||
<location filename="../integrationpluginintertechno.cpp" line="52"/>
|
||||
<source>No 433MHz radio available on this system.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../integrationpluginintertechno.cpp" line="173"/>
|
||||
<source>Error sending data.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Intertechno</name>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/intertechno/plugininfo.h" line="27"/>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/intertechno/plugininfo.h" line="30"/>
|
||||
<source>Intertechno</source>
|
||||
<extracomment>The name of the vendor ({6a852bc2-34dd-4f4c-9ac9-dd4c32ddbcba})
|
||||
----------
|
||||
The name of the plugin Intertechno ({e998d934-0397-42c1-ad63-9141bcac8563})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/intertechno/plugininfo.h" line="33"/>
|
||||
<source>Intertechno switch</source>
|
||||
<extracomment>The name of the ThingClass ({324219e8-7c53-41b5-b314-c2900cd15252})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/intertechno/plugininfo.h" line="39"/>
|
||||
<source>family code</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: switch, Type: thing, ID: {c4e2ec44-5e8e-4168-9f6d-a905ea3329c9})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/intertechno/plugininfo.h" line="36"/>
|
||||
<source>button code</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: switch, Type: thing, ID: {abb67f92-2e3b-40e2-9106-e538e1882d11})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/intertechno/plugininfo.h" line="45"/>
|
||||
<source>set power</source>
|
||||
<extracomment>The name of the ActionType ({df19fb51-c3cd-4b95-8d88-ebbb535f4789}) of ThingClass switch</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/intertechno/plugininfo.h" line="42"/>
|
||||
<source>power</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: switch, ActionType: setPower, ID: {8de21063-631c-4419-be5d-235cea3cd906})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
@ -1,8 +0,0 @@
|
||||
# Leynew
|
||||
|
||||
This plugin allows to control RF 433 MHz actors an receive remote signals from [Leynew](http://www.leynew.com/en/)
|
||||
devices.
|
||||
|
||||
Currently only the following device is supported:
|
||||
|
||||
[http://www.leynew.com/en/productview.asp?id=589](http://www.leynew.com/en/productview.asp?id=589)
|
||||
@ -1,160 +0,0 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* 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
|
||||
* reproduction, publication, editing and translation, are reserved. The use of
|
||||
* this project is subject to the terms of a license agreement to be concluded
|
||||
* with nymea GmbH in accordance with the terms of use of nymea GmbH, available
|
||||
* under https://nymea.io/license
|
||||
*
|
||||
* GNU Lesser General Public License Usage
|
||||
* Alternatively, this project may be redistributed and/or modified under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free
|
||||
* Software Foundation; version 3. This project is distributed in the hope that
|
||||
* it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this project. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For any further details and any questions please contact us under
|
||||
* contact@nymea.io or see our FAQ/Licensing Information on
|
||||
* https://nymea.io/license/faq
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include "integrationpluginleynew.h"
|
||||
#include "plugininfo.h"
|
||||
#include "hardware/radio433/radio433.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
|
||||
IntegrationPluginLeynew::IntegrationPluginLeynew()
|
||||
{
|
||||
}
|
||||
|
||||
void IntegrationPluginLeynew::setupThing(ThingSetupInfo *info)
|
||||
{
|
||||
if (!hardwareManager()->radio433()->available()) {
|
||||
return info->finish(Thing::ThingErrorHardwareNotAvailable, QT_TR_NOOP("No 433 MHz radio available on this system."));
|
||||
}
|
||||
}
|
||||
|
||||
void IntegrationPluginLeynew::executeAction(ThingActionInfo *info)
|
||||
{
|
||||
if (!hardwareManager()->radio433()->available()) {
|
||||
return info->finish(Thing::ThingErrorHardwareNotAvailable, QT_TR_NOOP("No 433 MHz radio available on this system."));
|
||||
}
|
||||
|
||||
Thing *thing = info->thing();
|
||||
Action action = info->action();
|
||||
|
||||
QList<int> rawData;
|
||||
QByteArray binCode;
|
||||
|
||||
|
||||
// TODO: find out how the id will be calculated to bin code or make it discoverable
|
||||
// =======================================
|
||||
// bincode depending on the id
|
||||
if (thing->paramValue(rfControllerThingIdParamTypeId) == "0115"){
|
||||
binCode.append("001101000001");
|
||||
} else if (thing->paramValue(rfControllerThingIdParamTypeId) == "0014") {
|
||||
binCode.append("110000010101");
|
||||
} else if (thing->paramValue(rfControllerThingIdParamTypeId) == "0008") {
|
||||
binCode.append("111101010101");
|
||||
} else {
|
||||
qCWarning(dcLeynew) << "Could not get id of thing: invalid parameter" << thing->paramValue(rfControllerThingIdParamTypeId);
|
||||
return info->finish(Thing::ThingErrorInvalidParameter);
|
||||
}
|
||||
|
||||
int repetitions = 12;
|
||||
// =======================================
|
||||
// bincode depending on the action
|
||||
if (action.actionTypeId() == rfControllerBrightnessUpActionTypeId) {
|
||||
binCode.append("000000000011");
|
||||
repetitions = 8;
|
||||
} else if (action.actionTypeId() == rfControllerBrightnessDownActionTypeId) {
|
||||
binCode.append("000000001100");
|
||||
repetitions = 8;
|
||||
} else if (action.actionTypeId() == rfControllerPowerActionTypeId) {
|
||||
binCode.append("000011000000");
|
||||
} else if (action.actionTypeId() == rfControllerRedActionTypeId) {
|
||||
binCode.append("000000001111");
|
||||
} else if (action.actionTypeId() == rfControllerGreenActionTypeId) {
|
||||
binCode.append("000000110011");
|
||||
} else if (action.actionTypeId() == rfControllerBlueActionTypeId) {
|
||||
binCode.append("000011000011");
|
||||
} else if (action.actionTypeId() == rfControllerWhiteActionTypeId) {
|
||||
binCode.append("000000111100");
|
||||
} else if (action.actionTypeId() == rfControllerOrangeActionTypeId) {
|
||||
binCode.append("000011001100");
|
||||
} else if (action.actionTypeId() == rfControllerYellowActionTypeId) {
|
||||
binCode.append("000011110000");
|
||||
} else if (action.actionTypeId() == rfControllerCyanActionTypeId) {
|
||||
binCode.append("001100000011");
|
||||
} else if (action.actionTypeId() == rfControllerPurpleActionTypeId) {
|
||||
binCode.append("110000000011");
|
||||
} else if (action.actionTypeId() == rfControllerPlayPauseActionTypeId) {
|
||||
binCode.append("000000110000");
|
||||
} else if (action.actionTypeId() == rfControllerSpeedUpActionTypeId) {
|
||||
binCode.append("001100110000");
|
||||
repetitions = 8;
|
||||
} else if (action.actionTypeId() == rfControllerSpeedDownActionTypeId) {
|
||||
binCode.append("110000000000");
|
||||
repetitions = 8;
|
||||
} else if (action.actionTypeId() == rfControllerAutoActionTypeId) {
|
||||
binCode.append("001100001100");
|
||||
} else if (action.actionTypeId() == rfControllerFlashActionTypeId) {
|
||||
binCode.append("110011000000");
|
||||
} else if (action.actionTypeId() == rfControllerJump3ActionTypeId) {
|
||||
binCode.append("111100001100");
|
||||
} else if (action.actionTypeId() == rfControllerJump7ActionTypeId) {
|
||||
binCode.append("001111000000");
|
||||
} else if (action.actionTypeId() == rfControllerFade3ActionTypeId) {
|
||||
binCode.append("110000110000");
|
||||
} else if (action.actionTypeId() == rfControllerFade7ActionTypeId) {
|
||||
binCode.append("001100000000");
|
||||
} else {
|
||||
return info->finish(Thing::ThingErrorActionTypeNotFound);
|
||||
}
|
||||
|
||||
// =======================================
|
||||
//create rawData timings list
|
||||
int delay = 50;
|
||||
|
||||
// sync signal (starting with ON)
|
||||
rawData.append(3);
|
||||
rawData.append(90);
|
||||
|
||||
// add the code
|
||||
foreach (QChar c, binCode) {
|
||||
if(c == '0'){
|
||||
// _
|
||||
// | |_ _
|
||||
rawData.append(3);
|
||||
rawData.append(9);
|
||||
}else{
|
||||
// _ _
|
||||
// | |_
|
||||
rawData.append(9);
|
||||
rawData.append(3);
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================
|
||||
// send data to hardware resource
|
||||
if(hardwareManager()->radio433()->sendData(delay, rawData, repetitions)){
|
||||
qCDebug(dcLeynew) << "Transmitted" << pluginName() << thing->name();
|
||||
}else{
|
||||
qCWarning(dcLeynew) << "Could not transmitt" << pluginName() << thing->name();
|
||||
return info->finish(Thing::ThingErrorHardwareFailure, QT_TR_NOOP("Error sending data."));
|
||||
}
|
||||
|
||||
info->finish(Thing::ThingErrorNoError);
|
||||
}
|
||||
@ -1,52 +0,0 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* 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
|
||||
* reproduction, publication, editing and translation, are reserved. The use of
|
||||
* this project is subject to the terms of a license agreement to be concluded
|
||||
* with nymea GmbH in accordance with the terms of use of nymea GmbH, available
|
||||
* under https://nymea.io/license
|
||||
*
|
||||
* GNU Lesser General Public License Usage
|
||||
* Alternatively, this project may be redistributed and/or modified under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free
|
||||
* Software Foundation; version 3. This project is distributed in the hope that
|
||||
* it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this project. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For any further details and any questions please contact us under
|
||||
* contact@nymea.io or see our FAQ/Licensing Information on
|
||||
* https://nymea.io/license/faq
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef INTEGRATIONPLUGINLEYNEW_H
|
||||
#define INTEGRATIONPLUGINLEYNEW_H
|
||||
|
||||
#include "integrations/integrationplugin.h"
|
||||
|
||||
class IntegrationPluginLeynew : public IntegrationPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PLUGIN_METADATA(IID "io.nymea.IntegrationPlugin" FILE "integrationpluginleynew.json")
|
||||
Q_INTERFACES(IntegrationPlugin)
|
||||
|
||||
public:
|
||||
explicit IntegrationPluginLeynew();
|
||||
|
||||
void setupThing(ThingSetupInfo *info) override;
|
||||
|
||||
void executeAction(ThingActionInfo *info) override;
|
||||
|
||||
};
|
||||
|
||||
#endif // INTEGRATIONPLUGINLEYNEW_H
|
||||
@ -1,132 +0,0 @@
|
||||
{
|
||||
"displayName": "Leynew",
|
||||
"name": "Leynew",
|
||||
"id": "9a6d23e6-fad8-4203-aeab-2e6e5c756990",
|
||||
"vendors": [
|
||||
{
|
||||
"displayName": "Leynew",
|
||||
"name": "leynew",
|
||||
"id": "83c649b4-49b0-4482-9334-d86a85bfbd2a",
|
||||
"thingClasses": [
|
||||
{
|
||||
"id": "6b1f8f37-7eb4-46c4-9f15-a6eb4904999c",
|
||||
"name": "rfController",
|
||||
"displayName": "RF Controller (LN-CON-RF20B)",
|
||||
"createMethods": ["user"],
|
||||
"paramTypes": [
|
||||
{
|
||||
"id": "09e28309-693c-4c89-9ad8-58b643794e85",
|
||||
"name": "id",
|
||||
"displayName": "id",
|
||||
"type": "QString",
|
||||
"inputType": "TextLine",
|
||||
"allowedValues": ["0008", "0115", "0014"]
|
||||
}
|
||||
],
|
||||
"actionTypes": [
|
||||
{
|
||||
"id": "18a30ff1-28d7-4cd0-8388-290db52cd48d",
|
||||
"name": "brightnessUp",
|
||||
"displayName": "brightness up"
|
||||
},
|
||||
{
|
||||
"id": "d1d251b6-ffe6-4b0c-bf03-bfa8947caa1d",
|
||||
"name": "brightnessDown",
|
||||
"displayName": "brightness down"
|
||||
},
|
||||
{
|
||||
"id": "b8b4ef78-126f-431b-b33f-742754da5af4",
|
||||
"name": "playPause",
|
||||
"displayName": "play / pause"
|
||||
},
|
||||
{
|
||||
"id": "35495871-3b80-458b-b60d-5dc614c9fbf1",
|
||||
"name": "power",
|
||||
"displayName": "power"
|
||||
},
|
||||
{
|
||||
"id": "737f77b6-fe2a-45ad-9945-8f0197e57741",
|
||||
"name": "red",
|
||||
"displayName": "red"
|
||||
},
|
||||
{
|
||||
"id": "6471e804-fd54-41dd-88ed-ec46d6cc33db",
|
||||
"name": "green",
|
||||
"displayName": "green"
|
||||
},
|
||||
{
|
||||
"id": "3abfe3c4-f9b3-4b22-aa3a-86ef99adedbe",
|
||||
"name": "blue",
|
||||
"displayName": "blue"
|
||||
},
|
||||
{
|
||||
"id": "6a92d30d-7bce-4238-8e05-d25d3475699c",
|
||||
"name": "white",
|
||||
"displayName": "white"
|
||||
},
|
||||
{
|
||||
"id": "10a145db-adea-4eff-921d-4ce1ceb940cd",
|
||||
"name": "orange",
|
||||
"displayName": "orange"
|
||||
},
|
||||
{
|
||||
"id": "46bbfb97-1600-4e91-930d-6ef4be7bdd9c",
|
||||
"name": "yellow",
|
||||
"displayName": "yellow"
|
||||
},
|
||||
{
|
||||
"id": "7e1db150-c68f-4c54-8259-61d050f31555",
|
||||
"name": "cyan",
|
||||
"displayName": "cyan"
|
||||
},
|
||||
{
|
||||
"id": "4008076e-ff8c-400b-8983-0a452ed66509",
|
||||
"name": "purple",
|
||||
"displayName": "purple"
|
||||
},
|
||||
{
|
||||
"id": "c692b7b0-f891-4729-8e76-4e67f1f6ff4a",
|
||||
"name": "auto",
|
||||
"displayName": "auto"
|
||||
},
|
||||
{
|
||||
"id": "14e696ef-6f9f-4095-9731-5f9e541dd416",
|
||||
"name": "jump3",
|
||||
"displayName": "jump 3"
|
||||
},
|
||||
{
|
||||
"id": "1e764e9f-5ff1-4cd1-b3a8-7feb2a3f204c",
|
||||
"name": "fade3",
|
||||
"displayName": "fade 3"
|
||||
},
|
||||
{
|
||||
"id": "85b37c46-a44c-4989-add2-06b5537fe1a1",
|
||||
"name": "speedUp",
|
||||
"displayName": "speed up"
|
||||
},
|
||||
{
|
||||
"id": "7fdb9f73-e773-4839-9137-3771feabe3e9",
|
||||
"name": "speedDown",
|
||||
"displayName": "speed down"
|
||||
},
|
||||
{
|
||||
"id": "851e024b-0eee-4eec-8261-478c28c03557",
|
||||
"name": "fade7",
|
||||
"displayName": "fade 7"
|
||||
},
|
||||
{
|
||||
"id": "c40392be-323d-48db-a076-40cf4d8cc7eb",
|
||||
"name": "jump7",
|
||||
"displayName": "jump 7"
|
||||
},
|
||||
{
|
||||
"id": "db700960-2b02-4ad3-8257-a28cb5fc6356",
|
||||
"name": "flash",
|
||||
"displayName": "flash"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
include(../plugins.pri)
|
||||
|
||||
TARGET = $$qtLibraryTarget(nymea_integrationpluginleynew)
|
||||
|
||||
SOURCES += \
|
||||
integrationpluginleynew.cpp
|
||||
|
||||
HEADERS += \
|
||||
integrationpluginleynew.h
|
||||
|
||||
|
||||
@ -1,162 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="de_DE">
|
||||
<context>
|
||||
<name>IntegrationPluginLeynew</name>
|
||||
<message>
|
||||
<location filename="../integrationpluginleynew.cpp" line="45"/>
|
||||
<location filename="../integrationpluginleynew.cpp" line="52"/>
|
||||
<source>No 433 MHz radio available on this system.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../integrationpluginleynew.cpp" line="156"/>
|
||||
<source>Error sending data.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Leynew</name>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="44"/>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="47"/>
|
||||
<source>Leynew</source>
|
||||
<extracomment>The name of the vendor ({83c649b4-49b0-4482-9334-d86a85bfbd2a})
|
||||
----------
|
||||
The name of the plugin Leynew ({9a6d23e6-fad8-4203-aeab-2e6e5c756990})</extracomment>
|
||||
<translation>Leynew</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="50"/>
|
||||
<source>RF Controller (LN-CON-RF20B)</source>
|
||||
<extracomment>The name of the ThingClass ({6b1f8f37-7eb4-46c4-9f15-a6eb4904999c})</extracomment>
|
||||
<translation>RF Kontroller (LN-CON-RF20B)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="80"/>
|
||||
<source>id</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: rfController, Type: thing, ID: {09e28309-693c-4c89-9ad8-58b643794e85})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="62"/>
|
||||
<source>brightness up</source>
|
||||
<extracomment>The name of the ActionType ({18a30ff1-28d7-4cd0-8388-290db52cd48d}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="59"/>
|
||||
<source>brightness down</source>
|
||||
<extracomment>The name of the ActionType ({d1d251b6-ffe6-4b0c-bf03-bfa8947caa1d}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="92"/>
|
||||
<source>play / pause</source>
|
||||
<extracomment>The name of the ActionType ({b8b4ef78-126f-431b-b33f-742754da5af4}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="95"/>
|
||||
<source>power</source>
|
||||
<extracomment>The name of the ActionType ({35495871-3b80-458b-b60d-5dc614c9fbf1}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="101"/>
|
||||
<source>red</source>
|
||||
<extracomment>The name of the ActionType ({737f77b6-fe2a-45ad-9945-8f0197e57741}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="77"/>
|
||||
<source>green</source>
|
||||
<extracomment>The name of the ActionType ({6471e804-fd54-41dd-88ed-ec46d6cc33db}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="56"/>
|
||||
<source>blue</source>
|
||||
<extracomment>The name of the ActionType ({3abfe3c4-f9b3-4b22-aa3a-86ef99adedbe}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="110"/>
|
||||
<source>white</source>
|
||||
<extracomment>The name of the ActionType ({6a92d30d-7bce-4238-8e05-d25d3475699c}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="89"/>
|
||||
<source>orange</source>
|
||||
<extracomment>The name of the ActionType ({10a145db-adea-4eff-921d-4ce1ceb940cd}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="113"/>
|
||||
<source>yellow</source>
|
||||
<extracomment>The name of the ActionType ({46bbfb97-1600-4e91-930d-6ef4be7bdd9c}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="65"/>
|
||||
<source>cyan</source>
|
||||
<extracomment>The name of the ActionType ({7e1db150-c68f-4c54-8259-61d050f31555}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="98"/>
|
||||
<source>purple</source>
|
||||
<extracomment>The name of the ActionType ({4008076e-ff8c-400b-8983-0a452ed66509}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="53"/>
|
||||
<source>auto</source>
|
||||
<extracomment>The name of the ActionType ({c692b7b0-f891-4729-8e76-4e67f1f6ff4a}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="83"/>
|
||||
<source>jump 3</source>
|
||||
<extracomment>The name of the ActionType ({14e696ef-6f9f-4095-9731-5f9e541dd416}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="68"/>
|
||||
<source>fade 3</source>
|
||||
<extracomment>The name of the ActionType ({1e764e9f-5ff1-4cd1-b3a8-7feb2a3f204c}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="107"/>
|
||||
<source>speed up</source>
|
||||
<extracomment>The name of the ActionType ({85b37c46-a44c-4989-add2-06b5537fe1a1}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="104"/>
|
||||
<source>speed down</source>
|
||||
<extracomment>The name of the ActionType ({7fdb9f73-e773-4839-9137-3771feabe3e9}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="71"/>
|
||||
<source>fade 7</source>
|
||||
<extracomment>The name of the ActionType ({851e024b-0eee-4eec-8261-478c28c03557}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="86"/>
|
||||
<source>jump 7</source>
|
||||
<extracomment>The name of the ActionType ({c40392be-323d-48db-a076-40cf4d8cc7eb}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="74"/>
|
||||
<source>flash</source>
|
||||
<extracomment>The name of the ActionType ({db700960-2b02-4ad3-8257-a28cb5fc6356}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
@ -1,162 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>IntegrationPluginLeynew</name>
|
||||
<message>
|
||||
<location filename="../integrationpluginleynew.cpp" line="45"/>
|
||||
<location filename="../integrationpluginleynew.cpp" line="52"/>
|
||||
<source>No 433 MHz radio available on this system.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../integrationpluginleynew.cpp" line="156"/>
|
||||
<source>Error sending data.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Leynew</name>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="44"/>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="47"/>
|
||||
<source>Leynew</source>
|
||||
<extracomment>The name of the vendor ({83c649b4-49b0-4482-9334-d86a85bfbd2a})
|
||||
----------
|
||||
The name of the plugin Leynew ({9a6d23e6-fad8-4203-aeab-2e6e5c756990})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="50"/>
|
||||
<source>RF Controller (LN-CON-RF20B)</source>
|
||||
<extracomment>The name of the ThingClass ({6b1f8f37-7eb4-46c4-9f15-a6eb4904999c})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="80"/>
|
||||
<source>id</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: rfController, Type: thing, ID: {09e28309-693c-4c89-9ad8-58b643794e85})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="62"/>
|
||||
<source>brightness up</source>
|
||||
<extracomment>The name of the ActionType ({18a30ff1-28d7-4cd0-8388-290db52cd48d}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="59"/>
|
||||
<source>brightness down</source>
|
||||
<extracomment>The name of the ActionType ({d1d251b6-ffe6-4b0c-bf03-bfa8947caa1d}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="92"/>
|
||||
<source>play / pause</source>
|
||||
<extracomment>The name of the ActionType ({b8b4ef78-126f-431b-b33f-742754da5af4}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="95"/>
|
||||
<source>power</source>
|
||||
<extracomment>The name of the ActionType ({35495871-3b80-458b-b60d-5dc614c9fbf1}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="101"/>
|
||||
<source>red</source>
|
||||
<extracomment>The name of the ActionType ({737f77b6-fe2a-45ad-9945-8f0197e57741}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="77"/>
|
||||
<source>green</source>
|
||||
<extracomment>The name of the ActionType ({6471e804-fd54-41dd-88ed-ec46d6cc33db}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="56"/>
|
||||
<source>blue</source>
|
||||
<extracomment>The name of the ActionType ({3abfe3c4-f9b3-4b22-aa3a-86ef99adedbe}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="110"/>
|
||||
<source>white</source>
|
||||
<extracomment>The name of the ActionType ({6a92d30d-7bce-4238-8e05-d25d3475699c}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="89"/>
|
||||
<source>orange</source>
|
||||
<extracomment>The name of the ActionType ({10a145db-adea-4eff-921d-4ce1ceb940cd}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="113"/>
|
||||
<source>yellow</source>
|
||||
<extracomment>The name of the ActionType ({46bbfb97-1600-4e91-930d-6ef4be7bdd9c}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="65"/>
|
||||
<source>cyan</source>
|
||||
<extracomment>The name of the ActionType ({7e1db150-c68f-4c54-8259-61d050f31555}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="98"/>
|
||||
<source>purple</source>
|
||||
<extracomment>The name of the ActionType ({4008076e-ff8c-400b-8983-0a452ed66509}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="53"/>
|
||||
<source>auto</source>
|
||||
<extracomment>The name of the ActionType ({c692b7b0-f891-4729-8e76-4e67f1f6ff4a}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="83"/>
|
||||
<source>jump 3</source>
|
||||
<extracomment>The name of the ActionType ({14e696ef-6f9f-4095-9731-5f9e541dd416}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="68"/>
|
||||
<source>fade 3</source>
|
||||
<extracomment>The name of the ActionType ({1e764e9f-5ff1-4cd1-b3a8-7feb2a3f204c}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="107"/>
|
||||
<source>speed up</source>
|
||||
<extracomment>The name of the ActionType ({85b37c46-a44c-4989-add2-06b5537fe1a1}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="104"/>
|
||||
<source>speed down</source>
|
||||
<extracomment>The name of the ActionType ({7fdb9f73-e773-4839-9137-3771feabe3e9}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="71"/>
|
||||
<source>fade 7</source>
|
||||
<extracomment>The name of the ActionType ({851e024b-0eee-4eec-8261-478c28c03557}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="86"/>
|
||||
<source>jump 7</source>
|
||||
<extracomment>The name of the ActionType ({c40392be-323d-48db-a076-40cf4d8cc7eb}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/leynew/plugininfo.h" line="74"/>
|
||||
<source>flash</source>
|
||||
<extracomment>The name of the ActionType ({db700960-2b02-4ad3-8257-a28cb5fc6356}) of ThingClass rfController</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
@ -16,17 +16,14 @@ PLUGIN_DIRS = \
|
||||
dweetio \
|
||||
dynatrace \
|
||||
elgato \
|
||||
elro \
|
||||
eq-3 \
|
||||
flowercare \
|
||||
genericelements \
|
||||
genericthings \
|
||||
gpio \
|
||||
httpcommander \
|
||||
intertechno \
|
||||
keba \
|
||||
kodi \
|
||||
leynew \
|
||||
lgsmarttv \
|
||||
mailnotification \
|
||||
mqttclient \
|
||||
@ -56,7 +53,6 @@ PLUGIN_DIRS = \
|
||||
tuya \
|
||||
udpcommander \
|
||||
unifi \
|
||||
unitec \
|
||||
usbrelay \
|
||||
wakeonlan \
|
||||
wemo \
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
# Unitec
|
||||
|
||||
This plugin allows to controll RF 433 MHz actors an receive remote signals from Unitec devices.
|
||||
|
||||
## Usage
|
||||
|
||||
The unitec socket units have a teach function. If you plug in the switch, a red light will start blinking. That means the socket is now in teaching mode. This Unitec switch (48111) can now be added to nymea with the desired Channel (A,B,C or D).
|
||||
|
||||
To pair the socket the power ON button must be pressed, and the switch needs to be in the pairing mode. If the pairing was successful, the switch will turn on.
|
||||
|
||||
NOTE: If a switch loses power once, it needs to be repaired, the devices do not store the teached channel.
|
||||
|
||||
## Supported Things
|
||||
|
||||
* Unitec switch (48111)
|
||||
* Select channel
|
||||
* Power on/off
|
||||
* No internet connection required
|
||||
|
||||
## Requirements
|
||||
|
||||
* 433MHz RF transceiver
|
||||
* The package “nymea-plugin-anel” must be installed
|
||||
|
||||
## More
|
||||
|
||||
Unitec: http://www.unitec-elektro.de
|
||||
@ -1,119 +0,0 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* 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
|
||||
* reproduction, publication, editing and translation, are reserved. The use of
|
||||
* this project is subject to the terms of a license agreement to be concluded
|
||||
* with nymea GmbH in accordance with the terms of use of nymea GmbH, available
|
||||
* under https://nymea.io/license
|
||||
*
|
||||
* GNU Lesser General Public License Usage
|
||||
* Alternatively, this project may be redistributed and/or modified under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free
|
||||
* Software Foundation; version 3. This project is distributed in the hope that
|
||||
* it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this project. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For any further details and any questions please contact us under
|
||||
* contact@nymea.io or see our FAQ/Licensing Information on
|
||||
* https://nymea.io/license/faq
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include "integrationpluginunitec.h"
|
||||
#include "plugininfo.h"
|
||||
#include "hardwaremanager.h"
|
||||
#include "hardware/radio433/radio433.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
|
||||
IntegrationPluginUnitec::IntegrationPluginUnitec()
|
||||
{
|
||||
}
|
||||
|
||||
void IntegrationPluginUnitec::setupThing(ThingSetupInfo *info)
|
||||
{
|
||||
if (!hardwareManager()->radio433()->available())
|
||||
return info->finish(Thing::ThingErrorHardwareNotAvailable, QT_TR_NOOP("No 433 MHz radio available on this system."));
|
||||
|
||||
Thing *thing = info->thing();
|
||||
|
||||
foreach (Thing* d, myThings()) {
|
||||
if (d->paramValue(switchThingChannelParamTypeId).toString() == thing->paramValue(switchThingChannelParamTypeId).toString()) {
|
||||
qCWarning(dcUnitec) << "Unitec switch with channel " << thing->paramValue(switchThingChannelParamTypeId).toString() << "already added.";
|
||||
return info->finish(Thing::ThingErrorHardwareNotAvailable, QT_TR_NOOP("There is already a unitec switch on this channel"));
|
||||
}
|
||||
}
|
||||
|
||||
return info->finish(Thing::ThingErrorNoError);
|
||||
}
|
||||
|
||||
void IntegrationPluginUnitec::executeAction(ThingActionInfo *info)
|
||||
{
|
||||
if (!hardwareManager()->radio433()->available())
|
||||
return info->finish(Thing::ThingErrorHardwareNotAvailable, QT_TR_NOOP("No 433 MHz radio available on this system."));
|
||||
|
||||
Thing *thing = info->thing();
|
||||
Action action = info->action();
|
||||
|
||||
QList<int> rawData;
|
||||
QByteArray binCode;
|
||||
|
||||
// Bin codes for buttons
|
||||
if (thing->paramValue(switchThingChannelParamTypeId).toString() == "A" && action.param(switchPowerActionPowerParamTypeId).value().toBool() == true) {
|
||||
binCode.append("111011000100111010111111");
|
||||
} else if (thing->paramValue(switchThingChannelParamTypeId).toString() == "A" && action.param(switchPowerActionPowerParamTypeId).value().toBool() == false) {
|
||||
binCode.append("111001100110100001011111");
|
||||
} else if (thing->paramValue(switchThingChannelParamTypeId).toString() == "B" && action.param(switchPowerActionPowerParamTypeId).value().toBool() == true) {
|
||||
binCode.append("111011000100111010111011");
|
||||
} else if (thing->paramValue(switchThingChannelParamTypeId).toString() == "B" && action.param(switchPowerActionPowerParamTypeId).value().toBool() == false) {
|
||||
binCode.append("111000111001100111101011");
|
||||
} else if (thing->paramValue(switchThingChannelParamTypeId).toString() == "C" && action.param(switchPowerActionPowerParamTypeId).value().toBool() == true) {
|
||||
binCode.append("111000000011011111000011");
|
||||
} else if (thing->paramValue(switchThingChannelParamTypeId).toString() == "C" && action.param(switchPowerActionPowerParamTypeId).value().toBool() == false) {
|
||||
binCode.append("111001100110100001010011");
|
||||
} else if (thing->paramValue(switchThingChannelParamTypeId).toString() == "D" && action.param(switchPowerActionPowerParamTypeId).value().toBool() == true) {
|
||||
binCode.append("111001100110100001011101");
|
||||
} else if (thing->paramValue(switchThingChannelParamTypeId).toString() == "D" && action.param(switchPowerActionPowerParamTypeId).value().toBool() == false) {
|
||||
binCode.append("111000000011011111001101");
|
||||
}
|
||||
|
||||
// =======================================
|
||||
//create rawData timings list
|
||||
int delay = 500;
|
||||
|
||||
// add sync code
|
||||
rawData.append(6);
|
||||
rawData.append(14);
|
||||
|
||||
// add the code
|
||||
foreach (QChar c, binCode) {
|
||||
if(c == '0'){
|
||||
rawData.append(2);
|
||||
rawData.append(1);
|
||||
}else{
|
||||
rawData.append(1);
|
||||
rawData.append(2);
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================
|
||||
// send data to hardware resource
|
||||
if(hardwareManager()->radio433()->sendData(delay, rawData, 10)){
|
||||
qCDebug(dcUnitec) << "transmitted" << pluginName() << thing->name() << "power: " << action.param(switchPowerActionPowerParamTypeId).value().toBool();
|
||||
}else{
|
||||
qCWarning(dcUnitec) << "could not transmitt" << pluginName() << thing->name() << "power: " << action.param(switchPowerActionPowerParamTypeId).value().toBool();
|
||||
return info->finish(Thing::ThingErrorHardwareFailure, QT_TR_NOOP("Error sending data."));
|
||||
}
|
||||
|
||||
return info->finish(Thing::ThingErrorNoError);
|
||||
}
|
||||
@ -1,52 +0,0 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* 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
|
||||
* reproduction, publication, editing and translation, are reserved. The use of
|
||||
* this project is subject to the terms of a license agreement to be concluded
|
||||
* with nymea GmbH in accordance with the terms of use of nymea GmbH, available
|
||||
* under https://nymea.io/license
|
||||
*
|
||||
* GNU Lesser General Public License Usage
|
||||
* Alternatively, this project may be redistributed and/or modified under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free
|
||||
* Software Foundation; version 3. This project is distributed in the hope that
|
||||
* it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this project. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For any further details and any questions please contact us under
|
||||
* contact@nymea.io or see our FAQ/Licensing Information on
|
||||
* https://nymea.io/license/faq
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef INTEGRATIONPLUGINUNITEC_H
|
||||
#define INTEGRATIONPLUGINUNITEC_H
|
||||
|
||||
#include "integrations/integrationplugin.h"
|
||||
|
||||
class IntegrationPluginUnitec : public IntegrationPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PLUGIN_METADATA(IID "io.nymea.IntegrationPlugin" FILE "integrationpluginunitec.json")
|
||||
Q_INTERFACES(IntegrationPlugin)
|
||||
|
||||
public:
|
||||
explicit IntegrationPluginUnitec();
|
||||
|
||||
void setupThing(ThingSetupInfo *info) override;
|
||||
|
||||
void executeAction(ThingActionInfo *info) override;
|
||||
|
||||
};
|
||||
|
||||
#endif // INTEGRATIONPLUGINUNITEC_H
|
||||
@ -1,44 +0,0 @@
|
||||
{
|
||||
"name": "Unitec",
|
||||
"displayName": "Unitec",
|
||||
"id": "aefca391-f8bf-4f6c-a205-6764de3c2c3c",
|
||||
"vendors": [
|
||||
{
|
||||
"name": "unitec",
|
||||
"displayName": "Unitec",
|
||||
"id": "f2cd9a76-5a7f-4c01-bf8c-5eae8b12e95c",
|
||||
"thingClasses": [
|
||||
{
|
||||
"id": "8468a15d-ecc0-43b6-98ca-e1e4ac9e2df3",
|
||||
"displayName": "Unitec switch (48111)",
|
||||
"name": "switch",
|
||||
"createMethods": ["user"],
|
||||
"paramTypes": [
|
||||
{
|
||||
"id": "2cb59323-bc01-477c-ac0d-312b25c53463",
|
||||
"name": "channel",
|
||||
"displayName": "channel",
|
||||
"type": "QString",
|
||||
"allowedValues": ["A", "B", "C", "D"]
|
||||
}
|
||||
],
|
||||
"actionTypes": [
|
||||
{
|
||||
"id": "3ca1ebc2-bb8e-4429-9664-a7bc4569e73b",
|
||||
"name": "power",
|
||||
"displayName": "set power",
|
||||
"paramTypes": [
|
||||
{
|
||||
"id": "c101c199-314d-420f-a302-0ae29c599047",
|
||||
"name": "power",
|
||||
"displayName": "power",
|
||||
"type": "bool"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,59 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="de_DE">
|
||||
<context>
|
||||
<name>IntegrationPluginUnitec</name>
|
||||
<message>
|
||||
<location filename="../integrationpluginunitec.cpp" line="46"/>
|
||||
<location filename="../integrationpluginunitec.cpp" line="63"/>
|
||||
<source>No 433 MHz radio available on this system.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../integrationpluginunitec.cpp" line="53"/>
|
||||
<source>There is already a unitec switch on this channel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../integrationpluginunitec.cpp" line="115"/>
|
||||
<source>Error sending data.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Unitec</name>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/unitec/plugininfo.h" line="26"/>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/unitec/plugininfo.h" line="29"/>
|
||||
<source>Unitec</source>
|
||||
<extracomment>The name of the vendor ({f2cd9a76-5a7f-4c01-bf8c-5eae8b12e95c})
|
||||
----------
|
||||
The name of the plugin Unitec ({aefca391-f8bf-4f6c-a205-6764de3c2c3c})</extracomment>
|
||||
<translation>Unitec</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/unitec/plugininfo.h" line="32"/>
|
||||
<source>Unitec switch (48111)</source>
|
||||
<extracomment>The name of the ThingClass ({8468a15d-ecc0-43b6-98ca-e1e4ac9e2df3})</extracomment>
|
||||
<translation>Unitec Steckdose (48111)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/unitec/plugininfo.h" line="35"/>
|
||||
<source>channel</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: switch, Type: thing, ID: {2cb59323-bc01-477c-ac0d-312b25c53463})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/unitec/plugininfo.h" line="41"/>
|
||||
<source>set power</source>
|
||||
<extracomment>The name of the ActionType ({3ca1ebc2-bb8e-4429-9664-a7bc4569e73b}) of ThingClass switch</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/unitec/plugininfo.h" line="38"/>
|
||||
<source>power</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: switch, ActionType: power, ID: {c101c199-314d-420f-a302-0ae29c599047})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
@ -1,59 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>IntegrationPluginUnitec</name>
|
||||
<message>
|
||||
<location filename="../integrationpluginunitec.cpp" line="46"/>
|
||||
<location filename="../integrationpluginunitec.cpp" line="63"/>
|
||||
<source>No 433 MHz radio available on this system.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../integrationpluginunitec.cpp" line="53"/>
|
||||
<source>There is already a unitec switch on this channel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../integrationpluginunitec.cpp" line="115"/>
|
||||
<source>Error sending data.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Unitec</name>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/unitec/plugininfo.h" line="26"/>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/unitec/plugininfo.h" line="29"/>
|
||||
<source>Unitec</source>
|
||||
<extracomment>The name of the vendor ({f2cd9a76-5a7f-4c01-bf8c-5eae8b12e95c})
|
||||
----------
|
||||
The name of the plugin Unitec ({aefca391-f8bf-4f6c-a205-6764de3c2c3c})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/unitec/plugininfo.h" line="32"/>
|
||||
<source>Unitec switch (48111)</source>
|
||||
<extracomment>The name of the ThingClass ({8468a15d-ecc0-43b6-98ca-e1e4ac9e2df3})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/unitec/plugininfo.h" line="35"/>
|
||||
<source>channel</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: switch, Type: thing, ID: {2cb59323-bc01-477c-ac0d-312b25c53463})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/unitec/plugininfo.h" line="41"/>
|
||||
<source>set power</source>
|
||||
<extracomment>The name of the ActionType ({3ca1ebc2-bb8e-4429-9664-a7bc4569e73b}) of ThingClass switch</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../../build-nymea-plugins-Desktop-Debug/unitec/plugininfo.h" line="38"/>
|
||||
<source>power</source>
|
||||
<extracomment>The name of the ParamType (ThingClass: switch, ActionType: power, ID: {c101c199-314d-420f-a302-0ae29c599047})</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
@ -1,11 +0,0 @@
|
||||
include(../plugins.pri)
|
||||
|
||||
TARGET = $$qtLibraryTarget(nymea_integrationpluginunitec)
|
||||
|
||||
SOURCES += \
|
||||
integrationpluginunitec.cpp
|
||||
|
||||
HEADERS += \
|
||||
integrationpluginunitec.h
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user