Conversation
They get sent through the openHAB event bus, and can be used in rules via custom triggers. Signed-off-by: Cody Cutrer <cody@cutrer.us>
|
I'm thinking we should implement several actions:
As well as emulate some actions from Home Assistant:
It would be really cool if we could bridge directly into openHAB actions, including Thing actions. Then if we also implement Thing actions to represent actions published by ESPHome devices, a device could even (semi-)directly call actions on other devices. |
There was a problem hiding this comment.
Pull Request Overview
This pull request adds support for actions and events from ESPHome devices, allowing them to send action requests, events, and tag scan notifications through the openHAB event bus for use in rules and automation.
- Adds event handling for ESPHome actions, events, and tag scanning via new event types
- Implements custom trigger handlers for UI-based automation rules
- Adds configuration option to enable/disable action and event processing
Reviewed Changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/no/seime/openhab/binding/esphome/events/*.java | Event classes and factory for ESPHome action, event, and tag scanned events |
| src/main/java/no/seime/openhab/binding/esphome/internal/module/handler/*.java | Trigger handlers and factory for automation module integration |
| src/main/java/no/seime/openhab/binding/esphome/internal/handler/ESPHomeHandler.java | Main handler updates to process incoming actions/events and publish to event bus |
| src/main/resources/OH-INF/automation/moduletypes/*.json | Automation trigger type definitions for UI integration |
| src/main/resources/OH-INF/thing/thing-esphome.xml | Thing configuration for allowActions parameter |
| README.md | Documentation for actions and events functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/main/java/no/seime/openhab/binding/esphome/events/ESPHomeEventFactory.java
Show resolved
Hide resolved
src/main/java/no/seime/openhab/binding/esphome/events/ESPHomeEventFactory.java
Outdated
Show resolved
Hide resolved
src/main/resources/OH-INF/automation/moduletypes/TagScannedTrigger.json
Outdated
Show resolved
Hide resolved
src/main/resources/OH-INF/automation/moduletypes/EventTrigger.json
Outdated
Show resolved
Hide resolved
src/main/resources/OH-INF/automation/moduletypes/ActionTrigger.json
Outdated
Show resolved
Hide resolved
|
Thanks @ccutrer, could you also create an integration test like the ones found here : src/test/java/no/seime/openhab/binding/esphome/devicetest ? In addition to further testing it also serves as an example for users. |
Signed-off-by: Cody Cutrer <cody@cutrer.us>
per discussion in openhab-core Signed-off-by: Cody Cutrer <cody@cutrer.us>
Signed-off-by: Cody Cutrer <cody@cutrer.us>
Signed-off-by: Cody Cutrer <cody@cutrer.us>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 22 out of 23 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
src/main/java/no/seime/openhab/binding/esphome/internal/handler/ESPHomeHandler.java:1
- The comparison is checking if the event source equals the deviceId directly, but the event source is formatted as 'no.seime.openhab.binding.esphome$deviceId'. This comparison should use the formatted source or extract the device ID from the source.
/**
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Also, the latest comment from copilot doesn't make sense to me, but you might understand where in the codebase it actually refers to? |
The one about comparing the event source to the device id directly? Yeah, I have no idea what it's talking about there. There is no comparison against event source in ESPHomeHandler.java. I didn't even see it at first because it's tagged as "low confidence". |
|
Thanks for contributing @ccutrer ! |
They get sent through the openHAB event bus, and can be used in rules via custom triggers. See updates in the readme and a screenshot for more details.