#negative solar production!

1 messages · Page 1 of 1 (latest)

tawny dagger
#

any idea why I get negative solar production displayed? It's like I'd defined the sensor as hourly_increasing, but I haven't -

  • data:
    topic: homeassistant/sensor/teslpowerwall_wattshourlygenerated/config
    retain: true
    payload: |
    {
    "name": "watts hourly generated",
    "unit_of_measurement" : "Wh","unique_id": "teslapowerwall_wattshourlygenerated",
    "state_topic": "tesla/powerwall/stat",
    "device_class": "energy",
    "state_class": "total",
    "value_template": {% raw %}"{{ value_json.HourlyGenerated }}"{% endraw %},
    "device": {
    "identifiers": ["teslapowerwall"],
    "name": "Tesla Powerwall",
    "model": "v2",
    "manufacturer": "Tesla"
    }
    }
    action: mqtt.publish
tender shuttle
#

hi, I'm just learning about energy features in HA too, and what I've found is that HA seems to like sensors that track the total production (or consumption) as a forever-increasing number. the sensor you hooked up seems hourly, and I'm guessing its value resets to 0 at the start of every hour. this could lead to negative amounts being displayed in the Energy dashboard because HA's own arithmetic gets confused

turbid knoll
#

Sensors that periodically reset are fine for energy, as long as they have the correct state class and last reset attribute.

tender shuttle
#

@turbid knoll ah, thanks for clarifying that. I was previously using a custom integration of dubious quality that fetches data about my energy production and consumption from the cloud, and I ended up with negative values when first hooking up the "daily" sensors. it's then likely that either state class or last reset attribute wasn't set properly. anyway, I am not using that integration anymore, and the problem is gone