Skip to content

Commit 26413f4

Browse files
authored
[MQTT] Added blowingOnly mode for remoteClimateState
1 parent 5c675b6 commit 26413f4

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919
- support configuring `refresh/mode`, `refresh/period/active`, `refresh/period/inActive` and `refresh/period/inActiveGrace` via MQTT
2020
- Handle fallback for SOC when charge status update fails
2121
- ensure that a changed systemd configuration is picked up
22+
- support blowingOnly mode for `remoteClimateState`
2223
- API
2324
- Handle fallback for SOC when charge status update fails
2425

saic-java-mqtt-gateway/src/main/java/net/heberling/ismart/mqtt/VehicleHandler.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,27 @@ private void sendACCommand(byte command, byte temperature)
287287
Map.of(19, new byte[] {command}, 20, new byte[] {temperature}, 255, new byte[] {0})));
288288
}
289289

290+
private void sendACBlowingCommand(boolean on)
291+
throws URISyntaxException,
292+
ExecutionException,
293+
InterruptedException,
294+
TimeoutException,
295+
MqttException,
296+
IOException {
297+
sendCommand(
298+
(byte) 6,
299+
new TreeMap<>(
300+
Map.of(
301+
19,
302+
new byte[] {(byte) (on ? 1 : 0)},
303+
20,
304+
new byte[] {0},
305+
22,
306+
new byte[] {(byte) (on ? 1 : 0)},
307+
255,
308+
new byte[] {0})));
309+
}
310+
290311
private void sendCommand(byte type, SortedMap<Integer, byte[]> parameter)
291312
throws URISyntaxException,
292313
ExecutionException,
@@ -471,6 +492,8 @@ public void handleMQTTCommand(String topic, MqttMessage message) throws MqttExce
471492
break;
472493
case "front":
473494
sendACCommand((byte) 5, (byte) 8);
495+
case "blowingOnly":
496+
sendACBlowingCommand(true);
474497
break;
475498
default:
476499
throw new MqttGatewayException("Unsupported payload " + message);

saic-java-mqtt-gateway/src/main/java/net/heberling/ismart/mqtt/VehicleState.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,8 @@ private static String toRemoteClimate(Integer remoteClimateStatus) {
383383
switch (remoteClimateStatus) {
384384
case 0:
385385
return "off";
386+
case 1:
387+
return "blowingOnly";
386388
case 2:
387389
return "on";
388390
case 5:

0 commit comments

Comments
 (0)