Amperfied: Disable standby for rtu based energy control wallbox

master
Michael Zanetti 2023-04-19 10:47:10 +02:00
parent 58fa2ca870
commit 5764f8b83c
2 changed files with 28 additions and 1 deletions

View File

@ -53,6 +53,19 @@
"value": 11
}
]
},
{
"name": "Standby",
"values": [
{
"key": "StandbyEnabled",
"value": 0
},
{
"key": "StandbyDisabled",
"value": 4
}
]
}
],
"blocks": [
@ -245,6 +258,17 @@
"unit": "1/10 A",
"defaultValue": "0",
"access": "RW"
},
{
"id": "standby",
"address": 258,
"size": 1,
"type": "uint16",
"readSchedule": "init",
"registerType": "holdingRegister",
"description": "Standby function control",
"defaultValue": 0,
"access": "RW"
}
]
}

View File

@ -281,9 +281,12 @@ void IntegrationPluginAmperfied::setupRtuConnection(ThingSetupInfo *info)
thing->setStateValue(energyControlConnectedStateTypeId, false);
}
});
connect(connection, &AmperfiedModbusRtuConnection::initializationFinished, thing, [thing](bool success){
connect(connection, &AmperfiedModbusRtuConnection::initializationFinished, thing, [connection, thing](bool success){
if (success) {
thing->setStateValue(energyControlConnectedStateTypeId, true);
// Disabling the auto-standby as it will shut down modbus
connection->setStandby(AmperfiedModbusRtuConnection::StandbyStandbyDisabled);
}
});