Commit graph

38 commits

Author SHA1 Message Date
Victor
46d9e5c882
Improve MQTT retain behavior (#321)
* Improve MQTT message retain behavior
* Prepare for version 0.16.0
2025-08-07 13:45:52 +02:00
Victor
b3c6334f0c
Improve MQTT behavior and add experimental parsing for color temp support from Plejd API (#298)
* Update underlying docker containers and dependencies.
* Minor linting and code issues fixes
* Update supported devices section
* Improve Mqtt message properties - retain, etc.
- Retain discovery messages
- Don't retain others
- Set QoS to 1 consistently to ensure at least once delivery
- Set session timeout to ensure a reasonable TTL on messages
* Code and logic to remove any retained mqtt messages for SET/STATE/AVAILABILITY
* Temporary restructure of init flow for mqtt.
- No longer wait for HA birth message
- Don't listen to incoming messages until old retained messages have been purged.
- More details in https://github.com/icanos/hassio-plejd/issues/218
* Fix lingering incorrect access of connectedDevice.id
* Fix to avoid Home Assistant setting retain flag on MQTT SET STATE messages
* Parse new TRAIT=15, assuming this means dimmable and tunable white
* Clarify TRAITS bitmask values
* Add experimental parsing for color temp support from Plejd API
* Lint fixes
* Remove null coalescing operator since we don't compile code
* Handle case where outputSettings is null in PlejdApi
* Solve MQTT errors due to deprecated api color_temp and unsupported removal of retained state messages
2025-08-05 19:55:50 +02:00
swevictor
ed217176e9 Set entity name to null to indicate entity is the default entity for the device
Due to HA change as per https://developers.home-assistant.io/blog/2023-057-21-change-naming-mqtt-entities/
2023-08-18 20:07:40 +02:00
swevictor
cacd9fc4ba Linting of all fixes 2023-08-16 15:32:53 +02:00
faanskit
9cf3b3bdd6 Fix for issue discussed im #198. Scene device triggers were not unique from Scenes and device_trigger /config topic was too long 2021-05-20 07:24:22 +02:00
faanskit
dc3d2237da Updating the Plejd / HA Device information model to be compatible with suggested_area. 2021-05-07 10:59:52 +02:00
faanskit
7ba38d6acf Lights and switches, including roomsAsLighs, is now proposing an area for Home Assistant based on the room name from Plejd.
This by using suggested_area in MQTT config.

In many installations, Plejd units have the same name and are separated by the room they belong to.
Eg. Badrum -> Spottar, Kök->Spottar, Sovrum->Taklampa, Kök->Taklampa

With 8.0.0 devices can have the same name, and therefore it makes sense to now also support areas.
2021-05-07 08:52:57 +02:00
faanskit
c8890b8cd7 Updates based om comments from @SweVictor 2021-05-06 07:58:06 +02:00
faanskit
531aa8ee3e Fixed errors from npm run lint:fix 2021-05-05 19:34:34 +02:00
faanskit
2610c1eaa4 Incorrect trigger 2021-05-05 19:18:43 +02:00
faanskit
5190341be6 removed ts-ignore 2021-05-05 19:05:52 +02:00
faanskit
78e1616b4e Updated to match the latest developer branch and modified according to feedback from review. 2021-05-05 19:02:10 +02:00
faanskit
792a9e9840
Merge branch 'develop' into feature/id-refactor 2021-05-05 12:30:25 +02:00
Victor Hagelbäck
236e533c8a Set entiteis to correct type (switch/light) and fix availability for scenes
- General cleanup and clarification of MQTT messages
2021-05-03 09:50:54 +02:00
faanskit
5a21290364 Added support for WRT-10 as a Device Automation 2021-05-01 19:41:29 +02:00
Victor Hagelbäck
a633ffacb3 Quick-fix to force switch devices to the light mqtt domain 2021-04-27 11:36:38 +02:00
Victor Hagelbäck
74e381f009 Device triggers for scenes implemented 2021-04-26 13:13:10 +02:00
Victor Hagelbäck
b10583336e Replace mqttt scene switches with actual scenes 2021-04-24 09:22:36 +02:00
Victor Hagelbäck
aacf87a50c Revert mqtt v5 code since not supported by HassIO Mosquitto plugin 2021-04-23 10:42:18 +02:00
Victor Hagelbäck
c646bc55eb Revert scenes to register as switches over mqtt 2021-04-21 21:07:17 +02:00
Victor Hagelbäck
464c17d920 Fixes to scene handling and device unique id 2021-04-01 13:19:02 +02:00
Victor Hagelbäck
dbc0e02f11 Minor fixes 2021-03-31 23:28:25 +02:00
Victor Hagelbäck
7de1238c12 Refactor mqtt messaging to use unique id:s and trigger scenes rather than switches 2021-03-31 20:07:46 +02:00
Victor Hagelbäck
e7b8a5a82a Stop write queue when BLE is not connected to avoid loosing commands
- Set max retry count to 10 since BLE loop will set channel to disconnected after 5 retries (or known unrecoverable errors)
2021-02-28 10:32:17 +01:00
Victor Hagelbäck
ca7a5cdd57 Clean up events and subscriptions 2021-02-28 10:20:05 +01:00
Victor Hagelbäck
8d259a768b Fix turn off and dim commands 2021-02-28 10:20:05 +01:00
Victor Hagelbäck
55f0f60be9 Fix setting state for created Plejd room devices
- when using includeRoomsAsLights setting
2021-02-27 16:41:05 +01:00
Victor Hagelbäck
d133efe228 Fix type-o in writeFailed error handling 2021-02-11 22:45:13 +01:00
Victor Hagelbäck
ef7a5086a1 Handle when scene and device have the same Id
- Catch emitted errors in Mqtt
2021-02-10 10:10:28 +01:00
Victor Hagelbäck
898a9d822f Lint and style fixes 2021-02-04 08:08:28 +01:00
Victor Hagelbäck
75b9a1a8d7 Clarify MqttClient structure, logging, and start using DeviceRegistry 2021-02-04 08:06:23 +01:00
Victor Hagelbäck
5af6a8c452 Code lint fixes 2021-01-30 10:00:09 +01:00
Victor
dba9c98097
Merge pull request #115 from thomasloven/publish-availability
Publish availability of devices
2021-01-30 09:26:59 +01:00
Thomas Lovén
f3b8181107 Publish availability of devices 2021-01-29 22:56:29 +01:00
Thomas Lovén
9bb8f69c23 Actually listen to all topics too. Not just subscribe. 2021-01-29 21:06:50 +01:00
Thomas Lovén
2a3bcb0753 Listen to Home Assistant default birth topic by default 2021-01-28 14:24:04 +01:00
Victor Hagelbäck
5562c2d838 Improved error handling in event handling code
- Earlier errors would restart the addon
2021-01-25 08:06:28 +01:00
Victor Hagelbäck
281acd6ad8 Adjust code to airbnb style guide, including eslint rules and prettier configuration for code base 2021-01-22 15:49:02 +01:00
Renamed from plejd/mqtt.js (Browse further)