15 Commits

Author SHA1 Message Date
Pascal Bourque
94acdede23 fix: Prevent AWS_ERROR_MQTT_UNEXPECTED_HANGUP connection interruptions (#179)
By using a stable, unique per-process client identifier.

Also:

- Configured MQTT auto-reconnect on interruption
- Reset connection on high MQTT connection interruption rate
2025-11-08 15:12:30 -05:00
Pascal Bourque
d861a50136 fix!: Device and state properties are now optional (#170)
Updated DeviceBase, BrandInfo, and DeviceState interfaces to make most properties optional, improving flexibility for partial objects and better handling of missing data.
2025-11-01 09:33:31 -04:00
remiolivier
15edd9dbbf feat: Partial support for the AC-V1-1 thermostat (#156)
## Feat. Add Support for Mysa AC-V1-1 Devices

### Overview
This PR aims to extend **mysa2mqtt** to support **Mysa AC-V1-1**
thermostats in addition to the existing baseboard models.
AC-V1 devices use different operating modes and fan modes, which
required updates to both mode translation and MQTT behavior.
Tested with `BB-V1-1` and `AC-V1-1`.

*Note: I'm no typescript expert so code might not look the best but is
fully tested*

### Key Changes
- Supports `cool`, `dry`, `fan_only`, and `auto` in addition to `off`
and `heat`.
  - New fan modes: `auto`, `low`, `medium`, `high`, and `max`.    

### Does not support yet
 - Vertical swing
 - Horizontal swing

### Technical stuff
`AC-V1-1` payload:

`"body":{"success":1,"type":2,"trig_src":3,"state":{"md":3,"sp":23.5,"lk":0,"ho":1,"br":100,"da":2,"fn":5,"ss":4,"ssh":12,"it":0}}}}`

Fan mode values: 1 = 'auto', 3 = 'low', 5 = 'medium', 7 = 'high', 8 =
'max'
**I named the value 8 max as I needed a 4th value but is not tied to
anything in HA or Mysa**

### Testing
```
npm run example

[23:13:06.300] INFO (example/3281203): [example] 'Office Room' status changed: 21.9°C, 49%, 0W
[23:13:21.701] INFO (example/3281203): [example] 'Office Room' status changed: 21.9°C, 49%, 0W
[23:13:21.938] INFO (example/3281203): [example] 'Family Room' state changed. {"deviceId":"<redacted>","mode":"heat","setPoint":23,"fanSpeed":"auto"}
[23:13:33.282] INFO (example/3281203): [example] 'Family Room' state changed. {"deviceId":"<redacted>","mode":"heat","setPoint":23.5,"fanSpeed":"auto"}
[23:13:38.132] INFO (example/3281203): [example] 'Family Room' state changed. {"deviceId":"<redacted>","mode":"heat","setPoint":23.5,"fanSpeed":"high"}
[23:13:44.380] INFO (example/3281203): [example] 'Family Room' state changed. {"deviceId":"<redacted>","mode":"fan_only","setPoint":23.5,"fanSpeed":"high"}
[23:13:52.609] INFO (example/3281203): [example] 'Family Room' state changed. {"deviceId":"<redacted>","mode":"cool","setPoint":23.5,"fanSpeed":"high"}
[23:13:57.942] INFO (example/3281203): [example] 'Family Room' state changed. {"deviceId":"<redacted>","mode":"heat","setPoint":23.5,"fanSpeed":"high"}
[23:14:01.052] INFO (example/3281203): [example] 'Family Room' state changed. {"deviceId":"<redacted>","mode":"heat","setPoint":23.5,"fanSpeed":"auto"}
```
PR to `mysa2mqtt` coming right after
2025-10-31 19:39:28 -04:00
Pascal Bourque
0c906fefe9 fix: Better resilience towards MQTT connection loss and errors (#168) 2025-10-31 15:47:15 -04:00
Pascal Bourque
d813c4f9a9 fix: Race condition when initializing the MqttClientConnection (#144)
Fixes https://github.com/bourquep/mysa2mqtt/issues/41
2025-10-05 14:53:17 -04:00
jagmandan
b845fe5a82 fix: Unable to control BB-V2-0 thermostats (#139)
This change was identified while investigating why my BB-V2-0 Mysa would
not respond to device state commands from Home Assistant (using
mysq2mqtt). The id type was previously in unix time (seconds), but
should be in milliseconds per the reference here:
https://github.com/dlenski/mysotherm/blob/main/mysa_messages.md Making
this update corrected the behavior and commands now work successfully.
2025-10-05 10:44:34 -04:00
Pascal Bourque
98003665b8 fix: Build error after TypeScript update (#95) 2025-08-29 08:14:35 -04:00
Pascal Bourque
17f277e844 docs: Added missing TSDoc comments (#19) 2025-06-07 10:08:05 -04:00
Pascal Bourque
6a88e52702 feat: Added getDeviceSerialNumber() API (#18) 2025-06-07 09:57:28 -04:00
Pascal Bourque
131f8677d9 fix: DayJS 'duration' import breaks ESM consumers (#15) 2025-06-05 16:32:14 -04:00
Pascal Bourque
7f89e9867a fix(logging): Reduced the log level of session-related logs (#14) 2025-06-05 08:11:37 -04:00
Pascal Bourque
6b4e41828a feat: Added getDeviceStates API 2025-06-02 07:25:04 -04:00
Pascal Bourque
9df5030228 feat: Added getDeviceFirmwares API (#10) 2025-06-02 07:04:45 -04:00
Pascal Bourque
aaac9f6d73 fix: Export all types modules (#3) 2025-05-25 17:59:25 -04:00
Pascal Bourque
ff0163043a feat: Initial commit 2025-05-25 11:03:21 -04:00