dotKrad / hass-fpl

FPL Component for Home Assistant
MIT License
40 stars 20 forks source link

RE: Support for new Home Assistant Energy Managment and Stats #16 #49

Closed jabetcha closed 4 months ago

jabetcha commented 5 months ago

Makes sensors for Daily Usage KWH, Daily Received KWH, and Daily Delivered KWH hours in correct format (Class=Total + Energy) to use in energy dashboard. Added last_reset where not set. Not 100% certain if it works properly. My HA seems to add daily received and daily delivered each hour instead of each day. So, it skews my energy usage by several multiples.

I am attempting to use a utility meter helper with the daily received/delivered KWH. Created one for each. Looks promising. Energy dashboard sees it.

 {
    "entry_id": "xxxxxxx",
    "version": 2,
    "minor_version": 1,
    "domain": "utility_meter",
    "title": "kwh_received",
    "data": {},
    "options": {
      "name": "kwh_received",
      "source": "sensor.fpl_xxxxxxxxxx_daily_received_kwh",
      "cycle": "daily",
      "offset": 0.0,
      "tariffs": [],
      "net_consumption": false,
      "delta_values": false,
      "periodically_resetting": true,
      "always_available": false
    },
    "pref_disable_new_entities": false,
    "pref_disable_polling": false,
    "source": "user",
    "unique_id": null,
    "disabled_by": null
  },
  {
    "entry_id": "xxxxxxxxxx",
    "version": 2,
    "minor_version": 1,
    "domain": "utility_meter",
    "title": "kwh_delivered",
    "data": {},
    "options": {
      "name": "kwh_delivered",
      "source": "sensor.fpl_xxxxxxxxxx_daily_delivered_kwh",
      "cycle": "daily",
      "offset": 0.0,
      "tariffs": [],
      "net_consumption": false,
      "delta_values": false,
      "periodically_resetting": true,
      "always_available": false
    },
    "pref_disable_new_entities": false,
    "pref_disable_polling": false,
    "source": "user",
    "unique_id": null,
    "disabled_by": null
  }

Also makes Net Received KWH and Net Delivered KWH usable to the energy dashboard also. These appear only to be updated monthly. Not sure how useful these will be.

EDIT: The meter helpers do not work. There seems to be a short period when the data is being updated from FPL (each poll) that the values become unvavailable. This appears to cause the meter to add the value to previous when it is updated. Instead calcuating receieved/delivered at 10x or more of the actual usage.