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

Load Box color switched for Load2 and Load3 #467

Closed
1 task done
Scoperius opened this issue Jun 2, 2024 · 11 comments
Closed
1 task done

Load Box color switched for Load2 and Load3 #467

Scoperius opened this issue Jun 2, 2024 · 11 comments
Labels
type/bug Something isn't working

Comments

@Scoperius
Copy link

Scoperius commented Jun 2, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Box color for Load2 is based on Load3 value and for Load3 is based on Load2 value

Steps To Reproduce

Last version available for today. Used is Lite card version

Expected behaviour

Load2 box color based on Load2 value
Load3 box color based on Load3 value

Card Version

Last

Home Assistant Version

Last

Configuration

No response

Relevant log output

No response

@Scoperius Scoperius added the type/bug Something isn't working label Jun 2, 2024
@slipx06
Copy link
Owner

slipx06 commented Jun 2, 2024

@Scoperius I cant reproduce this. Everything looks good on my end. Please share your config or more info

essential_load1: sensor.sunsynk_pv1_power
essential_load2: sensor.sunsynk_pv2_power
essential_load3: input_number.test_number
essential_load4: sensor.sunsynk_pv3_power

image

@Scoperius
Copy link
Author

Hi, I have only 3 loads. see the configuration:

load:
  show_daily: true
  additional_loads: 3
  load1_name: IVT AirX-130
  load1_icon: mdi:heat-pump-outline
  load2_name: 'Bazén '
  load2_icon: mdi:pool
  auto_scale: true
  dynamic_colour: true
  dynamic_icon: true
  load3_name: Výřivka
  load3_icon: mdi:pool-thermometer

image

  essential_load2: sensor.pl06_plug_tu_power
  essential_load2_extra: sensor.filtrace_spotreba
  essential_load3: sensor.vyrivka_denni_spotreba

@slipx06
Copy link
Owner

slipx06 commented Jun 2, 2024

Found the problem. Thanks for reporting

@slipx06 slipx06 closed this as completed in 0f8bbc8 Jun 2, 2024
@Scoperius
Copy link
Author

Now the box for Load2 is not colored at all.

@Scoperius
Copy link
Author

Screenshot_20240604_142410.jpg

@slipx06
Copy link
Owner

slipx06 commented Jun 4, 2024

Have you defined an off_threshold? I can reproduce the problem. I'll investigate.

Its a rounding and conversion issue. The logic was only checking the state which is 0.3 which is being rounded to 0.

slipx06 added a commit that referenced this issue Jun 4, 2024
fix: off_threshold is based on watt (W) value. Fixes #467
fix: extend dynamic colour to inverter path on full card. Only active if dynamic colour is enabled for load and battery objects closes #474
@Scoperius
Copy link
Author

Scoperius commented Jun 4, 2024 via email

@Scoperius
Copy link
Author

Scoperius commented Jun 4, 2024 via email

@slipx06
Copy link
Owner

slipx06 commented Jun 4, 2024

It depends on your unit of measurement. The calculation will always try convert to W or Wh before checking if > than off_threshold. If you don't provide an expected unit of measurement i.e. W, kW, Wh, kWh then it will simply round that value and then do the calculation i.e. 01-0.4 will round down to 0, 0.5-0.9 will round up to 1.

@purcell-lab
Copy link

Thanks for this PR. I was just about to implement a off threshold in my power sensor template for each of my devices, but I see this capability is inbuilt.

Brilliant!

@Scoperius
Copy link
Author

Scoperius commented Jun 5, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants