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

Feature request: support power input sensors in kW #290

Open
pjvenda opened this issue May 22, 2024 · 6 comments
Open

Feature request: support power input sensors in kW #290

pjvenda opened this issue May 22, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@pjvenda
Copy link

pjvenda commented May 22, 2024

Hi, thanks for the great work!

I've started using the add-on, but struggled to get any meaningful information. It turns out that all my power sensors (powerwall) are in kW and there is no way to use them as they are, so I've had to create templates that take the same value *1000.

Not only do I need to wait at least 2 days to be able to use the sensors, but I am missing the entire data set that I could use to feed into the ML forecaster.

My suggestion is to have a switch that enables using sensors in kW, that would just multiply the input by 1000 before using. It's not a big deal, more a nice to have. Surely I'm not the only one to face this type of issue?

Thanks in advance!

@pjvenda pjvenda changed the title Improvement: support input sensors in kW Feature request: support power input sensors in kW May 22, 2024
@anton4
Copy link

anton4 commented May 22, 2024

Sofar hybrid 5K...20KTL-3PH have the same issue, all power sensors are in kW and not in W and have to use template to divide the values with 1000.

@pjvenda
Copy link
Author

pjvenda commented May 24, 2024

so... I took a stab at it: #292

@purcell-lab
Copy link
Contributor

One interesting effect is text sensors are character limited to 255.

If you have 48x intervals in Watt [12000, 13000, 14000, ...] each interval using 7 characters, 48x intervals requires 366 characters, which cannot be represented in a input_text sensor, but can be in attributes which are difficult to store.

For this reason I currently calculate my load power forecast array in kW and convert back to W in the payload:

{{states('sensor.power_load_no_var_loads')|int(0)}}
{{ states('input_text.fi_fo_buffer')}}
{{ states('input_text.fi_fo_buffer')|length}}          

"load_power_forecast": {{
          ([states('sensor.power_load_no_var_loads')|int(0)]
          + (states('input_text.fi_fo_buffer').split(', ')|map('multiply',1000)|map('int')|list)[1:])}}
1185
0.4, 1.1, 1.1, 0.4, 1.1, 1.1, 1.0, 1.3, 1.4, 1.3, 2.0, 1.5, 1.6, 2.0, 1.6, 1.7, 6.8, 1.5, 1.6, 2.0, 1.7, 1.8, 0.3, 0.3, 0.6, 1.2, 1.6, 2.8, 1.6, 0.4, 0.3, 2.2, 0.5, 1.0, 0.3, 0.3, 0.5, 0.4, 0.4, 0.6, 0.7, 1.3, 1.4, 1.2, 1.1, 1.0, 1.0, 1.1
238          

"load_power_forecast": [1185, 1100, 1100, 400, 1100, 1100, 1000, 1300, 1400, 1300, 2000, 1500, 1600, 2000, 1600, 1700, 6800, 1500, 1600, 2000, 1700, 1800, 300, 300, 600, 1200, 1600, 2800, 1600, 400, 300, 2200, 500, 1000, 300, 300, 500, 400, 400, 600, 700, 1300, 1400, 1200, 1100, 1000, 1000, 1100]

@pjvenda
Copy link
Author

pjvenda commented Jun 12, 2024 via email

@purcell-lab
Copy link
Contributor

So are you suggesting this change is not viable due to the way that the array of load values is stored in an input_text?

No suggesting quite the opposite.

I'm my experience it becomes difficult to store an array of 48x timeslots in W in an input_text, but an array of 48x timeslots in kW is easier to store in an input_text.

So your PR is very welcome.

@pjvenda
Copy link
Author

pjvenda commented Jun 12, 2024 via email

@davidusb-geek davidusb-geek added the enhancement New feature or request label Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants