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

Iotawatt sensor can no longer be used with energy screen following change #55510 #55554

Closed
jyavenard opened this issue Sep 2, 2021 · 17 comments

Comments

@jyavenard
Copy link
Contributor

jyavenard commented Sep 2, 2021

The problem

PR #55510 removed the state_class attribute from the created sensor.

Without it, you can't use the sensors with the energy screen which is pretty much the only place where the iotawatt sensors are of value.

image

PR #55510 should be partially reverted ; no one will use the iotawatt integration otherwise.

What is version of Home Assistant Core has the issue?

core-2021.10.0.dev0

What was the last working version of Home Assistant Core?

core-2021.10.0.dev0

What type of installation are you running?

Home Assistant Core

Integration causing the issue

iotawatt

Link to integration documentation on our website

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@jyavenard jyavenard changed the title Iotawatt sensor can no longer be used with energy screen following change ##55510 Iotawatt sensor can no longer be used with energy screen following change #55510 Sep 2, 2021
@jyavenard
Copy link
Contributor Author

The documentation for iotawatt indicates to use the integration but this one can go negative just the same as an energy sensor.

@balloob
Copy link
Member

balloob commented Sep 2, 2021

The documentation notes how to split main into import and export and then use an integration to calculate totals

@jyavenard
Copy link
Contributor Author

The documentation notes how to split main into import and export and then use an integration to calculate totals

I am aware of that, but surely preventing to use directly the sensor in the energy screen and to instead force the user to create an integration, which will suffer from the exact same fate if the power read is negative (if the energy read is negative, so will the power) can't be the solution.

@jyavenard
Copy link
Contributor Author

jyavenard commented Sep 2, 2021

having to use an integration means that there will be data loss when HA is restarted, worse if when you restart HA you have a high power read, the integration will assume that this high power read is the average since the last read and will add exceptionally high energy measurement.

I've seen this happening plenty of times, same if the iotawatt stops responding (and it does so often due to my flaky wifi setup where the iotawatt is located) the integration just apply the power read on the entire lapsed duration.

The day HA introduced the energy screen, I made attempt to use the integration; I've discussed at length with @dgomes on how we could resolve all the downsides of using integration. It's not a long term suitable solution.

I've created #55512 to resolve all those issues

@probot-home-assistant
Copy link

Hey there @gtdiehl, mind taking a look at this issue as it has been labeled with an integration (iotawatt) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)


iotawatt documentation
iotawatt source
(message by IssueLinks)

@agners
Copy link
Member

agners commented Sep 2, 2021

having to use an integration means that there will be data loss when HA is restarted

I do agree with @jyavenard: Using the IoTaWatt's integration feature (and query wh directly) is much preferred as the integration happens in much smaller intervals than what we are polling, leading to higher accuracy.

I think where Paulus' change change came from was that when using a calculated output of certain types integration on IoTaWatt side is not possible, leading to sensors with 0 value. But that should not prevent use of IoTaWatt's integration for all other, regular input sensors or output sensors.

@darek-margas

This comment has been minimized.

@bmorgan99

This comment has been minimized.

@DannyBoyk
Copy link

I just installed an IoTaWatt and just started using Home Assistant and found this integration. As this bug indicates, I can't use any of the sensors that the IoTaWatt integration is providing in the Energy screen. I also see in this other issue that the outputs are no longer included, so the documentation's suggestion of making a new sensor also doesn't work.

@jyavenard
Copy link
Contributor Author

If you wait for 2021.10 ; the accumulated sensor will be available with the energy screen.
Or you can use the HACS version which is compatible with 2021.10 but with all sensors usable in the energy screen

@grantclem
Copy link

Hi Jean,
I have recently become a Iotawatt/2021.10 user and was wondering if the accumulated sensor/s (in integrations, not HACS) were now the ones to use in the Energy panel of HA? There is no mention of any changes here (https://rc.home-assistant.io/blog/2021/09/29/release-202110/) if this is the case. The community forum appears to be redundant if this is the case. Thanks in advance Grant

@jyavenard
Copy link
Contributor Author

I have recently become a Iotawatt/2021.10 user and was wondering if the accumulated sensor/s (in integrations, not HACS) were now the ones to use in the Energy panel of HA?

Yes, the accumulated sensors are usable with the energy screen since 2021.10

The HACS version let you use any energy sensors in the energy screen, not just the accumulated sensor.
I've just pushed a change (#56974).

The HACS version also have the advantage that you can rename the sensors which the official version wouldn't let us do

@grantclem
Copy link

Thanks for the quick response, can I assume the - platform: integration sensors are now not needed?

@jyavenard
Copy link
Contributor Author

that's correct. The accumulated sensor are much more accurate too

@jyavenard
Copy link
Contributor Author

I'm modifying the documentation as we speak

@grantclem
Copy link

Great stuff, thanks very much

@github-actions
Copy link

github-actions bot commented Jan 1, 2022

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jan 1, 2022
@github-actions github-actions bot closed this as completed Jan 8, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Feb 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants