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: Differentiate between power consumed/produced variables #28

Open
wminno opened this issue Mar 14, 2023 · 3 comments
Open
Labels
enhancement New feature or request

Comments

@wminno
Copy link

wminno commented Mar 14, 2023

Dutch power meters don't have a 'negative' power variable. Instead they have power_consumed and power_produced variables.
The second you don't draw power, the P1 port of the meter will increase the power_produced counter instead.

So with solar panels, your widget will show for example 14A in use @ 0 watt (as there's 14 amps of power pushed back into the grid)

It'd be great that you could put two variables in your widget:
power_consumed: sensor.1
power_produced: sensor.2

If there's a >0 value in either, it'll show either the power pulled out of the net or pushed back into the grid.
If value ==0 on both, the phase is not used currently.

See attached:
Screen Shot 2023-03-14 at 13 25 47

@wminno
Copy link
Author

wminno commented Mar 14, 2023

Actually, I worked around this by creating a combined power sensor in the configuration.yaml that takes the net power usage from both sensors on the phases and combines them into a single one:

template:

  • sensor:

    • name: "Stroomverbruik netto L1"
      unique_id: "stroom_netto_l1"
      unit_of_measurement: "W"
      state: >
      {{ states ('sensor.phases_power_consumed_phase_l1') | float(0) | round(0)
      - states ('sensor.phases_power_produced_phase_l1') | float(0) | round(0) }}
  • sensor:

    • name: "Stroomverbruik netto L2"
      unique_id: "stroom_netto_l2"
      unit_of_measurement: "W"
      state: >
      {{ states ('sensor.phases_power_consumed_phase_l2') | float(0) | round(0)
      - states ('sensor.phases_power_produced_phase_l2') | float(0) | round(0) }}
  • sensor:

    • name: "Stroomverbruik netto L3"
      unique_id: "stroom_netto_l3"
      unit_of_measurement: "W"
      state: >
      {{ states ('sensor.phases_power_consumed_phase_l3') | float(0) | round(0)
      - states ('sensor.phases_power_produced_phase_l3') | float(0) | round(0) }}

@Sese-Schneider
Copy link
Owner

I'm not sure if I should change the implementation of my card here.
I'd rather have Template Support, so you don't have to create template sensors, but do it inline.

What do you think about that?

@wminno
Copy link
Author

wminno commented Mar 17, 2023

Having that in the card would be definitely nice. But if it's a major development hurdle like you mentioned, is it -really- worth it. Given you can quite easily do it with template sensors (took me 30 mins of fiddling to get it working). And if you need to do some corner cases, like me adding in-house real time usage based on PV delivery and power meter values, I may fall back to template sensors in the end after all..

Do love this card, thanks for it :)

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

2 participants