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

kWh modifier introduced in 1.6.1 not working correctly #45

Closed
dannerph opened this issue Jan 3, 2021 · 4 comments
Closed

kWh modifier introduced in 1.6.1 not working correctly #45

dannerph opened this issue Jan 3, 2021 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@dannerph
Copy link

dannerph commented Jan 3, 2021

Thanks for providing this very nice looking power distribution card. I am currently integrating data from the EON Energiemonitor in order to visualize the regional energy generation/demand using your card. However I found a small bug:

if ((item as EntitySettings).unit_of_measurement == ('kW' || 'kWh')) modifier *= 1000;

('kW' || 'kWh') is always 'kW'.
I would suggest to check for unit_of_measurement.startsWith('k') in order to be generic for all kinds of units. This might be extended with 'M' and 'G' later on.

@dannerph
Copy link
Author

dannerph commented Jan 3, 2021

The data from the energiemonitor is in kWh, as it describes the cumulative power within a period of 15 minutes. I know that the power-distribution-card targets power, but as it also has the (broken) support for energy, I would be glade use it for my purpose ;)

@JonahKr
Copy link
Owner

JonahKr commented Jan 3, 2021

Hey there 👋 @dannerph ,

However I found a small bug:

This piece was the result from here: #30 . initially i only supported kWh and Wh and so that was the quickest solution i came up with and, as you pointed out, definitely not the best 😉 .

This might be extended with 'M' and 'G' later on.

I don't really see any usecase where someone would create such power without a reactor in his backyard but ofc by using it with different units this might actually be relevant.

The only reason its restricted at all, is the automatic calculations of the autarky/ratio(Eigenverbrauchsanteil). But considering that the card got more customizable, i need to rethink this whole concept.
I will implement these changes probably this evening if i have time and see if i need to implement additional checks for when units don't line up.

Thanks for your Issue 👍

For the second Comment, i am a bit curious how this works : is it just the cumulative power of the last 15minutes * 4 or kW(15min) ?

@JonahKr JonahKr self-assigned this Jan 3, 2021
@JonahKr JonahKr added the bug Something isn't working label Jan 3, 2021
@JonahKr JonahKr added this to the v2.1 milestone Jan 3, 2021
@dannerph
Copy link
Author

dannerph commented Jan 3, 2021

Thanks for having a look on this issue!

A use case for bigger power/energy values might be if someone wants to visualize the energy import/export of a country, e.g. using data from ENTSO-E or the electricity map. I do not know if this is already done, however it would be possible ;)

The EON Energiemonitor provides energy in kWh for a 15 min period. Thus, I am fine with visualising energy as kWh, however it should be scaled correctly ;)

JonahKr added a commit that referenced this issue Jan 3, 2021
@JonahKr
Copy link
Owner

JonahKr commented Jan 3, 2021

I think i fixed it now. I will work on one more thing for today and then release the patch. Thanks for the report 👍

@JonahKr JonahKr closed this as completed Jan 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants