Comments (4)
You can pass the run hours for each optimisation run, that will achieve this desired effect.
I have been playing around with different variables to modify the run hours dynamically.
You can see some switches and external temperature as well as costs that sometimes will drive the total_hours to zero.
"def_total_hours [EV 11 kW]": {{ state_attr('sensor.duka_charging_rate_sensor','time_left')|int(2)}}
"def_total_hours [EV@home 11 kW]": {{(is_state('binary_sensor.duka_charger', 'on') | abs) * ((100-states('sensor.duka_battery')|int(0))/11)|int(0)}}
"def_total_hours [Pool Filter 1.4 kW]": 4
"def_total_hours [HVAC humidity 4 kW]": {{max(0,(state_attr('climate.family','current_humidity')|int(0) - 60)/10)|int(0)}}
"def_total_hours [HVAC temp 4 kW]": {{max(0,(state_attr('climate.bedroom','current_temperature')|float(0) -
state_attr('climate.daikin_ap46401','temperature')|float)|int(0))}}
"def_total_hours [HVAC No People 4 kW]": {{states('zone.home')}}
"def_total_hours [Pool Heater 5 kW]": {{states('input_number.pool_temperature_set_point')|int -
states('input_number.pool_temperature')|int}}
"def_total_hours_ev": "{{(is_state('binary_sensor.duka_charger', 'on') | abs) *
min(((100-states('sensor.duka_battery')|int(0))/11)|int(0), ((state_attr('sensor.amber_general_forecast', 'forecasts')|
selectattr('descriptor','eq','extremely_low')|list|count)/4))|int(0)}}"
"def_total_hours_hvac": "{{(state_attr('weather.location_hourly','forecast')[:24]|selectattr('temperature','gt',24)|
map(attribute='temperature')|list|count)}}"
"def_total_hours [EV 11 kW]": 2
"def_total_hours [EV@home 11 kW]": 2
"def_total_hours [Pool Filter 1.4 kW]": 4
"def_total_hours [HVAC humidity 4 kW]": 0
"def_total_hours [HVAC temp 4 kW]": 0
"def_total_hours [HVAC No People 4 kW]": 1
"def_total_hours [Pool Heater 5 kW]": 4
"def_total_hours_ev": "2"
"def_total_hours_hvac": "3"
I then call this using the following shell command:
\"def_total_hours\":[{{states('sensor.def_total_hours_pool_filter')
}},{{states('sensor.def_total_hours_pool_heatpump')
}},{{states('sensor.def_total_hours_ev')
}},{{states('sensor.def_total_hours_hvac')
}},{{states('sensor.def_total_hours_hws')
}}]}' http://localhost:5000/action/naive-mpc-optim"
\"def_total_hours\":[6,6,2,3,6]}' http://localhost:5000/action/naive-mpc-optim"
from emhass.
Hi, we will take Mark's reply as the solution to this. Indeed this use case was the goal when providing the possibility to pass some of the configuration parameters at runtime, in order to update them on the go.
You can pass these parameters also with the dayahead-optim
end point.
You can also pass all these parameters at runtime:
-
num_def_loads
for the number of deferrable loads to consider. -
P_deferrable_nom
for the nominal power for each deferrable load in Watts. -
def_total_hours
for the total number of hours that each deferrable load should operate. -
treat_def_as_semi_cont
to define if we should treat each deferrable load as a semi-continuous variable. -
set_def_constant
to define if we should set each deferrable load as a constant fixed value variable with just one startup for each optimization task. -
solcast_api_key
for the SolCast API key if you want to use this service for PV power production forecast. -
solcast_rooftop_id
for the ID of your rooftop for the SolCast service implementation.
from emhass.
@purcell-lab can you show me your automatisations in HA that fire your naive-mpc-optim
and dayahead-optim
How often do they fire?
Is it possible to show all your EMHASS configs? Also your EMHASS configuration file?
In the naive-mpc-optim
you need to pass battery data?
When applying this controller, the following runtimeparams should be defined:
prediction_horizon for the MPC prediction horizon. Fix this at at least 5 times the optimization time step.
soc_init for the initial value of the battery SOC for the current iteration of the MPC.
soc_final for the final value of the battery SOC for the current iteration of the MPC.
def_total_hours for the list of deferrable loads functioning hours. These values can decrease as the day advances to take into account receding horizon daily energy objectives for each deferrable load.
I do not have batteries.
from emhass.
If you don't have a battery, no need to provide the SOC parameters at runtime. From the documentation :
:param soc_init: The initial battery SOC for the optimization. This parameter is optional, if not given soc_init = soc_final = soc_target from the configuration file.
:param soc_final: The final battery SOC for the optimization. This parameter is optional, if not given soc_init = soc_final = soc_target from the configuration file.
from emhass.
Related Issues (20)
- Upgrade to 0.4.0 - TypeError: string indices must be integers HOT 5
- logging significantly reduced with 0.4.0 HOT 3
- Solar.Forecast service gives error HOT 1
- SSL Error SSLCertVerificationError HOT 1
- How to create a deferrable load sensor HOT 2
- Feature Request: Color for PV HOT 2
- Feature Request: smooth allocation of power to continuous loads HOT 6
- Feature Request: Some questions HOT 8
- Feature Request: Build in some priority HOT 1
- UnicodeDecodeError HOT 4
- prod_cost not updated.
- prod/load_cost unit_of_measurement €/kWh & $/kWh HOT 3
- Feature Request: unit_prod_price & unit_load_cost forecasts HOT 14
- Feature Request: Pass an array of hourly load_peak_hours costs instead of a constant value ( ex. prices from Tibber) HOT 2
- Solar forcast is broken HOT 3
- Feature request: Grid availability HOT 1
- 'last_window' has missing values error after HASS restart HOT 3
- Add single configuration to prefix all published sensors HOT 8
- When using the custom names there are no attributes is the sensors HOT 2
- Feature request - pass current battery SOC to dayahead-optim to improve optimization HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emhass.