MrIceman11 / e3dc-homeassistant

ADD e3dc Data to your HomeAssistant
41 stars 12 forks source link

External Power Source Cannot be used in the Energy Panel #9

Closed brianvg closed 1 year ago

brianvg commented 1 year ago

The value given by the sensor.e3dc_external_power is a negative number. To be able to use it in the energy panel, the sensor should be turned into an absolute value. Suggest adding this to sensors.yaml.

MrIceman11 commented 1 year ago

Hi, here is the code to convert. Could you test it if it works? Just paste the code into the sensors.yaml file.

- platform: template
  sensors:
    e3dc_external_power:
      friendly_name: E3DC External Power
      unit_of_measurement: W
      value_template: >
        {{ states('sensor.e3dc_external_power') | float | abs }}
brianvg commented 1 year ago

Hello! Yes, I already implemented something like that. I did not realize the same sensor name "e3dc_external_power" could be used for both sensors, so I created a new one called e3dc_external_solar_power, since that corresponds to my use case. Otherwise it's identical, and I can confirm it works. I was able to add the integrator to the energy panel after that (in my case I had to change the integrator as well).

From: Julian Altmann @.> Sent: Monday, August 21, 2023 11:33 AM To: MrIceman11/e3dc-homeassistant @.> Cc: Brian von Gunten @.>; Author @.> Subject: Re: [MrIceman11/e3dc-homeassistant] External Power Source Cannot be used in the Energy Panel (Issue #9)

Hi, here is the code to convert. Could you test it if it works? Just paste the code into the sensors.yaml file.

This email message together with its attachments, if any, is confidential. If you are not the intended recipient or have received this email in error, please inform us immediately and delete this message. Any unauthorized copying of this message (and attachments) or unauthorized distribution of the information contained herein is prohibited. Privacy Policy Disclaimer: Speedgoat GmbH protects your personal data. Please refer to our privacy policyhttps://www.speedgoat.com/privacy for more information.

MrIceman11 commented 1 year ago

Ok, then I can take over the new config.