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

Smartplugv2_energy.yaml file missing class state #3000

Open
5 tasks done
epajfl00 opened this issue Feb 23, 2025 · 3 comments
Open
5 tasks done

Smartplugv2_energy.yaml file missing class state #3000

epajfl00 opened this issue Feb 23, 2025 · 3 comments
Labels
device improvement Improvement to an existing device config unreleased Will be in next release

Comments

@epajfl00
Copy link

Description

id 17 with the category of diagnostic is missing the class: measurement, as per other id's.

This has been happening for many months, and thought that others would report it, I have been adding the extra line and fixing this myself after each update, it's time to have this fixed properly, thanks.

Easy fix.

Steps to reproduce

No response

Expected behaviour

No response

Additional context

Image

Confirmation

  • I am sure this is a bug or improvement, that is well enough described that it can be implemented.

  • This report is for tuya-local, not for localtuya.

  • If this is for a specific device, the device config is mentioned above, or diagnostics are included.

  • Log messages or diagnostics relevant to the issue are included.

  • This is not requesting addition of a new device.

@epajfl00 epajfl00 added the bug Something isn't working label Feb 23, 2025
@make-all
Copy link
Owner

Probably it would be better to remove the entity for that, and move it to an attribute, since the information reported in dp 17 is next to useless.

@make-all
Copy link
Owner

make-all commented Feb 23, 2025

On second thoughts, I think the best solution for smartplugs that have "Energy" sensors that are not suitable to be used with device class: energy will be to disable the entity by default to avoid confusing users that they have a usable energy sensor, but add state class: measurement so that if they are enabled by the user, they can track the long term statistics for the sensor.

@make-all make-all added device improvement Improvement to an existing device config full_info All info needed was provided and removed bug Something isn't working labels Feb 23, 2025
@make-all make-all moved this to 🔖 Ready in Tuya Local Feb 23, 2025
make-all added a commit that referenced this issue Feb 23, 2025
Many smartplugs provide an "add_ele" dp which reports energy usage
over such a short period that it is not usable as an energy sensor
within HA. On some smartplugs this was initially exposed as a sensor
entity in case it was useful in specific cases, but in general we now
know it is not useful, so later configs have this as an attribute of
the switch or power sensor instead.

For those configs that have it as a separate entity, this change
disables the entity by default, to avoid confusing users over its
usefulness. The change also adds the measurement class so that if
users enable it, they can get long term statistics.

Issue #3000
@make-all make-all added awaiting confirmation Wating for confirmation the issue is solved unreleased Will be in next release and removed full_info All info needed was provided labels Feb 23, 2025
@make-all make-all moved this from 🔖 Ready to ✅ Done in Tuya Local Feb 23, 2025
@epajfl00
Copy link
Author

Thanks, works fine now.

@make-all make-all removed the awaiting confirmation Wating for confirmation the issue is solved label Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
device improvement Improvement to an existing device config unreleased Will be in next release
Projects
Status: ✅ Done
Development

No branches or pull requests

2 participants