Removed discovery, fixed setup bug
parent
d78cf182a6
commit
b36f91e34e
|
|
@ -1,15 +1,18 @@
|
||||||
# iDM
|
# iDM
|
||||||
|
|
||||||
|
Connect nymea to iDM heat pumps.
|
||||||
|
|
||||||
## Supported Things
|
## Supported Things
|
||||||
|
|
||||||
|
* Navigator 2.0 based heat pump models
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
* The package 'nymea-plugin-idm' must be installed
|
||||||
|
* Navigator 2.0 settings
|
||||||
|
* "Modbus TCP" must be selected in the "Building Management System" menu?
|
||||||
|
* Both devices must be in the same local area network.
|
||||||
|
|
||||||
## More
|
## More
|
||||||
|
|
||||||
https://www.idm-energie.at/en/
|
https://www.idm-energie.at/en/
|
||||||
|
|
||||||
** Modbus TCP communication not working **
|
|
||||||
* Is "Modbus TCP" selected in the "Building Management System" menu?
|
|
||||||
* Is the Modbus TCP device and the heat pump in the same network?
|
|
||||||
* Is there an IP address conflict?
|
|
||||||
* Has the heat pump set the IP address manually? IP address should be set manually, because with "DHCP" the IP address can change (e.g. after a power failure).
|
|
||||||
* Was the connection made via a switch, possibly blocking this communication? If so, integrate the Modbus TCP device directly (without a switch).
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,26 +36,6 @@ IntegrationPluginIdm::IntegrationPluginIdm()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IntegrationPluginIdm::discoverThings(ThingDiscoveryInfo *info)
|
|
||||||
{
|
|
||||||
qCDebug(dcIdm()) << "discoverThings called";
|
|
||||||
|
|
||||||
if (info->thingClassId() == navigator2ThingClassId) {
|
|
||||||
// TODO Is a discovery method actually possible?
|
|
||||||
// The plugin has a parameter for the IP address
|
|
||||||
|
|
||||||
QString description = "Navigator 2";
|
|
||||||
ThingDescriptor descriptor(info->thingClassId(), "Idm", description);
|
|
||||||
info->addThingDescriptor(descriptor);
|
|
||||||
|
|
||||||
// Just report no error for now, until the above question
|
|
||||||
// is clarified
|
|
||||||
info->finish(Thing::ThingErrorNoError);
|
|
||||||
} else {
|
|
||||||
Q_ASSERT_X(false, "discoverThings", QString("Unhandled thingClassId: %1").arg(info->thingClassId().toString()).toUtf8());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void IntegrationPluginIdm::setupThing(ThingSetupInfo *info)
|
void IntegrationPluginIdm::setupThing(ThingSetupInfo *info)
|
||||||
{
|
{
|
||||||
Thing *thing = info->thing();
|
Thing *thing = info->thing();
|
||||||
|
|
@ -80,7 +60,6 @@ void IntegrationPluginIdm::setupThing(ThingSetupInfo *info)
|
||||||
/* Check, if address is already in use for another device */
|
/* Check, if address is already in use for another device */
|
||||||
Q_FOREACH (Idm *idm, m_idmConnections) {
|
Q_FOREACH (Idm *idm, m_idmConnections) {
|
||||||
if (hostAddress.isEqual(idm->getIdmAddress())) {
|
if (hostAddress.isEqual(idm->getIdmAddress())) {
|
||||||
|
|
||||||
qCWarning(dcIdm()) << "Address already in use";
|
qCWarning(dcIdm()) << "Address already in use";
|
||||||
info->finish(Thing::ThingErrorSetupFailed, "IP address already in use");
|
info->finish(Thing::ThingErrorSetupFailed, "IP address already in use");
|
||||||
return;
|
return;
|
||||||
|
|
@ -90,6 +69,11 @@ void IntegrationPluginIdm::setupThing(ThingSetupInfo *info)
|
||||||
qCDebug(dcIdm()) << "Creating Idm object";
|
qCDebug(dcIdm()) << "Creating Idm object";
|
||||||
/* Create new Idm object and store it in hash table */
|
/* Create new Idm object and store it in hash table */
|
||||||
Idm *idm = new Idm(hostAddress, this);
|
Idm *idm = new Idm(hostAddress, this);
|
||||||
|
if (idm->connectDevice()) {
|
||||||
|
qCWarning(dcIdm()) << "Could not connect to thing";
|
||||||
|
info->finish(Thing::ThingErrorHardwareNotAvailable);
|
||||||
|
return;
|
||||||
|
}
|
||||||
m_idmConnections.insert(thing, idm);
|
m_idmConnections.insert(thing, idm);
|
||||||
connect(idm, &Idm::statusUpdated, info, [info] (IdmInfo *idmInfo) {
|
connect(idm, &Idm::statusUpdated, info, [info] (IdmInfo *idmInfo) {
|
||||||
if (idmInfo->connected) {
|
if (idmInfo->connected) {
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,6 @@ public:
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
explicit IntegrationPluginIdm();
|
explicit IntegrationPluginIdm();
|
||||||
|
|
||||||
void discoverThings(ThingDiscoveryInfo *info) override;
|
|
||||||
void setupThing(ThingSetupInfo *info) override;
|
void setupThing(ThingSetupInfo *info) override;
|
||||||
void postSetupThing(Thing *thing) override;
|
void postSetupThing(Thing *thing) override;
|
||||||
void thingRemoved(Thing *thing) override;
|
void thingRemoved(Thing *thing) override;
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
"name": "navigator2",
|
"name": "navigator2",
|
||||||
"displayName": "Navigator 2.0",
|
"displayName": "Navigator 2.0",
|
||||||
"id": "1c95ac91-4eca-4cbf-b0f4-d60d35d069ed",
|
"id": "1c95ac91-4eca-4cbf-b0f4-d60d35d069ed",
|
||||||
"createMethods": ["User"],
|
"createMethods": ["user"],
|
||||||
"interfaces": ["temperaturesensor", "connectable"],
|
"interfaces": ["temperaturesensor", "connectable"],
|
||||||
"paramTypes": [
|
"paramTypes": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue