Git Product home page Git Product logo

hass-fpl's People

Contributors

adamoutler avatar admoya avatar apetrycki avatar dotkrad avatar jabetcha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hass-fpl's Issues

Energy stats are collected/saved twice in a day

I've noticed that, sometimes, energy stats are collected/saved more than once in the same day. I have had occur to me a handful of times. I'm attaching a screenshot but let me know if there's any other information that would be helpful in troubleshooting this issue.

Screen Shot 2022-10-09 at 10 02 41 AM

Error fetching data

I'm getting an error when this custom integration starts..." Error fetching data" . Very generic, but not being a great developer, I'm not sure how to work around it.

Where can I start to troubleshoot?

https://www.fpl.com/api/resources/account/{account}/projectedBill?premiseNumber={premise}&lastBilledDate={lastBillDate}
The 'lastBilledDate' doesn't exist in the current api only nextBillDate and currentBillDate

What am I missing?

Minor - Setting last_reset for entities with state_class other than 'total' is not supported.

From home-assistant.log after restart of HA

2023-07-09 11:53:01.799 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.fpl_5575977268_daily_usage_kwh (<class 'custom_components.fpl.sensor_DailyUsageSensor.FplDailyUsageKWHSensor'>) with state_class total_increasing has set last_reset. Setting last_reset for entities with state_class other than 'total' is not supported. Please update your configuration if state_class is manually configured, otherwise report it to the custom integration author.

Version of the custom_component

version 0.0.1

Configuration

Add your logs here.

Describe the bug

Still seems to be collecting data, my problem now is getting the data to report on the Energy Dashboard

Latest commits cause error in DailyUsageSensor

I updated late last week and reset the configuration. It generally works and works well. I'd love to fix these, but they are well over my skill set in python.

in the HASS logs I see the last line in a traceback

File "/config/custom_components/fpl/sensor_DailyUsageSensor.py", line 58, in last_reset
date = data[-1]["readTime"]
TypeError: 'NoneType' object is not subscriptable

and then just afterwards I get
2022-08-29 08:51:19.306 ERROR (MainThread) [custom_components.fpl] Error fetching fpl data:

But I'm not sure how related they are...

The full set of logs around it...
2022-08-29 08:24:27.554 ERROR (MainThread) [homeassistant] Error doing job: Unclosed client session
2022-08-29 08:24:27.555 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connector
2022-08-29 08:31:14.590 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 151, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 110, in async_update_listeners
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 348, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 532, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 572, in _async_write_ha_state
attr.update(self.state_attributes or {})
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 326, in state_attributes
if last_reset := self.last_reset:
File "/config/custom_components/fpl/sensor_DailyUsageSensor.py", line 58, in last_reset
date = data[-1]["readTime"]
TypeError: 'NoneType' object is not subscriptable
2022-08-29 08:39:27.538 ERROR (MainThread) [homeassistant] Error doing job: Unclosed client session
2022-08-29 08:39:27.540 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connector
2022-08-29 08:51:19.306 ERROR (MainThread) [custom_components.fpl] Error fetching fpl data:
2022-08-29 08:54:27.629 ERROR (MainThread) [homeassistant] Error doing job: Unclosed client session
2022-08-29 08:54:27.631 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connector

Daily Delivered and Daily Received not able to be set in Energy Grid

Version of the custom_component

0.0.1

Configuration

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

Describe the bug

The Daily Delivered KWH and Daily Received KWH sensors are not able to be set as Energy Sensors. I would like to be able to set them under "Grid consumption" and "Return to grid"

Debug log


2024-02-06 17:32:02.520 ERROR (MainThread) [custom_components.fpl] 'electric'
2024-02-06 17:32:02.880 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL_INCREASING was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL_INCREASING instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-06 17:32:02.892 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-06 17:32:02.903 WARNING (MainThread) [homeassistant.components.sensor] DEVICE_CLASS_ENERGY was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.ENERGY instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-06 17:32:02.914 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL_INCREASING was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL_INCREASING instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-06 17:32:02.924 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-06 17:32:02.934 WARNING (MainThread) [homeassistant.components.sensor] DEVICE_CLASS_ENERGY was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.ENERGY instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-06 17:32:02.948 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_MEASUREMENT was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.MEASUREMENT instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-06 17:32:02.959 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_MEASUREMENT was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.MEASUREMENT instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-06 17:32:02.970 WARNING (MainThread) [homeassistant.const] DEVICE_CLASS_ENERGY was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.ENERGY instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-06 17:32:02.980 WARNING (MainThread) [homeassistant.const] ENERGY_KILO_WATT_HOUR was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfEnergy.KILO_WATT_HOUR instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-06 17:32:02.991 WARNING (MainThread) [homeassistant.const] DEVICE_CLASS_MONETARY was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.MONETARY instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-06 17:32:03.005 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_MEASUREMENT was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.MEASUREMENT instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-06 17:32:03.015 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_MEASUREMENT was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.MEASUREMENT instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-06 17:32:03.030 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-06 17:32:03.040 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-06 17:32:03.060 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL_INCREASING was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL_INCREASING instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-06 17:32:03.070 WARNING (MainThread) [homeassistant.components.sensor] DEVICE_CLASS_ENERGY was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.ENERGY instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-06 17:32:03.081 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL_INCREASING was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL_INCREASING instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-06 17:32:03.091 WARNING (MainThread) [homeassistant.components.sensor] DEVICE_CLASS_ENERGY was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.ENERGY instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-06 17:32:03.117 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.fpl_6694435444_daily_usage_kwh (<class 'custom_components.fpl.sensor_DailyUsageSensor.FplDailyUsageKWHSensor'>) with state_class total_increasing has set last_reset. Setting last_reset for entities with state_class other than 'total' is not supported. Please update your configuration if state_class is manually configured, otherwise create a bug report at https://github.com/dotKrad/hass-fpl/issues

Recent Update Broke Integration in HACS

Version of the custom_component

7baac81

Describe the bug

Opened an issue with HACS on the bug but he said to open one with you as it appears to have been caused by changes in the recent update to files. See github issue, hacs/integration#2796

Debug log


2022-07-18 11:40:25 DEBUG (MainThread) [custom_components.hacs] <Integration dotKrad/hass-fpl> Getting repository information
2022-07-18 11:40:25 DEBUG (MainThread) [custom_components.hacs] <Integration dotKrad/hass-fpl> Running checks against master
2022-07-18 11:40:26 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140668858855536] Error handling message: Unknown error (unknown_error)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/config/custom_components/hacs/websocket/repository.py", line 40, in hacs_repository_info
    await repository.update_repository(ignore_issues=True, force=True)
  File "/config/custom_components/hacs/utils/decorator.py", line 28, in wrapper
    result = await function(*args, **kwargs)
  File "/config/custom_components/hacs/repositories/integration.py", line 110, in update_repository
    if manifest := await self.async_get_integration_manifest():
  File "/config/custom_components/hacs/repositories/integration.py", line 166, in async_get_integration_manifest
    return json_loads(decode_content(response.data.content))
orjson.JSONDecodeError: key must be a string at line 14 column 1: line 14 column 1 (char 260)

Config Flow cannot be loaded

When I install the app, then reboot the system then I attempt to "add integration" FPL, I see a popup that states "Cannot load Config Flow". Clicking ok removes the pop up and I am not able to attempt to reinstall FPL.

Support for new Home Assistant Energy Managment and Stats

Is your feature request related to a problem? Please describe.
Would like to add support for new Home Assistant Energy Management functions.
https://www.home-assistant.io/blog/2021/08/04/home-energy-management/

Describe the solution you'd like
Support for the new statistics functions, seems like we would just need to add a few properties to the sensors. Not sure on the pricing and pricing projections can be worked in as of yet. https://developers.home-assistant.io/docs/core/entity/sensor/

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
https://www.home-assistant.io/docs/energy/

Missing Card Examples

I see the following card examples for Lovelace UI (https://community.home-assistant.io/t/add-fpl-api-to-home-assistant/78347), but it seems that some of these components no longer exist, nor can I get the variables to work.

Here is what I have, but I have not been able to get service days into a variable:

type: vertical-stack
cards:
  - attribute: as_of_days
    name: Days
    positions:
      icon: 'off'
      indicator: 'on'
      minmax: 'on'
      title: inside
      value: inside
    severity:
      - color: Green
        from: 0
        to: 15
      - color: Yellow
        from: 16
        to: 25
      - color: Red
        from: 26
        to: 31
    type: 'custom:bar-card'
    entities:
      - entity: sensor.fpl_***
    variables:
      - 'states[''sensor.fpl_***''].attributes.service_days'
    title: FPL
    direction: right
    min: 1
    max: 31
    animation:
      state: 'on'
      speed: '5'
  - type: entities
    entities:
      - entity: sensor.fpl_bill_to_date
      - entity: sensor.fpl_daily_avg
      - entity: sensor.fpl_projected_bill
      - entity: sensor.fpl_total_power
      - entity: sensor.fpl_service_days
    state_color: false
layout:
  key: 16950a26-4149-4254-88dc-33438177d1b7

Attributes missing for daily usage

Version of the custom_component

Latest Version

Configuration

N/A

Describe the bug

Daily Usage Attributes are missing from the Daily Usage entities, i have check both the Daily Usage KWH and Daily Usage sesnors

Debug log

N/A
Screen Shot 2021-07-14 at 11 36 47 AM
Screen Shot 2021-07-14 at 11 33 09 AM

no terrytory issues when setting up integration

I just downloaded the custom component from this repo and when I try to log in it gives me an error and returns the following in the logs. I saw a post from the end of last year on this but I didn't see a fix or what might be causing it. Any help here would be appreciated. I am not using the NW territory.

`This error originated from a custom integration.

Logger: custom_components.fpl
Source: custom_components/fpl/fplapi.py:125
Integration: FPL (documentation, issues)
First occurred: 10:08:01 AM (3 occurrences)
Last logged: 10:28:56 AM

Error : <class 'custom_components.fpl.fplapi.NoTerrytoryAvailableException'>`

Question RE integration with HA Power Dashboard

This isn't really a bug but it isn't feedback either so sorry wasn't sure how to classify it. I did read the docs which got me all setup and running but I'm a little unclear on how best to integrate this into things like the energy dashboard in Home Assistant.

For a very simple system, just plain power draw from the grid (will be a while yest until Solar gets installed) what sensor do you feed into HA Energy? I thought it would be the one named Meter Consumption sensor.fpl_deliveredreading but that doesn't seem to be changing at all for me and I'm wondering if it only changes after a billing cycle is complete or something? I saw another sensor named Billing Usage which SEEMS to be be updating maybe daily? Thought about using that instead but then realized it probably resets to 0 at the end of the bill so that would probably screw up the dashboard.

tl;dr what is the best way to hook this up to HA Energy? Which sensors should be used?

Thanks!

Allow Custom Entity Overrides

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
Re-add unique_id property to sensor

Describe alternatives you've considered
The Home Assistant UI suggests the need for a unique ID in order to support custom entity settings. Is there a particular reason the unique_id was removed? What's the advantage to keeping this entity read-only?

Additional context

Screen Shot 2020-06-16 at 1 47 06 PM

Entity Name and Value UX

I really don't want to have to micromanage the FPL entity names. Is there any way to exclude automatically the account number? It really makes them hard to read when going through a list when they all start with the account number and i dont want to have to go in and rename 22 entities. Especially when ive seen this code change quite a few times over the past couple years and break those changes I have made.

Also, is there reason why the $ sign is showing up after the dollar amount? Can that not be prefixed instead? Since HA introduces so many breaking changes so often, I am trying to spend less time customizing the UI, etc, as I have to redo those changes way to often because of their breaking changes and about every 6 months I abandon HA because of all that wasted time.

Provide an example of configuring the component in homeassistant

Is your feature request related to a problem? Please describe.
It would be helpful to have an example for how to set this up in the configuration.yaml

Describe the solution you'd like
Add an example section to the projects README.md

Describe alternatives you've considered
Tried setting it up myself not sure what to do.

Additional context
None.

Deprecated Call in 2021.12.0 Home Assistant Version

Version of the custom_component

2cb7f60

Configuration


Setup Using the UI interface.

Describe the bug

After upgrading to the newest Home Assistant Release 2021.12.0, there was several lines in the log file about a deprecated loop keyword argument.

Debug log


2021-12-11 15:16:27 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that called async_timeout.timeout with loop keyword argument. The loop keyword argument is deprecated and calls will fail after Home Assistant 2022.2. Please report issue to the custom component author for fpl using this method at custom_components/fpl/fplapi.py, line 95: async with async_timeout.timeout(TIMEOUT, loop=asyncio.get_event_loop()):
2021-12-11 15:16:27 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that called async_timeout.timeout with loop keyword argument. The loop keyword argument is deprecated and calls will fail after Home Assistant 2022.2. Please report issue to the custom component author for fpl using this method at custom_components/fpl/fplapi.py, line 115: async with async_timeout.timeout(TIMEOUT, loop=asyncio.get_event_loop()):
2021-12-11 15:16:28 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that called async_timeout.timeout with loop keyword argument. The loop keyword argument is deprecated and calls will fail after Home Assistant 2022.2. Please report issue to the custom component author for fpl using this method at custom_components/fpl/fplapi.py, line 178: async with async_timeout.timeout(TIMEOUT, loop=asyncio.get_event_loop()):
2021-12-11 15:16:28 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that called async_timeout.timeout with loop keyword argument. The loop keyword argument is deprecated and calls will fail after Home Assistant 2022.2. Please report issue to the custom component author for fpl using this method at custom_components/fpl/fplapi.py, line 211: async with async_timeout.timeout(TIMEOUT, loop=asyncio.get_event_loop()):
2021-12-11 15:16:28 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that called async_timeout.timeout with loop keyword argument. The loop keyword argument is deprecated and calls will fail after Home Assistant 2022.2. Please report issue to the custom component author for fpl using this method at custom_components/fpl/fplapi.py, line 245: async with async_timeout.timeout(TIMEOUT, loop=asyncio.get_event_loop()):
2021-12-11 15:16:28 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that called async_timeout.timeout with loop keyword argument. The loop keyword argument is deprecated and calls will fail after Home Assistant 2022.2. Please report issue to the custom component author for fpl using this method at custom_components/fpl/fplapi.py, line 281: async with async_timeout.timeout(TIMEOUT, loop=asyncio.get_event_loop()):
2021-12-11 15:16:30 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that called async_timeout.timeout with loop keyword argument. The loop keyword argument is deprecated and calls will fail after Home Assistant 2022.2. Please report issue to the custom component author for fpl using this method at custom_components/fpl/fplapi.py, line 320: async with async_timeout.timeout(TIMEOUT, loop=asyncio.get_event_loop()):
2021-12-11 15:16:30 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that called async_timeout.timeout with loop keyword argument. The loop keyword argument is deprecated and calls will fail after Home Assistant 2022.2. Please report issue to the custom component author for fpl using this method at custom_components/fpl/fplapi.py, line 87: async with async_timeout.timeout(TIMEOUT, loop=asyncio.get_event_loop()):

Recent Update edff06c Broke Add Integration Config Flow

Version of the custom_component

edff06c

Configuration

image

Add your logs here.

Describe the bug

After most recent update when trying to add integration into Home Assistant, receive an error "Config Flow could not be loaded"

Debug log

2021-06-05 21:15:29 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 76, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 144, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 128, in post
    return await super().post(request)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 63, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 72, in post
    result = await self._flow_mgr.async_init(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 153, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 179, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data, init_done)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 260, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/config/custom_components/fpl/config_flow.py", line 81, in async_step_user
    return await self._show_config_form(user_input)
  File "/config/custom_components/fpl/config_flow.py", line 93, in _show_config_form
    data_schema[vol.Required(CONF_USERNAME, default=username)] = str
UnboundLocalError: local variable 'username' referenced before assignment


Integration uses deprecated constants

Version of the custom_component

Latest version baa8ade

Configuration

Loads default set of integrations. Do not remove.

default_config:

Load frontend themes from the themes folder

frontend:
themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

Example configuration.yaml entry

logger:

Add your logs here.

2024-02-03 11:22:26.109 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-03 11:22:26.110 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration fpl which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-03 11:22:46.173 WARNING (MainThread) [hass_nabucasa.cloud_api] Fetched https://alexa-api.nabucasa.com/access_token (400)
2024-02-03 11:22:52.434 ERROR (MainThread) [custom_components.fpl] 'electric'
2024-02-03 11:22:54.161 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL_INCREASING was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL_INCREASING instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.174 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.186 WARNING (MainThread) [homeassistant.components.sensor] DEVICE_CLASS_ENERGY was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.ENERGY instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.198 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL_INCREASING was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL_INCREASING instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.209 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.219 WARNING (MainThread) [homeassistant.components.sensor] DEVICE_CLASS_ENERGY was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.ENERGY instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.234 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_MEASUREMENT was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.MEASUREMENT instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.244 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_MEASUREMENT was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.MEASUREMENT instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.255 WARNING (MainThread) [homeassistant.const] DEVICE_CLASS_ENERGY was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.ENERGY instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.264 WARNING (MainThread) [homeassistant.const] ENERGY_KILO_WATT_HOUR was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfEnergy.KILO_WATT_HOUR instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.275 WARNING (MainThread) [homeassistant.const] DEVICE_CLASS_MONETARY was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.MONETARY instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.288 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_MEASUREMENT was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.MEASUREMENT instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.299 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_MEASUREMENT was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.MEASUREMENT instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.312 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.322 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.336 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL_INCREASING was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL_INCREASING instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.347 WARNING (MainThread) [homeassistant.components.sensor] DEVICE_CLASS_ENERGY was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.ENERGY instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.357 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL_INCREASING was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL_INCREASING instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.367 WARNING (MainThread) [homeassistant.components.sensor] DEVICE_CLASS_ENERGY was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.ENERGY instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.777 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.fpl_7338839256_daily_usage_kwh (<class 'custom_components.fpl.sensor_DailyUsageSensor.FplDailyUsageKWHSensor'>) with state_class total_increasing has set last_reset. Setting last_reset for entities with state_class other than 'total' is not supported. Please update your configuration if state_class is manually configured, otherwise create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:55.028 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.apollo_msr_1_a61a70_ltr390_ambient_light (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement '#' which is not a valid unit for the device class ('illuminance') it is using; expected one of ['lx']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+esphome%22
2024-02-03 11:22:55.040 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.apollo_msr_1_a61a70_ltr390_uv_index (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement 'UVI' which is not a valid unit for the device class ('illuminance') it is using; expected one of ['lx']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+esphome%22
2024-02-03 11:22:55.087 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.apollo_msr_1_6ba798_ltr390_ambient_light (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement '#' which is not a valid unit for the device class ('illuminance') it is using; expected one of ['lx']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+esphome%22
2024-02-03 11:22:55.106 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.apollo_msr_1_6ba798_ltr390_uv_index (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement 'UVI' which is not a valid unit for the device class ('illuminance') it is using; expected one of ['lx']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+esphome%22
2024-02-03 11:22:55.131 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.apollo_msr_1_a5556c_ltr390_ambient_light (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement '#' which is not a valid unit for the device class ('illuminance') it is using; expected one of ['lx']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+esphome%22
2024-02-03 11:22:55.142 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.apollo_msr_1_a5556c_ltr390_uv_index (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement 'UVI' which is not a valid unit for the device class ('illuminance') it is using; expected one of ['lx']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+esphome%22

Describe the bug

The log shows multiple warnings about deprecated constants used by the FPL custom integration, such as STATE_CLASS_TOTAL_INCREASING, STATE_CLASS_MEASUREMENT, DEVICE_CLASS_ENERGY, and others. These need to be updated to the new constants as mentioned in the warnings (e.g., SensorStateClass.TOTAL_INCREASING, SensorDeviceClass.ENERGY).

Debug log

2024-02-03 11:22:26.109 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-03 11:22:26.110 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration fpl which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-03 11:22:46.173 WARNING (MainThread) [hass_nabucasa.cloud_api] Fetched https://alexa-api.nabucasa.com/access_token (400)
2024-02-03 11:22:52.434 ERROR (MainThread) [custom_components.fpl] 'electric'
2024-02-03 11:22:54.161 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL_INCREASING was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL_INCREASING instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.174 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.186 WARNING (MainThread) [homeassistant.components.sensor] DEVICE_CLASS_ENERGY was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.ENERGY instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.198 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL_INCREASING was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL_INCREASING instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.209 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.219 WARNING (MainThread) [homeassistant.components.sensor] DEVICE_CLASS_ENERGY was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.ENERGY instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.234 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_MEASUREMENT was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.MEASUREMENT instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.244 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_MEASUREMENT was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.MEASUREMENT instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.255 WARNING (MainThread) [homeassistant.const] DEVICE_CLASS_ENERGY was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.ENERGY instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.264 WARNING (MainThread) [homeassistant.const] ENERGY_KILO_WATT_HOUR was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfEnergy.KILO_WATT_HOUR instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.275 WARNING (MainThread) [homeassistant.const] DEVICE_CLASS_MONETARY was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.MONETARY instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.288 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_MEASUREMENT was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.MEASUREMENT instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.299 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_MEASUREMENT was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.MEASUREMENT instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.312 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.322 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.336 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL_INCREASING was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL_INCREASING instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.347 WARNING (MainThread) [homeassistant.components.sensor] DEVICE_CLASS_ENERGY was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.ENERGY instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.357 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL_INCREASING was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL_INCREASING instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.367 WARNING (MainThread) [homeassistant.components.sensor] DEVICE_CLASS_ENERGY was used from fpl, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.ENERGY instead, please create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:54.777 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.fpl_7338839256_daily_usage_kwh (<class 'custom_components.fpl.sensor_DailyUsageSensor.FplDailyUsageKWHSensor'>) with state_class total_increasing has set last_reset. Setting last_reset for entities with state_class other than 'total' is not supported. Please update your configuration if state_class is manually configured, otherwise create a bug report at https://github.com/dotKrad/hass-fpl/issues
2024-02-03 11:22:55.028 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.apollo_msr_1_a61a70_ltr390_ambient_light (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement '#' which is not a valid unit for the device class ('illuminance') it is using; expected one of ['lx']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+esphome%22
2024-02-03 11:22:55.040 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.apollo_msr_1_a61a70_ltr390_uv_index (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement 'UVI' which is not a valid unit for the device class ('illuminance') it is using; expected one of ['lx']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+esphome%22
2024-02-03 11:22:55.087 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.apollo_msr_1_6ba798_ltr390_ambient_light (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement '#' which is not a valid unit for the device class ('illuminance') it is using; expected one of ['lx']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+esphome%22
2024-02-03 11:22:55.106 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.apollo_msr_1_6ba798_ltr390_uv_index (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement 'UVI' which is not a valid unit for the device class ('illuminance') it is using; expected one of ['lx']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+esphome%22
2024-02-03 11:22:55.131 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.apollo_msr_1_a5556c_ltr390_ambient_light (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement '#' which is not a valid unit for the device class ('illuminance') it is using; expected one of ['lx']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+esphome%22
2024-02-03 11:22:55.142 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.apollo_msr_1_a5556c_ltr390_uv_index (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement 'UVI' which is not a valid unit for the device class ('illuminance') it is using; expected one of ['lx']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+esphome%22

Add your logs here.

Missing projectedKWH key

When trying to add the integration I get the following error:

  File "/config/custom_components/fpl/fplapi.py", line 313, in __getDataFromEnergyService
    data["projectedKWH"] = r["CurrentUsage"]["projectedKWH"]
KeyError: 'projectedKWH'

Timeout when calling self.session.post/get

Fairly regularly, when the integration goes to update (for me, it's usually the appliance or service updates), it times out when calling the self.session.post or get. Increasing the async timeout to 10s does not help. I think this may be due to calling the session pool multiple times. I have a feeling this issue is common for multiple integrations as I see similar errors with some other integrations that shouldn't happen (polling local webservers over 1Gbps connections or in docker containers).

Setup

I did the HACS install, I logged in with my FPL NorthWest credentials and I don't have anything populating in my sensors. I have checked through the documentation and open cases and I cannot figure out where I am going wrong with the setup. Am I supposed to manually add the sensors or make any modifications in my config?

Device_State_Attributes Warning in 2021.12.0

Version of the custom_component

2cb7f60

Configuration


Setup using UI interface.

Describe the bug

Warning in Home Assistant 2021.12.0 log on device_state_attributes.

Debug log


2021-12-11 15:18:51 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.fpl_8416318809_projected_bill (<class 'custom_components.fpl.sensor_ProjectedBillSensor.FplProjectedBillSensor'>) implements device_state_attributes. Please report it to the custom component author.
2021-12-11 15:18:51 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.fpl_8416318809_projected_budget_bill (<class 'custom_components.fpl.sensor_ProjectedBillSensor.ProjectedBudgetBillSensor'>) implements device_state_attributes. Please report it to the custom component author.
2021-12-11 15:18:51 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.fpl_8416318809_projected_actual_bill (<class 'custom_components.fpl.sensor_ProjectedBillSensor.ProjectedActualBillSensor'>) implements device_state_attributes. Please report it to the custom component author.
2021-12-11 15:18:51 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.fpl_8416318809_defered_amount (<class 'custom_components.fpl.sensor_ProjectedBillSensor.DeferedAmountSensor'>) implements device_state_attributes. Please report it to the custom component author.
2021-12-11 15:18:51 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.fpl_8416318809_daily_average (<class 'custom_components.fpl.sensor_AverageDailySensor.FplAverageDailySensor'>) implements device_state_attributes. Please report it to the custom component author.
2021-12-11 15:18:51 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.fpl_8416318809_budget_daily_average (<class 'custom_components.fpl.sensor_AverageDailySensor.BudgetDailyAverageSensor'>) implements device_state_attributes. Please report it to the custom component author.
2021-12-11 15:18:51 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.fpl_8416318809_actual_daily_average (<class 'custom_components.fpl.sensor_AverageDailySensor.ActualDailyAverageSensor'>) implements device_state_attributes. Please report it to the custom component author.
2021-12-11 15:18:51 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.fpl_8416318809_daily_usage (<class 'custom_components.fpl.sensor_DailyUsageSensor.FplDailyUsageSensor'>) implements device_state_attributes. Please report it to the custom component author.
2021-12-11 15:18:51 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.fpl_8416318809_daily_usage_kwh (<class 'custom_components.fpl.sensor_DailyUsageSensor.FplDailyUsageKWHSensor'>) implements device_state_attributes. Please report it to the custom component author.
2021-12-11 15:18:51 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.fpl_8416318809_current_bill_date (<class 'custom_components.fpl.sensor_DatesSensor.CurrentBillDateSensor'>) implements device_state_attributes. Please report it to the custom component author.
2021-12-11 15:18:51 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.fpl_8416318809_next_bill_date (<class 'custom_components.fpl.sensor_DatesSensor.NextBillDateSensor'>) implements device_state_attributes. Please report it to the custom component author.
2021-12-11 15:18:51 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.fpl_8416318809_service_days (<class 'custom_components.fpl.sensor_DatesSensor.ServiceDaysSensor'>) implements device_state_attributes. Please report it to the custom component author.
2021-12-11 15:18:51 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.fpl_8416318809_as_of_days (<class 'custom_components.fpl.sensor_DatesSensor.AsOfDaysSensor'>) implements device_state_attributes. Please report it to the custom component author.
2021-12-11 15:18:51 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.fpl_8416318809_remaining_days (<class 'custom_components.fpl.sensor_DatesSensor.RemainingDaysSensor'>) implements device_state_attributes. Please report it to the custom component author.
2021-12-11 15:18:51 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.fpl_8416318809_projected_kwh (<class 'custom_components.fpl.sensor_KWHSensor.ProjectedKWHSensor'>) implements device_state_attributes. Please report it to the custom component author.
2021-12-11 15:18:51 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.fpl_8416318809_daily_average_kwh (<class 'custom_components.fpl.sensor_KWHSensor.DailyAverageKWHSensor'>) implements device_state_attributes. Please report it to the custom component author.
2021-12-11 15:18:51 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.fpl_8416318809_bill_to_date_kwh (<class 'custom_components.fpl.sensor_KWHSensor.BillToDateKWHSensor'>) implements device_state_attributes. Please report it to the custom component author.

Adding Icons

I've committed FPL Icons and Logos here. This is just a heads up. You may close this issue or you can tell me you don't like the icons and suggest another one. Either way, its time this stop being my only integration without an icon. ๐Ÿ‘

image

Invalid config?

I am getting the following error on startup and of course no entities are created:

Invalid config
The following integrations and platforms could not be set up:

fpl
Please check your config.

I am doing the normal integration with no cards setup yet. I had this working on an old system and I have tried deleting the integration, re-adding the files, and reattaching my fpl account, but i am still getting that error. Super odd because it worked on an older HA instance. I am running Home Assistant 0.111.4 on a Supervised setup.

Attributes Missing for Daily Usage

Version of the custom_component

N/A

Configuration

N/A

Describe the bug

Daily Usage Attributes are missing from the Daily Usage entities, i have check both the Daily Usage KWH and Daily Usage sensors

Debug log

N/A

Screen Shot 2021-07-14 at 11 36 47 AM
Screen Shot 2021-07-14 at 11 33 09 AM

Quick question

I am new to coding and raspberry pi. How do I load the software once I have loaded the raspberry pi os? Do I open a command window and start at the .devontainer and type that information in?

Card question

First...thank you, thank you, thank you. I'd buy you a pony if I knew where to send it!
This integration works perfectly...BUT.

You had posted the yaml for a card you use and for the life of me (and I really suck at HASS cards) I cannot get it to show correctly. I'm thinking its simply what entities I'm using.

So...the question is what entity goes where???

cards:
  - card:
      entities:
        - attribute: as_of_days          
          entity: sensor.fpl_*****
          entity_row: true
          max: '${ vars[0] }'
          name: Days
          positions:
            icon: 'off'
            indicator: 'off'
            minmax: inside
            title: inside
            value: inside
          severity:
            - color: Green
              from: 0
              to: '${ vars[0] * 0.5 }'
            - color: Yellow
              from: '${ vars[0] * 0.5 + 1}'
              to: '${ vars[0] * 0.80 }'
            - color: Red
              from: '${ vars[0] * 0.80 + 1}'
              to: '${ vars[0] }'
          style: 'ha-card{border-radius: 0;}'
          type: 'custom:bar-card'
      title: FPL
      type: entities
    entities:
      - sensor.fpl_*****
    type: 'custom:config-template-card'
    variables:
      - 'states[''sensor.fpl_*****''].attributes.service_days'
  - attribute: projected_bill
    entity: sensor.fpl_*****
    name: Projected Bill
    type: entity
type: 'custom:vertical-stack-in-card'

Thanks!!!

Current kWh cost

Hello,

Is there a way you retrieve the current kWh cost as a sensor?

Thanks!

Invalid password but it's not

Version of the custom_component

0.0.1

Describe the bug

I keep getting an "invalid password" error, but it's the same username/password I use for both the mobile app and the website. I'm in the main territory.

Debug log

2023-08-02 16:52:19.223 DEBUG (MainThread) [custom_components.fpl] Getting territory
2023-08-02 16:52:19.511 INFO (MainThread) [custom_components.fpl] Logging in

No errors logged. Just "invalid password" displayed when attempting to set up the integration.

FPL Northwest Region

Is your feature request related to a problem? Please describe.
Support FPL Northwest Region

Describe the solution you'd like
FPL now has a Northwest Region which includes old Gulfpower customers.

Describe alternatives you've considered
NA

Additional context

Installed and integration creation was successful but no sensors

Version of the custom_component

Configuration

Add your logs here.

Describe the bug

I added the files correctly to config/custom_components/fpl
I put my username and password when adding the integration and it was successful. But after a restart there is not any fpl sensors. The logs says this:
File "/config/custom_components/fpl/sensor.py", line 66, in state
return self._data["bill_to_date"]
TypeError: 'NoneType' object is not subscriptable

Debug log


Add your logs here.

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

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:

  • platform: template
    sensors:
    power_1516_monthly_usage_estimate:
    friendly_name: "1516 Current Monthly Usage Dollars Estimate"
    unit_of_measurement: '$'
    icon_template: mdi:currency-usd
    value_template: "{{ ((states('sensor.fpl_xxxxxxxxx_bill_to_date_kwh') |float) *0.1235) }}" `

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 #16 (comment)

Data not being pulled in

Version of the custom_component

Current Version

Describe the bug

Plugin does not seem to be pulling data from FPL on its own. Each morning I must manually reload the plugin at which point the data is pulled in

DEBT does not exist

An exception occurs in __getDataFromBalance in FplMainRegionApiClient.py:
list index out of range.

This appears to be due to DEBT not being in the data returned.

The data returned:

[{'amount': 355.77, 'details': 'BPAC', 'id': '/account/<redacted>/balance', 'individualDebitDetails': [{'codeDescription': 'BPAC', 'type': 'BB', 'totalAmount': '0000355.77', 'remainingAmount': '0000355.77', 'dueDate': '2023-12-05'}], 'errorFlag': False, 'order': 3}, {'amount': 355.77, 'details': 'TPSD', 'id': '/account/<redacted>/balance', 'errorFlag': False, 'order': 1}, {'amount': 5.34, 'details': 'NDDT', 'id': '/account/<redacted>/balance', 'individualDebitDetails': [{'codeDescription': 'NDDT', 'type': 'LPC', 'totalAmount': '0000000.00', 'remainingAmount': '0000005.34'}], 'errorFlag': False, 'order': 2}, {'amount': 361.11, 'details': 'TBAL', 'id': '/account/<redacted>/balance', 'errorFlag': False, 'order': 0}]

This appears to be something not everyone has, so it's probably better to test for it or make it a warning instead of an error.

State class of this entity " is not supported

Updated with latest commits as of friday 26 Aug...
When I look in developer tools under statistics the error shows from the "recorder" source.
State class of this entity " is not supported
The sensors seem to work fine, but HASS wants to delete data associated with them.

Did the state class change or is this a regression with the latest changes?

Feature - configure update interval

Seems FPL only updates data 1x per day. Not sure if there is good reason to update multiple times throughout a 24h cycle.
Any chance that could be configurable or cut down to 1x or 2x per day and retry with exception?

Additional Sensors for Net Metering Customers

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
It would nice to be able to track on a daily basis home much power FPL is reporting you have received and/or they have delivered.

Describe alternatives you've considered
I also have a sense energy monitor, but they do not line up, so making sure they are not WAY off is good.

Additional context
The Data can be seen on the following request:
https://www.fpl.com/dashboard-api/resources/account/<account_number>/energyService/<account_number>

Sample Request Payload:

{
    "status": 2,
    "channel": "WEB",
    "amrFlag": "Y",
    "accountType": "RESIDENTIAL",
    "revCode": "1",
    "premiseNumber": "<premise_number>",
    "meterNo": "<meter_number>",
    "projectedBillFlag": false,
    "billComparisionFlag": false,
    "monthlyFlag": false,
    "frequencyType": "Daily",
    "lastBilledDate": "<lastBillDated>",
    "applicationPage": "resDashBoard",
    "startDate": "",
    "endDate": ""
}

There may be other way to get to this data, and honestly i dont even need it broken down by day, if it can be pulled in and updated i'll have historical just from it updating

Sample Response:

{
    "data": {
        "DailyUsage": {
            "premiseNumber": "XXXXX",
            "accountNumber": "XXXXXX",
            "readingType": "daily",
            "startDate": "20210609",
            "endDate": "20210610",
            "data": [{
                "kwhUsed": -12,
                "billingCharge": 0.33,
                "temperature": 86.0,
                "billingDayName": "Wed",
                "date": "20210609",
                "holiday": "false",
                "missingDay": "false",
                "billingDay": "09",
                "billingMonth": "Jun",
                "billingYear": "2021",
                "humidity": 82.0,
                "readTime": "2021-06-09T00:00:00.000-04:00",
                "reading": 7468.3932,
                "averageHighTemperature": 86,
                "averageLowTemperature": 74,
                "averageMidTemperature": 80,
                "averageHighHumidity": 82,
                "averageLowHumidity": 1,
                "averageMidHumidity": 45,
                "readingType": "AMI",
                "netDeliveredKwh": 36.5184,
                "netReceivedKwh": 48.9492,
                "netDeliveredReading": 7468.3932,
                "netReceivedReading": 8147.0052,
                "meterNumber": "KCD750N"
            }, {
                "kwhUsed": -6,
                "billingCharge": 0.33,
                "temperature": 89.0,
                "billingDayName": "Thu",
                "date": "20210610",
                "holiday": "false",
                "missingDay": "false",
                "billingDay": "10",
                "billingMonth": "Jun",
                "billingYear": "2021",
                "humidity": 81.0,
                "readTime": "2021-06-10T00:00:00.000-04:00",
                "reading": 7504.9116,
                "averageHighTemperature": 89,
                "averageLowTemperature": 76,
                "averageMidTemperature": 83,
                "averageHighHumidity": 81,
                "averageLowHumidity": 1,
                "averageMidHumidity": 43,
                "readingType": "AMI",
                "netDeliveredKwh": 35.1348,
                "netReceivedKwh": 41.0472,
                "netDeliveredReading": 7504.9116,
                "netReceivedReading": 8195.9544,
                "meterNumber": "KCD750N"
            }],
            "maxTemperature": 0.0,
            "minTemperature": 0.0,
            "maxBillingCharge": 0.0,
            "minBillingCharge": 0.0,
            "maxKwh": 0.0,
            "minKwh": 0.0,
            "maxHumidity": 0.0,
            "minHumidity": 0.0
        }
    }
}

Missing details in the readme file for HACS usage

  • Compatible with HACS section missing details on usage
  • Need to identify adding a custom component as many HA users are newbies
  • this will serve as training aid and may increase usaage

Version of the custom_component

Configuration

No configuration updates required

Add your logs here.

No logging required

Describe the bug

Lack of information in usage section

Debug log


Add your logs here.

'Version' Key missing, Will stop functioning in 2021.6

Describe the bug

The 'version' key is missing fro the manifest.json file, will stop working in 2021.6 Home Assistant version. See release note in 2021.5 version, https://www.home-assistant.io/blog/2021/05/05/release-20215/

Version of the custom_component

Currently using most recent version, 0.0.1

Debug Log

 [homeassistant.loader] No 'version' key in the manifest file for custom integration 'fpl'. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of 'fpl' 

Integration stopped working as of 5/29/21

As of this morning data is no longer loading for this component. I have tried reloading, even deleting and reinstalling. After reinstall there are no fpl devices.

Unable to add Integration (no territory available)

  1. I did download propper set of files info custom_components folder
  2. I did restart HA
  3. Then I was able to find FPL in addons
  4. After filling email and password - the same I use to log into FPL portal ( https://www.fpl.com/my-account/login.html ) - I receive error msg "An error ocurred, please check the logs" and cannot continue.

Note:

Log file says:
2022-10-29 16:13:03.588 ERROR (MainThread) [custom_components.fpl] Error : <class 'custom_components.fpl.fplapi.NoTerrytoryAvailableException'>

image

Running:
Home Assistant 2022.10.5
Supervisor 2022.10.0
Operating System 9.3

(fresh installation today)

Minor logging issue - "Getting appliance usage data" is used twice

No information on why this ERROR is occurring, but further obscured by wrong detail in the logger. I'm wondering if the "lastBilledDate" is NULL when trying to strftime which is done outside of the try/except section.

async def __getDataFromBalance(self, account) -> dict:
"""get data from appliance usage"""
_LOGGER.info("Getting appliance usage data")

async def __getDataFromApplianceUsage(self, account, lastBilledDate) -> dict:
"""get data from appliance usage"""
_LOGGER.info("Getting appliance usage data")

Version of the custom_component

version 0.0.1

Configuration

Not affected by configuration

Debug log


2023-07-09 12:53:07.077 DEBUG (MainThread) [custom_components.fpl] Getting territory
2023-07-09 12:53:09.561 INFO (MainThread) [custom_components.fpl] Getting Programs
2023-07-09 12:53:09.561 INFO (MainThread) [custom_components.fpl] Getting energy service data
2023-07-09 12:53:14.565 ERROR (MainThread) [custom_components.fpl] 
2023-07-09 12:53:14.571 INFO (MainThread) [custom_components.fpl] Getting appliance usage data
2023-07-09 12:53:19.573 ERROR (MainThread) [custom_components.fpl] 
2023-07-09 12:53:19.577 INFO (MainThread) [custom_components.fpl] Getting appliance usage data
2023-07-09 12:53:19.915 INFO (MainThread) [custom_components.fpl] Logging out
2023-07-09 12:53:20.002 DEBUG (MainThread) [custom_components.fpl] Finished fetching fpl data in 12.925 seconds (success: True)

README.md has incorrect search name

In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Florida Power & Light"

should be replaced with

In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "FPL"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.