I have single ct sensor connected to the grid input of my house this will read positive numbers for importing from the grid and negative for exporting. this also means the kWh feeds also show positive and negative, to be clear I have two sperate fields
These are both accumulation and not instant power readings and the grid use works fine, however when I try and add the export to the energy config I get this error:
The following entities have a negative state while a positive state is expected.
Is there a simple way to get home assistance to remove the - (essentially make the negative values positive) yet still have the feed visible to the energy config?
I have a similar issue. My IoTaWatt can be set up with an integrator intended for the HA Energy Dashboard to output a positive number for import (drawing power from the grid) and a negative number for export (returning power to the grid). When I assigned the export entity in the Energy dashboard, however, I received a warning that;
Entity has a negative state
The following entities have a negative state while a positive state is expected:
sensor.gridnegative_wh (-1024)
This should easily be fixed with an abs function. when I looked at helpers, I found no helper that would work for this situation.
I’ve heard of people using python (which I know) and Jinja2 (which I don’t) for some customizations, though I found nothing in the documentation on how to call a python def or app, and searches in the forum for “algorithm”, “mathematics”, and similar have come up empty. However, every once in a while I stumble upon a documentation page that doesn’t appear to be reachable from the main documentation page (like powercalc), so more digging may be in order, or perhaps someone knowledgeable in this area can offer clues.