home-assistant / home-assistant.io

:blue_book: Home Assistant User documentation
https://www.home-assistant.io
Other
4.83k stars 7.22k forks source link

Riemann sum goes negative #29234

Open d3zit opened 12 months ago

d3zit commented 12 months ago

Feedback

It's been largely discusses, but it keeps happening. image

        - name: "input_power_with_efficiency_loss"
          unique_id: "input_power_with_efficiency_loss"
          unit_of_measurement: "W"
          device_class: power
          state_class: measurement
          availability: >
            {{ states('sensor.inverter_input_power') | is_number }}
          state: >-
            {% set inverter_rating = 6000 %} {# adjust this value to the rated power of your inverter #}
            {% set inpower = states('sensor.inverter_input_power') | float %}
            {% if inpower < inverter_rating * 0.1 %}
              {{ inpower * 0.90 }}
            {% elif inpower < inverter_rating * 0.2 %}  
              {{ inpower * 0.95 }}
            {% else %}
              {{ inpower * 0.98 }}
            {% endif %}`

- platform: integration
  source: sensor.input_power_with_efficiency_loss
  name: solar_energy_riemann_k
  unit_prefix: k
  round: 3

URL

https://www.home-assistant.io/integrations/integration/

Version

2023.10.1

Additional information

No response

home-assistant[bot] commented 12 months ago

Hey there @dgomes, mind taking a look at this feedback as it has been labeled with an integration (integration) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `integration` can trigger bot actions by commenting: - `@home-assistant close` Closes the feedback. - `@home-assistant rename Awesome new title` Renames the feedback. - `@home-assistant reopen` Reopen the feedback. - `@home-assistant unassign integration` Removes the current integration label and assignees on the feedback, add the integration domain after the command.
dgomes commented 12 months ago

The integration sensor is a math calculator... if you have a negative value 100% of the times it's the source sensor that turned negative

d3zit commented 12 months ago

Would it be possible to add an availability template to the integration one? in order to prevent it from working if the source sensor is negative?

dgomes commented 12 months ago

The integration inherits it's availability from the source sensor

github-actions[bot] commented 10 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved. If this issue is still relevant, please let us know by leaving a comment 👍 This issue has now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.