dotKrad / hass-fpl

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

I am trying to use the data provided by your FPL addon in my own energy dashboards. #17

Closed dotKrad closed 2 years ago

dotKrad commented 2 years ago

Hi there. I am wondering if my request is related to this one. I am trying to use the data provided by your FPL addon in my own energy dashboards. I have the Prometheus addon setup to scrape the data from Home Assistant, then the Grafana addon will put the data into nice looking graphs, but the way the data attributes are setup currently, the data cannot be read into Prometheus. The issues appears to be the attributes: "This data is provided by FPL. integration: FPL".

Other sensors that can be read by Prometheus say something similar to: state_class: measurement unit_of_measurement: kWh friendly_name: Energy Usage Total 1month device_class: energy

I would LOVE to be able to use the date fields from the FPL addon in Grafana as well to display current billing and next billing dates, but have struggled to get them into a format that can be read by Prometheus as well. In reading the docs for Prometheus, it appears the date field has to either be in a Unix format or Epoch (I don't know enough to be knowledgeable) how this needs to be formatted, but haven't been able to figure out how to template this data.

I have been using a custom template for converting the dollar amount into a readable field in the configuration.yaml:

`sensor:

and this has been working well for me. I will continue to see if I can re-format the data myself, in a custom template, but would be awesome if the data were available in a database readable format straight from the addon itself. Thank you for providing this tool! As is, It has been VERY helpful for me. Energy Dashboard

Originally posted by @robtheone in https://github.com/dotKrad/hass-fpl/issues/16#issuecomment-904717073

robtheone commented 2 years ago

For this issue, I can say that the addon date fields are correctly formatted and read by Home Assistant. There are no issues with the addon itself. I incorrectly assumed there was a formatting issue which is why the dates weren't being read correctly, however that has not proven to be true. I have had some success in getting the data moved from the addon into a database, readable by grafana, but have more work to do on my end. You can mark this issue as closed. Thanks