Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,21 @@ Description: nymea.io plugin for a generic MQTT client
This package will install a generic MQTT client plugin for nymea.io


Package: nymea-plugin-miele
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends},
nymea-plugins-translations,
Description: nymea.io plugin for Miele appliances
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 an integration plugin for Miele appliances.


Package: nymea-plugin-netatmo
Architecture: any
Depends: ${shlibs:Depends},
Expand Down
1 change: 1 addition & 0 deletions debian/nymea-plugin-miele.install.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/lib/@DEB_HOST_MULTIARCH@/nymea/plugins/libnymea_integrationpluginmiele.so
32 changes: 32 additions & 0 deletions miele/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Miele

Connects your Miele home appliances to nymea.

## Supported Things

Miele appliances, like:
* Oven
* Dishwasher
* Coffee maker
* Dryer
* Fridge
* Washer
* Cook Top
* Hood

## Requirements

* The package “nymea-plugin-miele” must be installed
* Internet connection
* Miele account

## Plug-In Settings

**Custom client key and secret**
You can register as developer on https://miele.com/developer, where you can obtain you own client credentials.
The default client credentials are made available through the nymea community API key provider.

## More

https://www.miele.com/developer/index.html

549 changes: 549 additions & 0 deletions miele/integrationpluginmiele.cpp

Large diffs are not rendered by default.

86 changes: 86 additions & 0 deletions miele/integrationpluginmiele.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* 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 INTEGRATIONPLUGINMIELE_H
#define INTEGRATIONPLUGINMIELE_H

#include "integrations/integrationplugin.h"
#include "plugintimer.h"
#include "miele.h"

#include <QHash>
#include <QDebug>

class IntegrationPluginMiele : public IntegrationPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "io.nymea.IntegrationPlugin" FILE "integrationpluginmiele.json")
Q_INTERFACES(IntegrationPlugin)

public:
explicit IntegrationPluginMiele();

void startPairing(ThingPairingInfo *info) override;
void confirmPairing(ThingPairingInfo *info, const QString &username, const QString &secret) override;

void setupThing(ThingSetupInfo *info) override;
void postSetupThing(Thing *thing) override;
void executeAction(ThingActionInfo *info) override;
void thingRemoved(Thing *thing) override;

private:
PluginTimer *m_pluginTimer15min = nullptr;

QHash<Miele *, ThingSetupInfo *> m_asyncSetup;

QHash<ThingId, Miele *> m_setupMieleConnections;
QHash<Thing *, Miele *> m_mieleConnections;

QHash<QUuid, ThingActionInfo *> m_pendingActions;
QHash<ThingClassId, ParamTypeId> m_idParamTypeIds;

QHash<ThingClassId, StateTypeId> m_connectedStateTypeIds;
QHash<QString, ThingClassId> m_mieleDeviceTypeLabelToThingClassId;
QHash<Miele::DeviceType, ThingClassId> m_mieleDeviceTypeToThingClassId;

Miele *createMieleConnection();
void setThingState(Thing *thing, const QVariantMap &state);

private slots:
void onConnectionChanged(bool connected);
void onAuthenticationStatusChanged(bool authenticated);
void onRequestExecuted(QUuid requestId, bool success);

void onDevicesFound(QList<Miele::DeviceShort> devices);
void onDeviceStateReceived(const QString &deviceId, const QVariantMap &deviceState);
void onDeviceNotFound(const QString &deviceId);
};

#endif // INTEGRATIONPLUGINMIELE_H
Loading