[easee] Add ability to retrieve total consumption per user#20176
[easee] Add ability to retrieve total consumption per user#20176lsiepel merged 14 commits intoopenhab:mainfrom
Conversation
83b6d28 to
1f54725
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds support for retrieving total energy consumption per user in the Easee binding. It introduces a new "user" thing type that automatically discovers users with access to an Easee site and polls their consumption data.
Changes:
- Added new user thing type with automatic discovery and a totalConsumption channel
- Refactored common handler functionality into EaseeBaseThingHandler to reduce code duplication
- Enhanced AbstractCommand with improved null safety and generic transform method
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| user-channel-groups.xml | New channel group definition for user consumption tracking |
| things.xml | Added user thing type configuration with site bridge reference |
| config.xml | Added user ID configuration parameter |
| EaseeUserHandler.java | New handler implementing polling for user consumption data |
| EaseeBaseThingHandler.java | New base class extracting common functionality from handlers |
| EaseeChargerHandler.java | Refactored to extend base class, removing duplicate code |
| GetUserTotalConsumption.java | New command to fetch and sum yearly user consumption data |
| GetSiteUsers.java | New command to fetch site users for discovery |
| AbstractCommand.java | Enhanced transform method with generics and improved null safety |
| SiteState.java | Updated to use new transform method signature |
| EaseeSiteDiscoveryService.java | Added user discovery functionality |
| EaseeHandlerFactory.java | Added user handler instantiation |
| EaseeBindingConstants.java | Added constants for user support and API endpoints |
| README.md | Updated documentation with user thing type details and examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lsiepel
left a comment
There was a problem hiding this comment.
Looked at all files and came to these comments. But before you look into this, i wonder if adding a new thing user just to have one channel added is the right way.
If i understand it correctly, a site can have multiple users ? And if so, do they all have a different totalConsumption? How does that work?
If there is just one user or multiple users share the same totalConsumption value, i would consider to just add the channel to the site thing.
|
@lsiepel Regarding the general question: A site can have multiple users and totalConsumption is measured for each user differently. There could be more per-user data added in future, e.g.
I think with such extensions in mind it makes sense to model it that way. Otherwise the charger will hold all the data and this will soon get confusing. |
Signed-off-by: Alexander Friese <af944580@googlemail.com>
Signed-off-by: Alexander Friese <af944580@googlemail.com>
Signed-off-by: Alexander Friese <af944580@googlemail.com>
Signed-off-by: Alexander Friese <af944580@googlemail.com>
Signed-off-by: Alexander Friese <af944580@googlemail.com>
Signed-off-by: Alexander Friese <af944580@googlemail.com>
Signed-off-by: Alexander Friese <af944580@googlemail.com>
Signed-off-by: Alexander Friese <af944580@googlemail.com>
…nding/easee/internal/handler/EaseeChargerHandler.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Alexander Friese <alexf2015@users.noreply.github.com>
Signed-off-by: Alexander Friese <af944580@googlemail.com>
Signed-off-by: Alexander Friese <af944580@googlemail.com>
…ing/things.xml Co-authored-by: lsiepel <leosiepel@gmail.com> Signed-off-by: Alexander Friese <alexf2015@users.noreply.github.com>
…nding/easee/internal/command/site/GetSiteUsers.java Co-authored-by: lsiepel <leosiepel@gmail.com> Signed-off-by: Alexander Friese <alexf2015@users.noreply.github.com>
…nding/easee/internal/handler/EaseeUserHandler.java Co-authored-by: lsiepel <leosiepel@gmail.com> Signed-off-by: Alexander Friese <alexf2015@users.noreply.github.com>
Description
This adds ability to retrieve total consumption per user.
Changes: