Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[boschshc] Support for Smart Water Alarm #16770

Merged
merged 3 commits into from
May 29, 2024

Conversation

david-pace
Copy link
Member

@david-pace david-pace commented May 18, 2024

Adds support for Bosch Smart Water Alarm devices.

  • add new thing type and new channel types
  • add new services for water detector
  • refactor CameraNotificationState and PrivacyModeState to a common enum EnabledDisabledState that can be re-used in the water detector tilt service states
  • implement handler for new device
  • register new device in handler factory and discovery
  • add unit tests
  • add documentation

closes #16593

@david-pace david-pace added the enhancement An enhancement or new feature for an existing add-on label May 18, 2024
@david-pace david-pace force-pushed the 16593-water-detector branch 2 times, most recently from b17e9a5 to 10541f7 Compare May 18, 2024 13:50
Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flawless, many thanks! Will let @GerdZanker have a look before merging.

@david-pace
Copy link
Member Author

david-pace commented May 19, 2024

Thanks for the review @jlaur ❤️

We should also wait for the confirmation by @name-lake in #16593 whether the sensor-moved channel works. Everything else was already tested with the actual hardware 👍

Copy link
Contributor

@GerdZanker GerdZanker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@david-pace david-pace added the work in progress A PR that is not yet ready to be merged label May 20, 2024
@david-pace
Copy link
Member Author

david-pace commented May 20, 2024

Hi @mherwege, I have a question about the trigger channel. In the documentation I found that the most suitable system trigger channel type would probably be system.trigger, correct?

I now defined the channel in thing-types.xml like this:

<channel id="sensor-moved" typeId="system.trigger"/>

But I could not find which types of commands I am supposed to send to this channel. Should I send OnOffType.ON commands to trigger, or are there specialized trigger commands for these types of channels?

@mherwege
Copy link
Contributor

I used it extensively in the Elro Connects binding for a similar use. I defined specific channel types for it. The handler has a method triggerChannel to trigger it. Have a look here: https://github.com/openhab/openhab-addons/tree/main/bundles/org.openhab.binding.elroconnects.

@jlaur
Copy link
Contributor

jlaur commented May 20, 2024

@david-pace - you can also have a look at #16704 showing an end-to-end implementation of a trigger channel.

Adds support for Bosch Smart Water Alarm devices.

* add new thing type and new channel types
* add new services for water detector
* refactor CameraNotificationState and PrivacyModeState to a common enum
EnabledDisabledState that can be re-used in the water detector tilt
service states
* implement handler for new device
* register new device in handler factory and discovery
* add unit tests
* add documentation

Signed-off-by: David Pace <dev@davidpace.de>
Signed-off-by: David Pace <dev@davidpace.de>
Signed-off-by: David Pace <dev@davidpace.de>
@david-pace david-pace removed the work in progress A PR that is not yet ready to be merged label May 28, 2024
@david-pace
Copy link
Member Author

Hi @jlaur and @mherwege, the code is now open for a final review 👍 It was tested with the real hardware by a helpful user in #16593 already ❤️

Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still LGTM :)

@jlaur jlaur merged commit 170d81b into openhab:main May 29, 2024
5 checks passed
@jlaur jlaur added this to the 4.2 milestone May 29, 2024
@david-pace david-pace deleted the 16593-water-detector branch May 30, 2024 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[boschshc] Add support for water detector
4 participants