Skip to content

Commit

Permalink
Version 2025.1.2 (#190)
Browse files Browse the repository at this point in the history
* Version 2024.11.0.dev_a:
integrate several kinds of heatpumps

* Version 2024.11.0.dev_a:
integrate several kinds of heatpumps

* Version 2024.11.0.dev_a:
test pull request

* Version 2024.11.0.dev:
test pull request

* Version 2024.11.0:
Fixed a db-error when getting Tibber-data with the default sqlite-db

* Version 2024.11.0.dev_a:
 Scheduling of heatpump can be set via a ha-entity
- Scheduling of heatpump can be achieved in three ways:
  - on/off
  - heat curve adjustment
  - calculated power
- When setting a state of an entity failed then an error message is written in the log
  (name of the entity, new failed value)

* Version 2024.11.0.dev: (#139)

* Version 2024.11.0.dev:
test pull request

* Version 2024.11.0.dev_a:
 Scheduling of heatpump can be set via a ha-entity
- Scheduling of heatpump can be achieved in three ways:
  - on/off
  - heat curve adjustment
  - calculated power
- When setting a state of an entity failed then an error message is written in the log
  (name of the entity, new failed value)

* Version 2024.11.0.dev: (#139) (#145)

* Version 2024.11.0.dev:
test pull request

* Version 2024.11.0.dev_a:
 Scheduling of heatpump can be set via a ha-entity
- Scheduling of heatpump can be achieved in three ways:
  - on/off
  - heat curve adjustment
  - calculated power
- When setting a state of an entity failed then an error message is written in the log
  (name of the entity, new failed value)

* Version 2024.11.1.dev_a:
 Scheduling of heatpump can be set via a ha-entity
- Scheduling of heatpump can be achieved in three ways:
  - on/off
  - heat curve adjustment
  - calculated power
- When setting a state of an entity failed then an error message is written in the log
  (name of the entity, new failed value)
 ## [V2024.11.1]
- Fixed an error when getting Tibber-data when using a Tibber pulse:
only data before today are stored

* Version 2024.11.1.dev_a:
 Scheduling of heatpump can be set via a ha-entity
- Scheduling of heatpump can be achieved in three ways:
  - on/off
  - heat curve adjustment
  - calculated power
- When setting a state of an entity failed then an error message is written in the log
  (name of the entity, new failed value)
 ## [V2024.11.1]
- Fixed an error when getting Tibber-data when using a Tibber pulse:
only data before today are stored

* Version 2024.11.1.dev_b:
- Scheduling of boiler can be set via a ha-entity
- when boiler is heated bij the heat pump for room-heating then there can only be "one" heating
function in an hour, therefore is a new setting introduced in the boiler-section: "boiler heated
by heatpump". This setting can be "True" or "False"
- the code is brought inline with PEP 8 (Style Guide for Python Code)

* Implementatie on/off warmtepomp (#147)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Develop (#148)

* Version 2024.11.0.dev: (#139)

* Version 2024.11.0.dev:
test pull request

* Version 2024.11.0.dev_a:
 Scheduling of heatpump can be set via a ha-entity
- Scheduling of heatpump can be achieved in three ways:
  - on/off
  - heat curve adjustment
  - calculated power
- When setting a state of an entity failed then an error message is written in the log
  (name of the entity, new failed value)

* Implementatie on/off warmtepomp (#147)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Version 2024.11.1.dev_c:
- Scheduling of boiler can be set via a ha-entity
- when boiler is heated bij the heat pump for room-heating then there can only be "one" heating
function in an hour, therefore is a new setting introduced in the boiler-section: "boiler heated
by heatpump". This setting can be "True" or "False"
- the code is brought inline with PEP 8 (Style Guide for Python Code)

* Version 2024.11.1.dev_c:
- Fixed error in a api-call: `http://<ip-adres>:5000/api/report/cost/deze_maand`??
- fixed error api call "netto_cost"

* Version 2024.11.1.dev_d:
There was a general error in api-calls, fixed.

* Implementatie van hp_enabled en hp_heat_demand (#151)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

* Implementatie van hp_enabled en hp_heat_demand (#151) (#152)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Bugfix day_ahead.py & extra optie warmtepomp: min. draai uren (#155)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

* Version 2024.11.1.dev_e:
- "optimal lower level" is not used anymore: it was too difficult and too complex to understand and
didn't give enough good results
- The calculated cycle costs  are (per battery) logged (level info).

* Versie 2024.11.1.dev_e (#156)

* Implementatie van hp_enabled en hp_heat_demand (#151) (#152)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Version 2024.11.1.dev_e:
- "optimal lower level" is not used anymore: it was too difficult and too complex to understand and
didn't give enough good results
- The calculated cycle costs  are (per battery) logged (level info).

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Versie 2024.11.1.dev_e (#156) (#157)

* Implementatie van hp_enabled en hp_heat_demand (#151) (#152)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------



* Version 2024.11.1.dev_e:
- "optimal lower level" is not used anymore: it was too difficult and too complex to understand and
didn't give enough good results
- The calculated cycle costs  are (per battery) logged (level info).

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* bugfixje heatpump en toevoegen van optionele ha entity voor degree_days_factor  (#158)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

* Versie 2024.11.1.dev_e1 (#159)

* Versie 2024.11.1.dev_e (#156)

* Implementatie van hp_enabled en hp_heat_demand (#151) (#152)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Version 2024.11.1.dev_e:
- "optimal lower level" is not used anymore: it was too difficult and too complex to understand and
didn't give enough good results
- The calculated cycle costs  are (per battery) logged (level info).

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* bugfixje heatpump en toevoegen van optionele ha entity voor degree_days_factor  (#158)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Bugfix: api werkte niet met deze_maand, deze_week etc. als geen tibber data (#160)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update day_ahead.py

* Update da_report.py

Bugfix: api did not work for  deze_week, deze_maand etc.

* Update da_report.py

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

* Develop (#161)

* Versie 2024.11.1.dev_e (#156)

* Implementatie van hp_enabled en hp_heat_demand (#151) (#152)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Version 2024.11.1.dev_e:
- "optimal lower level" is not used anymore: it was too difficult and too complex to understand and
didn't give enough good results
- The calculated cycle costs  are (per battery) logged (level info).

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* bugfixje heatpump en toevoegen van optionele ha entity voor degree_days_factor  (#158)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

* Bugfix: api werkte niet met deze_maand, deze_week etc. als geen tibber data (#160)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update day_ahead.py

* Update da_report.py

Bugfix: api did not work for  deze_week, deze_maand etc.

* Update da_report.py

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Version 2024.12.0.rc_3
Implementation of "on/off" and "power" adjustmentof heatpump

* develop_cees (#162)

* Develop (#161)

* Versie 2024.11.1.dev_e (#156)

* Implementatie van hp_enabled en hp_heat_demand (#151) (#152)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Version 2024.11.1.dev_e:
- "optimal lower level" is not used anymore: it was too difficult and too complex to understand and
didn't give enough good results
- The calculated cycle costs  are (per battery) logged (level info).

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* bugfixje heatpump en toevoegen van optionele ha entity voor degree_days_factor  (#158)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

* Bugfix: api werkte niet met deze_maand, deze_week etc. als geen tibber data (#160)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update day_ahead.py

* Update da_report.py

Bugfix: api did not work for  deze_week, deze_maand etc.

* Update da_report.py

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Version 2024.12.0.rc_3
Implementation of "on/off" and "power" adjustmentof heatpump

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Update docs.md (#163)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update day_ahead.py

* Update da_report.py

Bugfix: api did not work for  deze_week, deze_maand etc.

* Update da_report.py

* Update DOCS.md

* Update DOCS.md

* Add files via upload

* Update DOCS.md

* Update DOCS.md

* Update DOCS.md

* Update DOCS.md

* Update DOCS.md

* Add files via upload

* Update DOCS.md

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

* Definitieve versie 2024.12.0 (#165)

* format da_report

* maximizing heat_needed

* Aanvullingen DOCS.md (#164)

* develop_cees (#162)

* Develop (#161)

* Versie 2024.11.1.dev_e (#156)

* Implementatie van hp_enabled en hp_heat_demand (#151) (#152)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Version 2024.11.1.dev_e:
- "optimal lower level" is not used anymore: it was too difficult and too complex to understand and
didn't give enough good results
- The calculated cycle costs  are (per battery) logged (level info).

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* bugfixje heatpump en toevoegen van optionele ha entity voor degree_days_factor  (#158)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

* Bugfix: api werkte niet met deze_maand, deze_week etc. als geen tibber data (#160)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update day_ahead.py

* Update da_report.py

Bugfix: api did not work for  deze_week, deze_maand etc.

* Update da_report.py

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Version 2024.12.0.rc_3
Implementation of "on/off" and "power" adjustmentof heatpump

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Update docs.md (#163)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update day_ahead.py

* Update da_report.py

Bugfix: api did not work for  deze_week, deze_maand etc.

* Update da_report.py

* Update DOCS.md

* Update DOCS.md

* Add files via upload

* Update DOCS.md

* Update DOCS.md

* Update DOCS.md

* Update DOCS.md

* Update DOCS.md

* Add files via upload

* Update DOCS.md

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Definitieve versie 2024.12.0

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Develop cees (#166)

* format da_report

* maximizing heat_needed

* Aanvullingen DOCS.md (#164)

* develop_cees (#162)

* Develop (#161)

* Versie 2024.11.1.dev_e (#156)

* Implementatie van hp_enabled en hp_heat_demand (#151) (#152)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Version 2024.11.1.dev_e:
- "optimal lower level" is not used anymore: it was too difficult and too complex to understand and
didn't give enough good results
- The calculated cycle costs  are (per battery) logged (level info).

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* bugfixje heatpump en toevoegen van optionele ha entity voor degree_days_factor  (#158)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

* Bugfix: api werkte niet met deze_maand, deze_week etc. als geen tibber data (#160)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update day_ahead.py

* Update da_report.py

Bugfix: api did not work for  deze_week, deze_maand etc.

* Update da_report.py

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Version 2024.12.0.rc_3
Implementation of "on/off" and "power" adjustmentof heatpump

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Update docs.md (#163)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update day_ahead.py

* Update da_report.py

Bugfix: api did not work for  deze_week, deze_maand etc.

* Update da_report.py

* Update DOCS.md

* Update DOCS.md

* Add files via upload

* Update DOCS.md

* Update DOCS.md

* Update DOCS.md

* Update DOCS.md

* Update DOCS.md

* Add files via upload

* Update DOCS.md

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Definitieve versie 2024.12.0

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Develop cees (#167)

* format da_report

* maximizing heat_needed

* Aanvullingen DOCS.md (#164)

* develop_cees (#162)

* Develop (#161)

* Versie 2024.11.1.dev_e (#156)

* Implementatie van hp_enabled en hp_heat_demand (#151) (#152)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Version 2024.11.1.dev_e:
- "optimal lower level" is not used anymore: it was too difficult and too complex to understand and
didn't give enough good results
- The calculated cycle costs  are (per battery) logged (level info).

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* bugfixje heatpump en toevoegen van optionele ha entity voor degree_days_factor  (#158)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

* Bugfix: api werkte niet met deze_maand, deze_week etc. als geen tibber data (#160)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update day_ahead.py

* Update da_report.py

Bugfix: api did not work for  deze_week, deze_maand etc.

* Update da_report.py

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Version 2024.12.0.rc_3
Implementation of "on/off" and "power" adjustmentof heatpump

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Update docs.md (#163)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update day_ahead.py

* Update da_report.py

Bugfix: api did not work for  deze_week, deze_maand etc.

* Update da_report.py

* Update DOCS.md

* Update DOCS.md

* Add files via upload

* Update DOCS.md

* Update DOCS.md

* Update DOCS.md

* Update DOCS.md

* Update DOCS.md

* Add files via upload

* Update DOCS.md

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Definitieve versie 2024.12.0

* Definitieve versie 2024.12.0

* Set version number (2024.12.0) in changelog

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Develop (#168)

* Version 2024.11.0.dev_a:
integrate several kinds of heatpumps

* Version 2024.11.0.dev_a:
test pull request

* Version 2024.11.0.dev:
test pull request

* Version 2024.11.0.dev_a:
 Scheduling of heatpump can be set via a ha-entity
- Scheduling of heatpump can be achieved in three ways:
  - on/off
  - heat curve adjustment
  - calculated power
- When setting a state of an entity failed then an error message is written in the log
  (name of the entity, new failed value)

* Version 2024.11.0.dev: (#139)

* Version 2024.11.0.dev:
test pull request

* Version 2024.11.0.dev_a:
 Scheduling of heatpump can be set via a ha-entity
- Scheduling of heatpump can be achieved in three ways:
  - on/off
  - heat curve adjustment
  - calculated power
- When setting a state of an entity failed then an error message is written in the log
  (name of the entity, new failed value)

* Version 2024.11.0.dev: (#139) (#145)

* Version 2024.11.0.dev:
test pull request

* Version 2024.11.0.dev_a:
 Scheduling of heatpump can be set via a ha-entity
- Scheduling of heatpump can be achieved in three ways:
  - on/off
  - heat curve adjustment
  - calculated power
- When setting a state of an entity failed then an error message is written in the log
  (name of the entity, new failed value)

* Version 2024.11.1.dev_a:
 Scheduling of heatpump can be set via a ha-entity
- Scheduling of heatpump can be achieved in three ways:
  - on/off
  - heat curve adjustment
  - calculated power
- When setting a state of an entity failed then an error message is written in the log
  (name of the entity, new failed value)
 ## [V2024.11.1]
- Fixed an error when getting Tibber-data when using a Tibber pulse:
only data before today are stored

* Version 2024.11.1.dev_b:
- Scheduling of boiler can be set via a ha-entity
- when boiler is heated bij the heat pump for room-heating then there can only be "one" heating
function in an hour, therefore is a new setting introduced in the boiler-section: "boiler heated
by heatpump". This setting can be "True" or "False"
- the code is brought inline with PEP 8 (Style Guide for Python Code)

* Implementatie on/off warmtepomp (#147)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Develop (#148)

* Version 2024.11.0.dev: (#139)

* Version 2024.11.0.dev:
test pull request

* Version 2024.11.0.dev_a:
 Scheduling of heatpump can be set via a ha-entity
- Scheduling of heatpump can be achieved in three ways:
  - on/off
  - heat curve adjustment
  - calculated power
- When setting a state of an entity failed then an error message is written in the log
  (name of the entity, new failed value)

* Implementatie on/off warmtepomp (#147)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Version 2024.11.1.dev_c:
- Scheduling of boiler can be set via a ha-entity
- when boiler is heated bij the heat pump for room-heating then there can only be "one" heating
function in an hour, therefore is a new setting introduced in the boiler-section: "boiler heated
by heatpump". This setting can be "True" or "False"
- the code is brought inline with PEP 8 (Style Guide for Python Code)

* Version 2024.11.1.dev_c:
- Fixed error in a api-call: `http://<ip-adres>:5000/api/report/cost/deze_maand`??
- fixed error api call "netto_cost"

* Version 2024.11.1.dev_d:
There was a general error in api-calls, fixed.

* Implementatie van hp_enabled en hp_heat_demand (#151)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

* Implementatie van hp_enabled en hp_heat_demand (#151) (#152)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Bugfix day_ahead.py & extra optie warmtepomp: min. draai uren (#155)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

* Version 2024.11.1.dev_e:
- "optimal lower level" is not used anymore: it was too difficult and too complex to understand and
didn't give enough good results
- The calculated cycle costs  are (per battery) logged (level info).

* Versie 2024.11.1.dev_e (#156)

* Implementatie van hp_enabled en hp_heat_demand (#151) (#152)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Version 2024.11.1.dev_e:
- "optimal lower level" is not used anymore: it was too difficult and too complex to understand and
didn't give enough good results
- The calculated cycle costs  are (per battery) logged (level info).

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Versie 2024.11.1.dev_e (#156) (#157)

* Implementatie van hp_enabled en hp_heat_demand (#151) (#152)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------



* Version 2024.11.1.dev_e:
- "optimal lower level" is not used anymore: it was too difficult and too complex to understand and
didn't give enough good results
- The calculated cycle costs  are (per battery) logged (level info).

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* bugfixje heatpump en toevoegen van optionele ha entity voor degree_days_factor  (#158)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

* Versie 2024.11.1.dev_e1 (#159)

* Versie 2024.11.1.dev_e (#156)

* Implementatie van hp_enabled en hp_heat_demand (#151) (#152)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Version 2024.11.1.dev_e:
- "optimal lower level" is not used anymore: it was too difficult and too complex to understand and
didn't give enough good results
- The calculated cycle costs  are (per battery) logged (level info).

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* bugfixje heatpump en toevoegen van optionele ha entity voor degree_days_factor  (#158)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Bugfix: api werkte niet met deze_maand, deze_week etc. als geen tibber data (#160)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update day_ahead.py

* Update da_report.py

Bugfix: api did not work for  deze_week, deze_maand etc.

* Update da_report.py

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

* Develop (#161)

* Versie 2024.11.1.dev_e (#156)

* Implementatie van hp_enabled en hp_heat_demand (#151) (#152)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* Version 2024.11.1.dev_e:
- "optimal lower level" is not used anymore: it was too difficult and too complex to understand and
didn't give enough good results
- The calculated cycle costs  are (per battery) logged (level info).

---------

Co-authored-by: soeter01 <50205733+soeter01@users.noreply.github.com>

* bugfixje heatpump en toevoegen van optionele ha entity voor degree_days_factor  (#158)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

---------

Co-authored-by: Cees van Beek <16610333+corneel27@users.noreply.github.com>

* Bugfix: api werkte niet met deze_maand, deze_week etc. als geen tibber data (#160)

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update day_ahead.py

Bug fixes warmtepomp
Toevoegen van optie om minimale run lengte van warmtepomp te garanderen

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

Bugfix minimale run lengte warmtepomp

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update day_ahead.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Update da_report.py

* Update config.yaml

* Upda…
  • Loading branch information
corneel27 and soeter01 authored Jan 8, 2025
1 parent e52e103 commit a686cb5
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 100 deletions.
3 changes: 3 additions & 0 deletions dao/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog 刀 DAO
# Day Ahead Optimizer
# [V2025.1.2]
- Fixed errors when postgresql db-engine is used
- Fixed error calculating report/balance with period "vorige maand"

# [V2025.1.1]
Fixed errors when consumption-data in last contractyear could not be calculated.
Expand Down
2 changes: 1 addition & 1 deletion dao/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: 刀 Day Ahead Optimizer
version: 2025.1.1
version: 2025.1.2
slug: day_ahead_opt
description: Docker used by Home Assistant Community Add-ons for day ahead optimizations
url: https://github.com/corneel27/day-ahead/
Expand Down
11 changes: 5 additions & 6 deletions dao/prog/da_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from sqlalchemy import Table, select, func, and_
from utils import get_tibber_data, error_handling
from version import __version__
from da_config import Config
from dao.prog.da_config import Config
from da_meteo import Meteo
from da_prices import DaPrices
from db_manager import DBmanagerObj
Expand Down Expand Up @@ -343,13 +343,12 @@ def calc_da_avg(self) -> float:
outer_query = select(func.avg(inner_query.c.value).label("avg_da"))
from sqlalchemy.dialects import mysql # , postgresql

query_str = str(inner_query.compile(dialect=mysql.dialect()))
logging.debug(f"inner query p_avg: {query_str}")
query_str = str(outer_query.compile(dialect=mysql.dialect()))
logging.debug(f"outer query p_avg: {query_str}")

# Execute the query and fetch the result
with self.db_da.engine.connect() as connection:
query_str = str(inner_query.compile(connection))
logging.debug(f"inner query p_avg: {query_str}")
query_str = str(outer_query.compile(connection))
logging.debug(f"outer query p_avg: {query_str}")
result = connection.execute(outer_query)
return result.scalar()

Expand Down
134 changes: 70 additions & 64 deletions dao/prog/da_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@


class Config:
db_da = None
db_ha = None

@staticmethod
def parse(file_name: str):
Expand Down Expand Up @@ -46,72 +48,76 @@ def set(self, key, value):
self.options[key] = value

def get_db_da(self, check_create: bool = False):
db_da_engine = self.get(["database da", "engine"], None, "mysql")
db_da_server = self.get(["database da", "server"], None, "core-mariadb")
db_da_port = int(self.get(["database da", "port"], None, 0))
if db_da_engine == "sqlite":
db_da_name = self.get(["database da", "database"], None, "day_ahead.db")
else:
db_da_name = self.get(["database da", "database"], None, "day_ahead")
db_da_user = self.get(["database da", "username"], None, "day_ahead")
db_da_password = self.get(["database da", "password"])
db_da_path = self.get(["database da", "db_path"], None, "../data")
db_time_zone = self.get(["time_zone"])
if check_create:
db_url = DBmanagerObj.db_url(
db_dialect=db_da_engine,
db_name=db_da_name,
db_server=db_da_server,
db_user=db_da_user,
db_password=db_da_password,
db_port=db_da_port,
db_path=db_da_path,
)
if not sqlalchemy_utils.database_exists(db_url):
sqlalchemy_utils.create_database(db_url)
try:
db_da = DBmanagerObj(
db_dialect=db_da_engine,
db_name=db_da_name,
db_server=db_da_server,
db_user=db_da_user,
db_password=db_da_password,
db_port=db_da_port,
db_path=db_da_path,
db_time_zone=db_time_zone,
)
except Exception as ex:
logging.error("Check your settings for day_ahead database")
return None
return db_da
if Config.db_da is None:
db_da_engine = self.get(["database da", "engine"], None, "mysql")
db_da_server = self.get(["database da", "server"], None, "core-mariadb")
db_da_port = int(self.get(["database da", "port"], None, 0))
if db_da_engine == "sqlite":
db_da_name = self.get(["database da", "database"], None, "day_ahead.db")
else:
db_da_name = self.get(["database da", "database"], None, "day_ahead")
db_da_user = self.get(["database da", "username"], None, "day_ahead")
db_da_password = self.get(["database da", "password"])
db_da_path = self.get(["database da", "db_path"], None, "../data")
db_time_zone = self.get(["time_zone"])
if check_create:
db_url = DBmanagerObj.db_url(
db_dialect=db_da_engine,
db_name=db_da_name,
db_server=db_da_server,
db_user=db_da_user,
db_password=db_da_password,
db_port=db_da_port,
db_path=db_da_path,
)
if not sqlalchemy_utils.database_exists(db_url):
sqlalchemy_utils.create_database(db_url)
try:
_db_da = DBmanagerObj(
db_dialect=db_da_engine,
db_name=db_da_name,
db_server=db_da_server,
db_user=db_da_user,
db_password=db_da_password,
db_port=db_da_port,
db_path=db_da_path,
db_time_zone=db_time_zone,
)
except Exception as ex:
logging.error("Check your settings for day_ahead database")
return None
Config.db_da = _db_da
return Config.db_da

def get_db_ha(self):
db_ha_engine = self.get(["database ha", "engine"], None, "mysql")
db_ha_server = self.get(["database ha", "server"], None, "core-mariadb")
db_ha_port = int(self.get(["database ha", "port"], None, 0))
if db_ha_engine == "sqlite":
db_ha_name = self.get(["database ha", "database"], None, "home-assistant_v2.db")
else:
db_ha_name = self.get(["database ha", "database"], None, "homeassistant")
db_ha_user = self.get(["database ha", "username"], None, "homeassistant")
db_ha_password = self.get(["database ha", "password"])
db_ha_path = self.get(["database ha", "db_path"], None, "/homeassistant")
db_time_zone = self.get(["time_zone"])
try:
db_ha = DBmanagerObj(
db_dialect=db_ha_engine,
db_name=db_ha_name,
db_server=db_ha_server,
db_user=db_ha_user,
db_password=db_ha_password,
db_port=db_ha_port,
db_path=db_ha_path,
db_time_zone=db_time_zone,
)
except Exception as ex:
logging.error("Check your settings for Home Assitant database")
return None
return db_ha
if Config.db_ha is None:
db_ha_engine = self.get(["database ha", "engine"], None, "mysql")
db_ha_server = self.get(["database ha", "server"], None, "core-mariadb")
db_ha_port = int(self.get(["database ha", "port"], None, 0))
if db_ha_engine == "sqlite":
db_ha_name = self.get(["database ha", "database"], None, "home-assistant_v2.db")
else:
db_ha_name = self.get(["database ha", "database"], None, "homeassistant")
db_ha_user = self.get(["database ha", "username"], None, "homeassistant")
db_ha_password = self.get(["database ha", "password"])
db_ha_path = self.get(["database ha", "db_path"], None, "/homeassistant")
db_time_zone = self.get(["time_zone"])
try:
db_ha = DBmanagerObj(
db_dialect=db_ha_engine,
db_name=db_ha_name,
db_server=db_ha_server,
db_user=db_ha_user,
db_password=db_ha_password,
db_port=db_ha_port,
db_path=db_ha_path,
db_time_zone=db_time_zone,
)
except Exception as ex:
logging.error("Check your settings for Home Assitant database")
return None
Config.db_ha = db_ha
return Config.db_ha


def get_config(file_name: str, keys: list, default=None):
Expand Down
34 changes: 12 additions & 22 deletions dao/prog/da_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,10 @@
class Report:
periodes = {}

def __init__(self, file_name: str = "../data/options.json", db_da=None, db_ha=None):
def __init__(self, file_name: str = "../data/options.json"):
self.config = Config(file_name)
if db_da is None:
self.db_da = self.config.get_db_da()
else:
self.db_da = db_da
if db_ha is None:
self.db_ha = self.config.get_db_ha()
else:
self.db_ha = db_ha
self.db_da = self.config.get_db_da()
self.db_ha = self.config.get_db_ha()
self.prices_options = self.config.get(["prices"])
# eb + ode levering
self.taxes_l_def = self.prices_options["energy taxes delivery"]
Expand Down Expand Up @@ -496,8 +490,9 @@ def add_col_df(
col_index = add_from.columns.get_loc(col_name_from) + 1
for row in add_from.itertuples():
# add_from.at[row.tijd, col_name_from])
add_to.at[row.tijd, col_name_to] = (
add_to.at[row.tijd, col_name_to] + factor * row[col_index]
if row.tijd in add_to.index:
add_to.at[row.tijd, col_name_to] = (
add_to.at[row.tijd, col_name_to] + factor * row[col_index]
)
return add_to

Expand Down Expand Up @@ -1092,11 +1087,9 @@ def get_grid_data(
.group_by(interval)
)

# from sqlalchemy.dialects import postgresql, mysql
# query_str = str(query.compile(engine=mysql.engine()))
# print(query_str)

with self.db_da.engine.connect() as connection:
query_str = str(query.compile(connection))
logging.debug(f"Query: \n {query_str}")
result_cat = pd.read_sql_query(query, connection)
result_cat.index = result_cat[
interval
Expand Down Expand Up @@ -1150,10 +1143,9 @@ def get_grid_data(
.order_by(t1.c.time)
)

# from sqlalchemy.dialects import postgresql
# query_str = str(query.compile(engine=postgresql.engine()))

with self.db_da.engine.connect() as connection:
query_str = str(query.compile(connection))
logging.debug(query_str)
df_prices = pd.read_sql_query(query, connection)
logging.debug(f"Prijzen \n{df_prices.to_string()}\n")

Expand Down Expand Up @@ -1229,11 +1221,9 @@ def get_grid_data(
)
)

from sqlalchemy.dialects import postgresql

query_str = str(query.compile(dialect=postgresql.dialect()))
logging.debug(f"query get prognose data:\n {query_str}")
with self.db_da.engine.connect() as connection:
query_str = str(query.compile(connection))
logging.debug(f"query get prognose data:\n {query_str}")
df_prog = pd.read_sql_query(query, connection)

df_prog.index = pd.to_datetime(df_prog["tijd"])
Expand Down
3 changes: 2 additions & 1 deletion dao/prog/day_ahead.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from mip import Model, xsum, minimize, BINARY, CONTINUOUS
from pandas.core.dtypes.inference import is_number
from dao.prog.da_report import Report
from dao.prog.da_config import Config
from utils import (
get_value_from_dict,
is_laagtarief,
Expand Down Expand Up @@ -317,7 +318,7 @@ def calc_optimum(
"""
report = None
try:
report = Report(file_name=self.file_name, db_da=self.db_da, db_ha=self.db_ha)
report = Report(file_name=self.file_name)
# df.loc[df['a'] == 1, 'b'].sum()
# df.query("a == 1")['b'].sum()
# df[df['a']==1]['b'].sum()
Expand Down
8 changes: 5 additions & 3 deletions dao/prog/db_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def __init__(
f"postgresql+psycopg2://{self.user}:{self.password}@"
f"{self.server}/{self.db_name}"
)
with self.engine.connect() as connection:
connection.execute(text(f"SET timezone = '{self.TARGET_TIMEZONE}';"))
# with self.engine.connect() as connection:
# connection.execute(text(f"SET timezone = '{self.TARGET_TIMEZONE}';"))
else: # sqlite3
if self.db_path is None:
self.db_path = "../data"
Expand Down Expand Up @@ -160,7 +160,9 @@ def unix_timestamp(self, date_str):
elif self.db_dialect == "postgresql":
return func.extract(
"epoch",
func.timezone(self.TARGET_TIMEZONE, func.cast(date_str, TIMESTAMP)),
func.to_timestamp(date_str, 'YYYY-MM-DD hh24:mi:ss')
# func.timezone(self.TARGET_TIMEZONE, func.cast(date_str, TIMESTAMP)),
#EXTRACT(epoch FROM to_timestamp('2025-01-07 00:07:00', 'YYYY-MM-DD hh24:mi:ss'))
)
else: # mysql/mariadb
return func.unix_timestamp(date_str)
Expand Down
2 changes: 2 additions & 0 deletions dao/webserver/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from flask import Flask
import sys
from dao.prog.da_config import Config

# sys.path.append("../")

Expand All @@ -8,6 +9,7 @@
from dao.webserver.app.routes import *



# if __name__ == '__main__':
# app.run()
# app.run(port=5000, host='0.0.0.0')
Expand Down
6 changes: 3 additions & 3 deletions dao/webserver/app/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import logging
from logging.handlers import TimedRotatingFileHandler
from dao.prog.da_config import Config
import dao.prog.da_report
from dao.prog.da_report import Report
from dao.prog.version import __version__

web_datapath = "static/data/"
Expand Down Expand Up @@ -260,7 +260,7 @@ def run_process():

@app.route('/reports', methods=['POST', 'GET'])
def reports():
report = dao.prog.da_report.Report(app_datapath+"/options.json")
report = Report(app_datapath+"/options.json")
subjects = ["grid", "balans"]
active_subject = "grid"
views = ["grafiek", "tabel"]
Expand Down Expand Up @@ -396,7 +396,7 @@ def api_report(fld: str, periode: str):
"""
cumulate = request.args.get('cumulate')
expected = request.args.get('expected')
report = dao.prog.da_report.Report(app_datapath+"/options.json")
report = Report(app_datapath+"/options.json")
# start = request.args.get('start')
# end = request.args.get('end')
if cumulate is None:
Expand Down

0 comments on commit a686cb5

Please sign in to comment.