[easee] speedup command processing (#18027)

* speedup command processing

Signed-off-by: Alexander Friese <af944580@googlemail.com>
This commit is contained in:
Alexander Friese 2025-01-22 21:00:02 +01:00 committed by GitHub
parent 76e4db24ee
commit e7acb14d02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 89 additions and 8 deletions

View File

@ -28,7 +28,9 @@ The following configuration parameters are available for the binding/bridge:
| username | yes | The username to login at Easee Cloud service. This should be an e-mail address or phone number. |
| passord | yes | Your password to login at Easee Cloud service. |
| siteId | yes | The ID of the site containing the wallbox(es) and circuit(s) that should be integrated into openHAB. The ID of your site can be found via the sites overview (<https://easee.cloud/sites>). You just need to click one of the sites listed there, the id will be part of the URL which is then opened. It will be a number with typically 6 digits. |
| dataPollingInterval | no | Interval (seconds) in which live data values are retrieved from the Easee Cloud API. (default = 120) |
| dataPollingInterval | no | Interval (seconds) in which live data values are retrieved from the Easee Cloud API. (default = 60) |
| webRequestInitialDelay | no | Initial time (seconds) to wait before first request is sent to the Easee Cloud API. (default = 10) |
| webRequestInterval | no | Interval (seconds) between two subsequent requests to be sent to the Easee Cloud API. (default = 2) |
## Thing configuration

View File

@ -122,8 +122,6 @@ public class EaseeBindingConstants {
public static final String CMD_VAL_RESUME_CHARGING = "resume_charging";
// web request constants
public static final long WEB_REQUEST_INITIAL_DELAY = 30;
public static final long WEB_REQUEST_INTERVAL = 5;
public static final int WEB_REQUEST_QUEUE_MAX_SIZE = 20;
public static final int WEB_REQUEST_TOKEN_EXPIRY_BUFFER_MINUTES = 5;
public static final int WEB_REQUEST_TOKEN_MAX_AGE_MINUTES = 60;

View File

@ -28,7 +28,9 @@ public class EaseeConfiguration {
private Integer asyncTimeout = 120;
private Integer syncTimeout = 120;
private Integer dataPollingInterval = 120;
private Integer dataPollingInterval = 60;
private Integer webRequestInitialDelay = 10;
private Integer webRequestInterval = 2;
public String getUsername() {
return username;
@ -78,13 +80,30 @@ public class EaseeConfiguration {
this.dataPollingInterval = dataPollingInterval;
}
public Integer getWebRequestInitialDelay() {
return webRequestInitialDelay;
}
public void setWebRequestInitialDelay(Integer webRequestInitialDelay) {
this.webRequestInitialDelay = webRequestInitialDelay;
}
public Integer getWebRequestInterval() {
return webRequestInterval;
}
public void setWebRequestInterval(Integer webRequestInterval) {
this.webRequestInterval = webRequestInterval;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("EaseeConfiguration [username=").append(username).append(", password=").append(password)
.append(", siteId=").append(siteId).append(", asyncTimeout=").append(asyncTimeout)
.append(", syncTimeout=").append(syncTimeout).append(", dataPollingInterval=")
.append(dataPollingInterval).append("]");
.append(dataPollingInterval).append(", webRequestInitialDelay=").append(webRequestInitialDelay)
.append(", webRequestInterval=").append(webRequestInterval).append("]");
return builder.toString();
}
}

View File

@ -31,6 +31,7 @@ import org.openhab.binding.easee.internal.Utils;
import org.openhab.binding.easee.internal.command.EaseeCommand;
import org.openhab.binding.easee.internal.command.account.Login;
import org.openhab.binding.easee.internal.command.account.RefreshToken;
import org.openhab.binding.easee.internal.config.EaseeConfiguration;
import org.openhab.binding.easee.internal.handler.EaseeBridgeHandler;
import org.openhab.binding.easee.internal.handler.StatusHandler;
import org.openhab.binding.easee.internal.model.ValidationException;
@ -269,9 +270,10 @@ public class WebInterface implements AtomicReferenceTrait {
}
public void start() {
EaseeConfiguration config = handler.getBridgeConfiguration();
setAuthenticated(false);
updateJobReference(requestExecutorJobReference, scheduler.scheduleWithFixedDelay(requestExecutor,
WEB_REQUEST_INITIAL_DELAY, WEB_REQUEST_INTERVAL, TimeUnit.SECONDS));
config.getWebRequestInitialDelay(), config.getWebRequestInterval(), TimeUnit.SECONDS));
}
/**

View File

@ -36,6 +36,18 @@
<description>Interval in which data is polled from EaseeCloud (in seconds).</description>
<default>60</default>
</parameter>
<parameter name="webRequestInitialDelay" type="integer" required="false" min="5" max="60" unit="s"
groupName="connection">
<label>Initial Web Request Delay</label>
<description>Initial time to wait before first request is sent to EaseeCloud (in seconds).</description>
<default>10</default>
</parameter>
<parameter name="webRequestInterval" type="integer" required="false" min="1" max="10" unit="s"
groupName="connection">
<label>Web Request Interval</label>
<description>Interval between two subsequent requests to be sent to EaseeCloud (in seconds).</description>
<default>2</default>
</parameter>
</config-description>
<config-description uri="thing-type:easee:charger">
<parameter name="id" type="text" required="true">

View File

@ -34,6 +34,10 @@ thing-type.config.easee.site.siteId.label = Site ID
thing-type.config.easee.site.siteId.description = The ID of the site containing the charger(s) and circuit(s) that should be integrated into openHAB.
thing-type.config.easee.site.username.label = Username
thing-type.config.easee.site.username.description = The username to login at Easee Cloud service. This should be an e-mail address or phone number.
thing-type.config.easee.site.webRequestInitialDelay.label = Initial Web Request Delay
thing-type.config.easee.site.webRequestInitialDelay.description = Initial time to wait before first request is sent to EaseeCloud (in seconds).
thing-type.config.easee.site.webRequestInterval.label = Web Request Interval
thing-type.config.easee.site.webRequestInterval.description = Interval between two subsequent requests are sent to EaseeCloud (in seconds).
# channel group types
@ -65,10 +69,16 @@ channel-group-type.easee.charger-latestSession.channel.sessionStart.description
channel-group-type.easee.charger-state.label = Charger Status
channel-group-type.easee.charger-state.channel.cableLocked.label = Cable Locked
channel-group-type.easee.charger-state.channel.cableLocked.description = Cable Locked status of the wallbox.
channel-group-type.easee.charger-state.channel.cableRating.label = Cable Rating
channel-group-type.easee.charger-state.channel.cableRating.description = Rating of the connected cable.
channel-group-type.easee.charger-state.channel.cellRSSI.label = Cell RSSI
channel-group-type.easee.charger-state.channel.cellRSSI.description = Cell signal quality.
channel-group-type.easee.charger-state.channel.chargerFirmware.label = Current Firmware
channel-group-type.easee.charger-state.channel.chargerFirmware.description = Current Firmware of the wallbox.
channel-group-type.easee.charger-state.channel.chargerOpMode.label = Charger Operation Mode
channel-group-type.easee.charger-state.channel.chargerOpMode.description = Current operation mode.
channel-group-type.easee.charger-state.channel.connectedToCloud.label = Connected to Cloud
channel-group-type.easee.charger-state.channel.connectedToCloud.description = Cloud connection status of the wallbox.
channel-group-type.easee.charger-state.channel.dynamicChargerCurrent.label = Dynamic Charger Current
channel-group-type.easee.charger-state.channel.dynamicChargerCurrent.description = Dynamic set charging current.
channel-group-type.easee.charger-state.channel.dynamicCircuitCurrentP1.label = Dynamic Circuit Current P1
@ -77,16 +87,46 @@ channel-group-type.easee.charger-state.channel.dynamicCircuitCurrentP2.label = D
channel-group-type.easee.charger-state.channel.dynamicCircuitCurrentP2.description = Dynamic set circuit current for phase 2.
channel-group-type.easee.charger-state.channel.dynamicCircuitCurrentP3.label = Dynamic Circuit Current P3
channel-group-type.easee.charger-state.channel.dynamicCircuitCurrentP3.description = Dynamic set circuit current for phase 3.
channel-group-type.easee.charger-state.channel.energyPerHour.label = Energy per Hour
channel-group-type.easee.charger-state.channel.energyPerHour.description = Energy transferred per hour.
channel-group-type.easee.charger-state.channel.errorCode.label = Error Code
channel-group-type.easee.charger-state.channel.errorCode.description = Error Code.
channel-group-type.easee.charger-state.channel.fatalErrorCode.label = Fatal Error Code
channel-group-type.easee.charger-state.channel.fatalErrorCode.description = Fatal Error Code.
channel-group-type.easee.charger-state.channel.inCurrentT2.label = Input Current T2
channel-group-type.easee.charger-state.channel.inCurrentT2.description = Input Current on phase T2
channel-group-type.easee.charger-state.channel.inCurrentT3.label = Input Current T3
channel-group-type.easee.charger-state.channel.inCurrentT3.description = Input Current on phase T3
channel-group-type.easee.charger-state.channel.inCurrentT4.label = Input Current T4
channel-group-type.easee.charger-state.channel.inCurrentT4.description = Input Current on phase T4
channel-group-type.easee.charger-state.channel.inCurrentT5.label = Input Current T5
channel-group-type.easee.charger-state.channel.inCurrentT5.description = Input Current on phase T5
channel-group-type.easee.charger-state.channel.inVoltageT1T2.label = Input Voltage T1T2
channel-group-type.easee.charger-state.channel.inVoltageT1T2.description = Input voltage between phase T1 and T2
channel-group-type.easee.charger-state.channel.inVoltageT1T3.label = Input Voltage T1T3
channel-group-type.easee.charger-state.channel.inVoltageT1T3.description = Input voltage between phase T1 and T3
channel-group-type.easee.charger-state.channel.inVoltageT1T4.label = Input Voltage T1T4
channel-group-type.easee.charger-state.channel.inVoltageT1T4.description = Input voltage between phase T1 and T4
channel-group-type.easee.charger-state.channel.inVoltageT1T5.label = Input Voltage T1T5
channel-group-type.easee.charger-state.channel.inVoltageT1T5.description = Input voltage between phase T1 and T5
channel-group-type.easee.charger-state.channel.inVoltageT2T3.label = Input Voltage T2T3
channel-group-type.easee.charger-state.channel.inVoltageT2T3.description = Input voltage between phase T2 and T3
channel-group-type.easee.charger-state.channel.inVoltageT2T4.label = Input Voltage T2T4
channel-group-type.easee.charger-state.channel.inVoltageT2T4.description = Input voltage between phase T2 and T4
channel-group-type.easee.charger-state.channel.inVoltageT2T5.label = Input Voltage T2T5
channel-group-type.easee.charger-state.channel.inVoltageT2T5.description = Input voltage between phase T2 and T5
channel-group-type.easee.charger-state.channel.inVoltageT3T4.label = Input Voltage T3T4
channel-group-type.easee.charger-state.channel.inVoltageT3T4.description = Input voltage between phase T3 and T4
channel-group-type.easee.charger-state.channel.inVoltageT3T5.label = Input Voltage T3T5
channel-group-type.easee.charger-state.channel.inVoltageT3T5.description = Input voltage between phase T3 and T5
channel-group-type.easee.charger-state.channel.inVoltageT4T5.label = Input Voltage T4T5
channel-group-type.easee.charger-state.channel.inVoltageT4T5.description = Input voltage between phase T4 and T5
channel-group-type.easee.charger-state.channel.isOnline.label = Online
channel-group-type.easee.charger-state.channel.isOnline.description = Online status of the wallbox.
channel-group-type.easee.charger-state.channel.latestFirmware.label = Latest Firmware
channel-group-type.easee.charger-state.channel.latestFirmware.description = Latest Firmware which is available for the wallbox.
channel-group-type.easee.charger-state.channel.latestPulse.label = Latest Pulse
channel-group-type.easee.charger-state.channel.latestPulse.description = Last data received from charger.
channel-group-type.easee.charger-state.channel.ledMode.label = Led Mode
channel-group-type.easee.charger-state.channel.ledMode.description = Led Mode.
channel-group-type.easee.charger-state.channel.lifetimeEnergy.label = Lifetime Energy
channel-group-type.easee.charger-state.channel.lifetimeEnergy.description = Total lifetime energy.
channel-group-type.easee.charger-state.channel.outputCurrent.label = Output Current
@ -101,6 +141,8 @@ channel-group-type.easee.charger-state.channel.totalPower.label = Total Power
channel-group-type.easee.charger-state.channel.totalPower.description = Total Power for all active phases.
channel-group-type.easee.charger-state.channel.voltage.label = Voltage
channel-group-type.easee.charger-state.channel.voltage.description = Voltage
channel-group-type.easee.charger-state.channel.wiFiRSSI.label = Wi-Fi RSSI
channel-group-type.easee.charger-state.channel.wiFiRSSI.description = Wi-Fi signal quality.
channel-group-type.easee.circuit-dynamicCurrent.label = Circuit Dynamic Current
channel-group-type.easee.circuit-dynamicCurrent.channel.dynamicCurrents.label = Dynamic Currents
channel-group-type.easee.circuit-dynamicCurrent.channel.dynamicCurrents.description = Dynamic circuit currents for phases 1,2,3.
@ -155,9 +197,15 @@ channel-type.easee.type-integer-charger-op-mode.state.option.5 = Error
channel-type.easee.type-integer-charger-op-mode.state.option.6 = ReadyToCharge
channel-type.easee.type-integer.label = Generic Integer
channel-type.easee.type-power.label = Power
channel-type.easee.type-rssi.label = Received Signal Strength Indicator
channel-type.easee.type-switch.label = Switch
channel-type.easee.type-volt.label = ElectricPotential
# channel group types
channel-group-type.easee.charger-state.channel.latestFirmware.label = Latest Firmware
channel-group-type.easee.charger-state.channel.latestFirmware.description = Latest Firmware which is available for the wallbox.
# status translations
status.token.validated = "Access token validated"