Giter Site home page Giter Site logo

ernst79 / degree-days Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 3.0 104 KB

Integration that determines (weighted) degree days, gas consumption per degree day and a gas prognose for the current year based on weather info from the KNMI and your gas consumption.

License: MIT License

Python 100.00%
home-assistant homeassistant

degree-days's People

Contributors

ernst79 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

degree-days's Issues

Prognosed gas not corresponding to mindergas.nl

Copied from #17 by @bakboord4

Noticed that the prognosed gas consumption shows about 60% what the dutch mindergas.nl website is prognosing.
I have to find out how your integration is working.
It would be helpful to me what is meant with 'year'. May I suggest to make in the documentation and in the sensor names everywhere explicit: calendar year (starting 1 jan) or billing year (date of year-gas-consumption is measured).
Especialy for prognosed gas consumption. Is this for the whole billing year or to 'year to date' (today)?
Thanks in advance for your reaction.

Add possibility for a second integration

Suggestion for product improvement:

Create an opportunity to deploy the integration more than once so that more than one device can be monitored. This can be several gas boilers, but also several heat pumps, each with different characteristics.

Degree days integration will failfrom 2023.3 on....

Hi Ernst, my HA gives me this wearning in the log. As a rabid user of the degree days integration, I would kindly ask you if you would be willing to look into this?
"Detected integration that called async_setup_platforms instead of awaiting async_forward_entry_setups; this will fail in version 2023.3. Please report issue to the custom integration author for degree_days using this method at custom_components/degree_days/init.py, line 41: hass.config_entries.async_setup_platforms(entry, PLATFORMS)"

Add possibility to register in kWh

If I may make a suggestion for 'product improvement':

Create an option to use the results of a kWh meter instead of the gas meter for consumers of a heat pump.

wrong gas consumption per degree day

how can I compensate for the initial gas meter reading on Jan 1st? I think it just uses the meter reading.
I do not have a sensor for consumption only a gas meter reading since installation of the gas meter.

Retrying setup: No columns to parse from file

Since a day or two this integration stopped working for me. I can't relate it to an upgrade of the component or Home Assistant.

In the devices -> integrations screen, I'm faced with the message Retrying setup: No columns to parse from file. In the Home Assistant log files I've this message

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 239, in _async_refresh
    self.data = await self._async_update_data()
  File "/config/custom_components/degree_days/__init__.py", line 113, in _async_update_data
    data = await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/degree_days/knmi/__init__.py", line 18, in __init__
    data = self.get_degree_days()
  File "/config/custom_components/degree_days/knmi/__init__.py", line 37, in get_degree_days
    df = self.get_daily_data_df(self.startdate.replace(str(year), str(int(year) - 20), 1), enddate, [station_code],
  File "/config/custom_components/degree_days/knmi/__init__.py", line 126, in get_daily_data_df
    df = self.parse_result_to_df(r)
  File "/config/custom_components/degree_days/knmi/__init__.py", line 206, in parse_result_to_df
    df = pd.read_csv(StringIO(r))
  File "/usr/local/lib/python3.10/site-packages/pandas/util/_decorators.py", line 311, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/pandas/io/parsers/readers.py", line 680, in read_csv
    return _read(filepath_or_buffer, kwds)
  File "/usr/local/lib/python3.10/site-packages/pandas/io/parsers/readers.py", line 575, in _read
    parser = TextFileReader(filepath_or_buffer, **kwds)
  File "/usr/local/lib/python3.10/site-packages/pandas/io/parsers/readers.py", line 934, in __init__
    self._engine = self._make_engine(f, self.engine)
  File "/usr/local/lib/python3.10/site-packages/pandas/io/parsers/readers.py", line 1236, in _make_engine
    return mapping[engine](f, **self.options)
  File "/usr/local/lib/python3.10/site-packages/pandas/io/parsers/c_parser_wrapper.py", line 75, in __init__
    self._reader = parsers.TextReader(src, **kwds)
  File "pandas/_libs/parsers.pyx", line 551, in pandas._libs.parsers.TextReader.__cinit__
pandas.errors.EmptyDataError: No columns to parse from file```

**What I've tried already**
- Reloading the integration
- Setting a different weather station
- Deleting the integration and re-adding it
- Redownloading the integration through HACS and re-adding the integration in HA

**My assumption**
It looks like the integration fails to retrieve data from KNMI. Following the URL from the code to https://www.daggegevens.knmi.nl/klimatologie/daggegevens brings me to a `503 Service Temporarily Unavailable` page. The site seems to be down.

Can you confirm my assumption? And do you know if it's a temporary thing or that the KNMI has shut it down for good (in which case the code needs a refactoring to another KNMI API).

For Newbies

Could you give us /me :-) examples to copy how this integration works? I installed it using HACS this worked, but no sensors where made? I know, I shouls probelbly know how to. but I did not chose a UI system for the fun off it. I like things going by itself? or other people making it easy for me ;-). I am not a coder.

ValueError: Sensor sensor.gas_consumption_per_weighted_degree_day has device class 'gas', ..., but 'unavailable'

Unable to use this integration.
Sensors: sensor.gas_consumption_per_weighted_degree_day and sensor.gas_prognose are not available due to errors.

error log.

Logger: homeassistant.components.sensor
Source: components/sensor/init.py:585
Integration: Sensor (documentation, issues)
First occurred: 18 juni 2023 om 17:20:11 (2 occurrences)
Last logged: 18 juni 2023 om 17:20:11

Error adding entities for domain sensor with platform degree_days
Error while setting up degree_days platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 583, in state
numerical_value = float(value) # type:ignore[arg-type]
^^^^^^^^^^^^
ValueError: could not convert string to float: 'Unavailable'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 471, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 749, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 850, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 590, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 654, in _async_write_ha_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 596, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 585, in state
raise ValueError(
ValueError: Sensor sensor.gas_consumption_per_weighted_degree_day has device class 'gas', state class 'total' unit 'm³' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: 'Unavailable' (<class 'str'>)

System.
Home Assistant 2023.6.2
Supervisor 2023.06.2
Operating System 10.2
Frontend-versie: 20230608.0 - latest

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.