question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple entities and grouping with different calculation modes

See original GitHub issue

I´ve added multiple entities with different fixed calculation values to a group and wanted it to create a summary entity. The summary entity just uses the power consumption of last added entity and ignores the rest. In the first place the summary entity showed Unknown as value, i removed the create_group and then added it again, after that the problem above showed up.

This is my config.

sensor:
  - platform: powercalc
    create_group: All heaters
    entities:
      - entity_id: switch.heizung_working_room_on_off
        name: Arbeitszimmer
        fixed:
          power: 900
      - entity_id: switch.heizung_bad_on_off
        name: Bad
        fixed:
          power: 450
      - entity_id: switch.heizung_schlafzimmer_on_off
        name: Schlafzimmer
        fixed:
          power: 580
      - entity_id: switch.heizung_flur_on_off
        name: Flur
        fixed:
          power: 580
      - entity_id: switch.heizung_living_room_on_off
        name: Wohnzimmer
        fixed:
          power: 900

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
bramstrokercommented, Oct 3, 2021

Will be fixed with #304

1reaction
bramstrokercommented, Oct 1, 2021

@nicodoerr Was able to reproduce the issue with name properties. I have some ideas how to fix it, however the fix is far from simple. Have some unwanted side effects with a few things I tried. Not sure if I will fix it at all because it is really an edge case, which I don’t think many users will experience.

The bug will arise when the source entity has a unique id. The energy sensor will also be created with this unique id. When you change the name later on the energy sensor will keep the old entity_id (this is because the energy sensor has a unique id). The group sensors will refer to the new entity_id so that’s why they are broken.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding Calculation Groups - SQLBI
There are two entities to consider: calculation groups and calculation items. A calculation group is a collection of calculation items, ...
Read more >
4.4.3 Calculating the mode - Statistique Canada
When it's unique, the mode is the value that appears the most often in a data set and it can be used as...
Read more >
Calculation groups in Analysis Services tabular models
Values for each row are calculated from the base measure, Sales. Calculation groups work with explicit DAX measures.
Read more >
Calculated Fields | Visualize and present data - Mode Support
Calculated Field Component Types ; 1, Constant, A fixed value. 1. TRUE ; 2, Scalar, Values are mapped to a single result in...
Read more >
How To Calculate Mode (With Examples) | Indeed.com
Learn what a mode is in data sets and how to calculate mode, and explore several examples of using mode.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found