Commit Graph

64 Commits

Author SHA1 Message Date
Cody Cutrer
5d89c9a885
[mqtt.homeassistant] Implement WaterHeater (#17859)
* [mqtt.homeassistant] Implement WaterHeater

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-12-07 16:34:05 +01:00
Cody Cutrer
f733c85343
[mqtt.homeassistant] Implement Humidifier (#17853)
* [mqtt.homeassistant] Implement Humidifier

Signed-off-by: Cody Cutrer <cody@cutrer.us>

* remove debug logging from test

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-12-07 00:39:43 +01:00
Cody Cutrer
2e7f0e061c
[mqtt.homeassistant] Implement Tag Scanner (#17852)
Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-12-05 23:27:05 +01:00
Cody Cutrer
35630e1074
[mqtt.homeassistant] Fix thing consistency for existing things when a device adds or removes components (#17851)
* [mqtt.homeassistant] gracefully handle a component's discovery info being deleted

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-12-05 22:31:58 +01:00
Cody Cutrer
156e691d0b
[mqtt.homeassistant] fix multi-speed fans (#17813)
* fix step math so that the state description represents the step
   scaled to 0-100%

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-12-03 19:47:28 +01:00
Cody Cutrer
3f392ab80a
[mqtt.homeassistant] Implement Device Tracker (#17831)
* [mqtt.homeassistant] implement Device Tracker

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-12-03 06:10:44 +01:00
Cody Cutrer
546bb566e2
[mqtt.homeassistant] Fix duplicate component resolution when unique_id is set (#17803)
* [mqtt.homeassistant] fix duplicate component resolution when unique_id is set

unique_id is only unique per component type. so we need to a) take that into
account, and b) use that when resolving duplicates

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-11-25 22:04:29 +01:00
VasekCejka
f4250b77f3
[mqtt.homeassistant] Add missing climate properties (#17659)
* Added support for humidity and preset_modes 

Signed-off-by: Václav Čejka <V.Cejka@seznam.cz>
Signed-off-by: VasekCejka <150804231+VasekCejka@users.noreply.github.com>
2024-11-02 00:05:47 +01:00
Cody Cutrer
f52cede9ca
[mqtt.homeassistant] document which channels a component might have (#17618)
* [mqtt.homeassistant] document which channels a component might have

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-10-26 19:24:55 +02:00
Cody Cutrer
1926847559
[mqtt.homeassistant] Implement Text (#17624)
* [mqtt.homeassistant] Implement Text

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-10-25 18:51:55 +02:00
Cody Cutrer
df36e79925
[mqtt.homeassistant] bring AlarmControlPanel in line with current documentation (#17607)
* [mqtt.homeassistant] bring AlarmControlPanel in line with current documentation

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-10-25 17:12:04 +02:00
Cody Cutrer
a1f448eb23
[mqtt.homeassistant] Implement Valve (#17622)
Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-10-25 17:10:11 +02:00
Cody Cutrer
9efbb8137a
[mqtt.homeassistant] drop support for legacy schema vacuums (#17617)
Home Assistant dropped it in 2024.2.
See https://github.com/home-assistant/core/pull/107274

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-10-25 16:53:35 +02:00
Cody Cutrer
ecb1e960d3
[mqtt.homeassistant] JSON Attributes can exist on Climate (#17610)
Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-10-22 06:24:32 +02:00
Cody Cutrer
eac49a836f
[mqtt.homeassistant] Add support for Event component (#17599)
Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-10-21 22:48:01 +02:00
Cody Cutrer
f7c14fe9d8
[mqtt.homeassistant] bring channel ids inline with coding standards (#17604)
but only for newStyleChannels, which is already a breaking change of
most channels getting renamed for 4.3 anyway

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-10-21 22:10:09 +02:00
Cody Cutrer
722818c30a
[mqtt.homeassistant] Use a single channel for all events from a single button (#17598)
Use the `subtype` field to collapse multiple DeviceAutomation components into
a single channel.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-10-21 21:24:56 +02:00
Cody Cutrer
5cd76ee6ec
[mqtt.homeassistant] avoid improperly delivered triggers (#17584)
if multiple DeviceTrigger components share a topic, and each
has a payload value configured, only messages matching that
payload should be delivered to the corresponding channel

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-10-18 15:24:50 +02:00
Cody Cutrer
ab59bc871d
[mqtt.homeassistant] Implement optimistic components with AutoUpdatePolicy.RECOMMEND (#17520)
Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-10-08 08:45:11 +02:00
Cody Cutrer
31f6cda174
[mqtt.homeassistant] fix newStyleChannels (#17491)
* [mqtt.homeassistant] fix newStyleChannels
* further simplify channel IDs

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-10-07 23:28:50 +02:00
Cody Cutrer
5de73f923a
[mqtt.homeassistant] implement iif and is_defined jinja function and filters (#17435)
Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-09-26 21:25:36 +02:00
Cody Cutrer
6953c8bc6f
[mqtt.homeassistant] Fully implement Fan component (#17402)
Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-09-11 22:36:43 +02:00
Cody Cutrer
436dea619d
[mqtt.homeassistant] Implement template schema lights (#17399)
* [mqtt.homeassistant] implement template schema lights

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-09-10 22:37:05 +02:00
Cody Cutrer
110fd9b1ca
[mqtt.homeassistant] Use Jinjava directly (#17378)
* [mqtt.homeassistant] Use Jinjava directly

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-09-09 14:54:08 +02:00
jimtng
9c5689df90
[mqtt.generic] Support chaining transformations without an intersection symbol (#17290)
* [mqtt.generic] Support chaining transformations without an intersection symbol

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2024-09-01 12:54:37 +02:00
Cody Cutrer
740e44994f
[mqtt.homeassistant] Fix color lights that don't specify color_mode: true (#17240)
* [mqtt.homeassistant] Fix color lights that don't specify color_mode: true

See https://github.com/home-assistant/core/pull/111676

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-08-13 23:22:31 +02:00
Cody Cutrer
73a3f151c9
[mqtt] Simplify homeassistant thing types, and use AbstractStorageBasedTypeProvider (#16600)
* [mqtt.homeassistant] don't dynamically generate channel types

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-08-12 21:23:24 +02:00
Mark Herwege
f64cb0bbd5
[MQTT] Fix state description (#16866)
* fix state description

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2024-06-14 19:07:58 +02:00
Cody Cutrer
3ea1451050
[mqtt.homeassistant] Trigger HA devices to update discovery information (#16143)
* [mqtt.homeassistant] Trigger HA devices to update discovery information

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-01-22 22:36:53 +01:00
Cody Cutrer
a53b740c51
[mqtt.homeassistant] Improve support for Lock component (#16052)
* [mqtt.homeassistant] Improve support for Lock component

 * handle state and command payloads differing (as they do by default)
 * expose full state possibilities and OPEN command by adding
   a TextValue channel
* Recognize intermediate lock states as unlocked on the switch channel

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-01-02 20:02:47 +01:00
Jacob Laursen
f4596f581e
Update license headers to 2024 (#16168)
* Update copyright year in configuration
* Update license headers
* Manually update nibeheatpump headers (.cpp/.h/.ino)
* Manually update smsmodem header
* Manually update hueemulation header
* Manually update addon-header.xml header

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
2024-01-01 18:14:57 +01:00
Cody Cutrer
73559be058
[mqtt.homeassistant] Improve Cover support (#15875)
* [mqtt.homeassistant] improve Cover support

 * Add support for covers that report position
 * Handle when command and state values for OPEN/CLOSE/STOP
   differ (as they do by default)
 * Expose the full cover state, since it can have tell you
   if the cover is moving or not
 * Handle covers that have a position only, but not a state

* add constants to clarify up/down values

* Be sure to parse percents from strings in RollshutterValue

---------

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2023-12-11 19:11:27 +01:00
Cody Cutrer
9d214b0558
[mqtt.homeassistant] interpret a dimmable light as OFF properly from zigbee2mqtt (#15925)
* [mqtt.homeassistant] interpret a dimmable light as OFF properly from zigbee2mqtt

zigbee2mqtt can send a brightness of say 99, with a state of OFF, when a bulb is
off. make sure if state is sent, it overrides all other inferences

* handle brightness but not color bulbs

---------

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2023-11-25 12:47:00 +01:00
Cody Cutrer
935415aa6e
[mqtt.homeassistant] VETO updates to read only channels (#15937)
I.e. Button, Scene, and Binary Sensors.

Also ensure we set up the CommandDescription, since some value types mights use it.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2023-11-25 12:27:05 +01:00
Cody Cutrer
44e32d3fbb
[mqtt.homeassistant] implement effect channel for light (#15914)
Signed-off-by: Cody Cutrer <cody@cutrer.us>
2023-11-19 17:52:51 +01:00
Cody Cutrer
fc9579430e
[mqtt.homeassistant] Add support for Button component (#15892)
* [mqtt.homeassistant] Add support for Button component
* use a StringValue instead of an OnOffValue

---------

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2023-11-19 17:06:54 +01:00
Holger Friedrich
edaf17b345
Java 17 features (H-M) (#15520)
- add missing @override
- Java style array syntax
- remove redundant modifiers
- always move String constants to left side in comparisons
- simplify lambda expressions and return statements
- use replace instead of replaceAll w/o regex
- instanceof matching and multiline strings
- remove null check before instanceof

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-09-08 14:36:59 +02:00
Wouter Born
0c3934f3c8
Use Eclipse formatter 4.25 with Spotless (#15264)
This version still checks test files.

See: openhab/openhab-core#3515

Signed-off-by: Wouter Born <github@maindrain.net>
2023-07-18 09:02:05 +02:00
Holger Friedrich
428ccbe075
[mqtt][tradfri][webthing] Adapt to ColorUtil changes in core (#14810)
* [mqtt][tradfri][webthing] Adapt to ColorUtil changes in core

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-04-21 23:55:36 +02:00
Holger Friedrich
3cd9c6c86c
Adapt to ColorUtil changes in core (#14724)
* [deconz][dmx][mqtt.generic][mqtt.homeassistant][tado][tradfri][webthing] Adapt to core change (ColorUtil)

openhab/openhab-core#3479

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-04-08 11:42:18 +02:00
Cody Cutrer
f98f820325
[mqtt.homeassistant] Implement JSON schema lights (#13808)
* [mqtt.homeassistant] implement JSON schema lights
* [mqtt.homeassistant] use enum for current state of color mode
* [mqtt.homeassistant] use implicit lambdas
* [mqtt.homeassistant] remove string constants in favor of an enum
* [mqtt.homeassistant] allow sending ON and brightness commands through bare
* [mqtt.homeassistant] turn down debug logging

---------

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2023-03-26 18:07:20 +02:00
Cody Cutrer
f3ca3255a7
[mqtt.homeassistant] support command_template for fan components (#14233)
* [mqtt.homeassistant] support command_template for fan components
* [mqtt.homeassistant] fix field declaration for consistency

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2023-01-28 00:38:38 +01:00
Cody Cutrer
6d5b8a8cf5
[mqtt.homeassistant] add support for DeviceTrigger component (#14234)
Signed-off-by: Cody Cutrer <cody@cutrer.us>
2023-01-28 00:37:45 +01:00
Cody Cutrer
00c10e1015
[mqtt.homeassistant] add support for Number and Select components (#14230)
* [mqtt.homeassistant] add support for Select component

closes #13603

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2023-01-21 15:02:49 +01:00
Jacob Laursen
4dd6d3a8a2
Update license headers to 2023 (#14154)
* Update copyright year in configuration
* Update license headers

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
2023-01-06 09:49:54 +01:00
Sami Salonen
a1270c7822
[mqtt.homeassistant] Fix binding crash when home assistant discovery topics update with content (#13518)
* [mqtt.homeassistant] Fix for discovery topics that update with content

Fixes #13517
Possibly resolves #9711 and #12295 as well.

* [mqtt.homeassistant] Sort channels before changing thing
* [mqtt.homeassistant] logging + removed unnecessary synchronization
* Resolve bunch of warnings in homeassistant bundle
* [mqtt.homeassistant] Handling null warnings and unnecessary null checks
* [mqtt.homeassistant] Removing unnecessary null checks

Signed-off-by: Sami Salonen <ssalonen@gmail.com>
Co-Authored-by: @antroids github handle
2022-11-12 12:46:43 +01:00
Cody Cutrer
db0ca281ca
[mqtt.homeassistant] support non-RGB lights (#13413)
* [mqtt.homeassistant] support non-RGB lights

dynamically decide which type of channel to expose. also send "down-typed"
commands to the proper topic. this also sets the groundwork for supporting
template and JSON schemas

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-11-05 16:57:06 +01:00
Cody Cutrer
26ad08cca9
[mqtt] set the proper unit in the state description (#13604)
So that other pieces of openhab can know what unit it's going to be,
without it having a value yet. Importantly, any necessary conversion
that need to be applied to the other portion of the state description -
min, max, and step.

See also https://github.com/openhab/openhab-core/pull/3132

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-10-27 08:34:50 +02:00
Cody Cutrer
8656ba501a
[mqtt.homeassistant] support availability_templates (#13397)
Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-09-19 23:00:01 +02:00
Sami Salonen
295df504c8
[mqtt.homeassistant] More readable label for discovered things (#13402)
* [mqtt.openassistant] Better labels for discoverd things

This PR introduces more simple label for things, instead of
"My Sensor (Sensor, Sensor, Sensor, Sensor, Sensor, Switch)" we have
simply "Me Sensor (5x Sensor, Switch)".

Signed-off-by: Sami Salonen <ssalonen@gmail.com>
2022-09-18 21:22:06 +02:00