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

[shelly] Add totalKWH channels for Shelly Pro 3EM #17602

Merged
merged 4 commits into from
Oct 25, 2024

Conversation

JonathanvdGHU
Copy link
Contributor

@JonathanvdGHU JonathanvdGHU commented Oct 21, 2024

Added totalKWH channels for Shelly Pro 3EM

Description

I added the missing totalKWH channels for the Shelly Pro 3EM, see #16772. There is also a new totalKWH channel created for the entire device. The channels for reactivewatts are left untouched because I couldn't locate the associated data.

After linking items to the totalKWH channels I noticed that the values only update when you restart OpenHAB at least once.
This also happens for other channels so it's not related to this pull request.

I am btw not really familiar with the code so there are probably some improvements.

Signed-off-by: Jonathan van de Giessen <jonathan.vandegiessen@student.hu.nl>
Signed-off-by: Jonathan van de Giessen <jonathan.vandegiessen@student.hu.nl>
@jlaur jlaur changed the title Added totalKWH channels for Shelly Pro 3EM [shelly] Add totalKWH channels for Shelly Pro 3EM Oct 21, 2024
@jlaur jlaur added the enhancement An enhancement or new feature for an existing add-on label Oct 21, 2024
@JonathanvdGHU
Copy link
Contributor Author

@jlaur To be honest, it's a bug fix and an enchancement at the same time. The totalKWH channel for each meter already existed but some work was forgotten and that was why it didn't work.

Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

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

One question, otherwise LGTM
Channels do not seem to be created dynamically, so this would also require thing upgrade instructions.

For future PR's it would be nice to seperate the bug fix and the enhancement. This would make it possible to 1. easy backport bug fixes and 2. list the changes/fixes speerately in the release notes.

@JonathanvdGHU
Copy link
Contributor Author

One question, otherwise LGTM Channels do not seem to be created dynamically, so this would also require thing upgrade instructions.

For future PR's it would be nice to seperate the bug fix and the enhancement. This would make it possible to 1. easy backport bug fixes and 2. list the changes/fixes speerately in the release notes.

The totalKWH channel for each meter is created when data is written to it. So those are created dynamically. The totalKWH channel for the entire device also pops-up without changing anything other than replacing the current Shelly binding.

I don't mind to creating an extra pull request, so would you prefer I make a new one?

Signed-off-by: Jonathan van de Giessen <jonathan.vandegiessen@student.hu.nl>
@JonathanvdGHU JonathanvdGHU requested a review from lsiepel October 23, 2024 06:03
Signed-off-by: Jonathan van de Giessen <jonathan.vandegiessen@student.hu.nl>
@lsiepel lsiepel merged commit ec378ab into openhab:main Oct 25, 2024
5 checks passed
@lsiepel lsiepel added this to the 4.3 milestone Oct 25, 2024
KaaNee pushed a commit to KaaNee/openhab-addons that referenced this pull request Nov 8, 2024
* added totalkwh channel

Signed-off-by: Jonathan van de Giessen <jonathan.vandegiessen@student.hu.nl>
matchews pushed a commit to matchews/openhab-addons that referenced this pull request Dec 16, 2024
* added totalkwh channel

Signed-off-by: Jonathan van de Giessen <jonathan.vandegiessen@student.hu.nl>
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.

3 participants