### Use Solar.Forecast service for PV power Source: https://github.com/davidusb-geek/emhass/blob/master/docs/forecasts.md Integrate with the Solar.Forecast service by setting `method=solar.forecast` and providing the PV peak installed power in kW. This example shows how to configure for a 5 kW installation. ```bash curl -i -H "Content-Type:application/json" -X POST -d '{ "solar_forecast_kwp":5 }' http://localhost:5000/action/dayahead-optim ``` -------------------------------- ### Run EMHASS Web Server Source: https://github.com/davidusb-geek/emhass/blob/master/docs/develop.md Starts the EMHASS web server. Ensure all dependencies are installed and the virtual environment is activated. ```bash python3 ./src/emhass/web_server.py ``` -------------------------------- ### Example: Setting Inverter Stress Cost via Runtime Parameters Source: https://github.com/davidusb-geek/emhass/blob/master/docs/advanced_math_model.md This example demonstrates how to set the 'inverter_stress_cost' and 'prediction_horizon' parameters using a curl command to interact with the EMHASS API. This is useful for dynamically adjusting optimization behavior. ```bash curl -i -H "Content-Type: application/json" -X POST -d '{ "inverter_stress_cost": 0.5, "prediction_horizon": 24 }' http://localhost:5000/action/naive-mpc-optim ``` -------------------------------- ### Install Dependencies with virtualenv and pip Source: https://github.com/davidusb-geek/emhass/blob/master/docs/develop.md Installs project dependencies, including those for running unit tests, using virtualenv and pip. Ensure the virtual environment is activated before running. ```bash virtualenv .venv ``` ```bash python3 -m pip install -e '.[test]' ``` -------------------------------- ### Naive MPC Optimization with Deferrable Load Parameters Source: https://github.com/davidusb-geek/emhass/blob/master/docs/advanced_math_model.md Performs a naive MPC optimization including parameters for deferrable loads. This example demonstrates how to specify operating hours and timestep constraints for deferrable loads. ```bash curl -i -H 'Content-Type:application/json' -X POST -d '{"pv_power_forecast":[0, 70, 141.22, 246.18, 513.5, 753.27, 1049.89, 1797.93, 1697.3, 3078.93], "prediction_horizon":10, "soc_init":0.5,"soc_final":0.6,"operating_hours_of_each_deferrable_load":[1,3],"start_timesteps_of_each_deferrable_load":[0,3],"end_timesteps_of_each_deferrable_load":[0,6]}' http://localhost:5000/action/naive-mpc-optim ``` -------------------------------- ### MLForecaster Tuning Optimization Logs Source: https://github.com/davidusb-geek/emhass/blob/master/docs/mlforecaster.md Example logs showing the results of backtesting and Bayesian hyperparameter optimization for an MLForecaster model, including R2 score comparisons. ```none 2023-02-20 22:06:43,112 - __main__ - INFO - Backtesting and bayesian hyperparameter optimization 2023-02-20 22:25:29,987 - __main__ - INFO - Elapsed time: 1126.868682384491 2023-02-20 22:25:50,264 - __main__ - INFO - ### Train/Test R2 score comparison ### 2023-02-20 22:25:50,282 - __main__ - INFO - R2 score for naive prediction in train period (backtest): 0.22525145245617462 2023-02-20 22:25:50,284 - __main__ - INFO - R2 score for optimized prediction in train period: 0.7485208725102304 2023-02-20 22:25:50,312 - __main__ - INFO - R2 score for non-optimized prediction in test period: 0.7098996657492629 2023-02-20 22:25:50,337 - __main__ - INFO - R2 score for naive persistence forecast in test period: 0.8714987509894714 2023-02-20 22:25:50,352 - __main__ - INFO - R2 score for optimized prediction in test period: 0.7572325833767719 ``` -------------------------------- ### Run Day-Ahead Optimization with Solcast Secrets Source: https://github.com/davidusb-geek/emhass/blob/master/docs/forecasts.md Example of running a day-ahead optimization, passing Solcast API key and system ID as runtime parameters instead of setting them in the configuration. ```bash curl -i -H "Content-Type:application/json" -X POST -d '{ "solcast_rooftop_id":"", "solcast_api_key":"" }' http://localhost:5000/action/dayahead-optim ``` -------------------------------- ### Read Battery SOC from Source Source: https://github.com/davidusb-geek/emhass/blob/master/docs/cookbook/battery_aware_runtime_params.md Select one of the provided examples to read the battery SOC from your specific stack. Adapt the code to match how your system exposes this data. ```javascript // Pick ONE of these — adapt to your stack: const soc_raw = flow.get("battery_soc_percent"); // typical HA / Modbus poll // const soc_raw = msg.payload; // if previous node was a sensor read // const soc_raw = global.get("home_battery").soc; // global context store ``` -------------------------------- ### Log Runtime Banner Example Source: https://github.com/davidusb-geek/emhass/blob/master/docs/study_cases/good_practices.md This log entry shows the EMHASS version, Python version, CVXPY version, solver, and platform. It is useful for bug reports. ```text 2026-04-26 17:00:00 INFO EMHASS 0.17.2 | Python 3.11.9 | CVXPY 1.5.3 (Highs) | Linux-x86_64 ``` ```text 2026-04-26 17:00:01 INFO Optimization completed in 0.96s (top: optim_solve=0.52s, 54%) ``` -------------------------------- ### Configure Battery SOC Surplus Cost Source: https://github.com/davidusb-geek/emhass/blob/master/docs/advanced_math_model.md This example demonstrates how to set the `battery_soc_surplus_threshold` to 0.85 and `battery_soc_surplus_cost` to 0.1 using runtime parameters via a curl command. The `prediction_horizon` is also set to 24 hours. ```bash curl -i -H "Content-Type: application/json" -X POST -d '{ "battery_soc_surplus_threshold": 0.85, "battery_soc_surplus_cost": 0.1, "prediction_horizon": 24 }' http://localhost:5000/action/naive-mpc-optim ``` -------------------------------- ### PV-only Setup with Static Tariff Source: https://github.com/davidusb-geek/emhass/blob/master/docs/study_cases/reference_configs.md Configure EMHASS for a PV-only system without a battery, using a static electricity tariff. This setup is suitable for optimizing deferrable loads against PV surplus. ```yaml set_use_pv: true solar_forecast_kwp: 8 optimization_time_step: 30 set_use_battery: false nominal_power_of_deferrable_loads: - 3000 # water heater (heat-pump-driven, treat as regular deferrable) - 1500 # dishwasher operating_hours_of_each_deferrable_load: - 4 - 2 # rounded up from typical 1.5 h cycle # Static prices (no dynamic tariff) load_cost_forecast_method: list prod_price_forecast_method: list # Pass [0.30] * 48 and [0.08] * 48 at runtime, or set in config if truly static. ``` -------------------------------- ### Sync Dependencies with uv Source: https://github.com/davidusb-geek/emhass/blob/master/docs/develop.md Installs project dependencies, including those for running unit tests, using the uv package manager. If on an ARM architecture, consider adding piwheels as an index. ```bash uv sync --extra test ``` ```bash #uv sync --extra test --index=https://www.piwheels.org/simple ``` -------------------------------- ### Integration Code Example Source: https://github.com/davidusb-geek/emhass/blob/master/docs/cookbook/_template.md This snippet represents integration code, verified against the source. It's used in a stepwise integration process. ```javascript // integration code, runnable, source-verified ``` -------------------------------- ### Predict with MLForecaster (default) Source: https://github.com/davidusb-geek/emhass/blob/master/docs/mlforecaster.md Use the `forecast-model-predict` endpoint to obtain a prediction using a previously trained model. This example shows the default POST request. ```default curl -i -H "Content-Type:application/json" -X POST -d '{}' http://localhost:5000/action/forecast-model-predict ``` -------------------------------- ### Define thermal load configuration Source: https://github.com/davidusb-geek/emhass/blob/master/docs/thermal_model.md Example structure for the def_load_config dictionary when the second deferrable load is a thermal heater. ```json "def_load_config": [ {}, {"thermal_config": { "heating_rate": 5.0, "cooling_constant": 0.1, "thermal_inertia": 1.0, "overshoot_temperature": 24.0, "start_temperature": 20, "sense": "heat", "desired_temperatures": [20, 21, 20, 19] }} ] ``` -------------------------------- ### Apartment with Dynamic Tariff Configuration Source: https://github.com/davidusb-geek/emhass/blob/master/docs/study_cases/reference_configs.md Configuration for an apartment setup focusing on load shifting with dynamic electricity tariffs, without PV or battery storage. ```yaml set_use_pv: false set_use_battery: false nominal_power_of_deferrable_loads: - 2200 # washing machine - 2000 # dishwasher - 1800 # heat-pump tumble dryer operating_hours_of_each_deferrable_load: - 2 # washing machine (rounded up from typical 1.5 h cycle) - 2 # dishwasher (rounded up from typical 1.5 h cycle) - 1 # tumble dryer ``` -------------------------------- ### Dockerfile for Gurobi Solver Source: https://github.com/davidusb-geek/emhass/blob/master/docs/advanced_solvers.md Extends the base EMHASS image and installs the Gurobi Python interface. Sets the LP_SOLVER environment variable to GUROBI. ```dockerfile FROM davidusb-geek/emhass:latest # Install the Gurobi Python interface RUN uv pip install gurobipy # Set the solver environment variable ENV LP_SOLVER=GUROBI ``` -------------------------------- ### Setup Environment Variables for EMHASS Docker Test Source: https://github.com/davidusb-geek/emhass/blob/master/docs/develop.md Sets up necessary environment variables for cloning the EMHASS repository and checking out a specific branch for testing. ```bash #setup environment variables for test export repo=https://github.com/davidusb-geek/emhass.git export branch=master #Ex. HAURL=https://localhost:8123/ export HAURL=HOMEASSISTANTURLHERE export HAKEY=HOMEASSISTANTKEYHERE git clone $repo cd emhass git checkout $branch ``` -------------------------------- ### Publish Data with Thermal Load Configuration (Shell Command) Source: https://github.com/davidusb-geek/emhass/blob/master/docs/thermal_model.md This shell command example demonstrates how to publish data to EMHASS, specifically configuring a single deferrable thermal load. The `thermal_config` key is essential for identifying thermal loads. ```shell shell_command: publish_data: 'curl -i -H "Content-Type: application/json" -X POST -d ''{"def_load_config": [{"thermal_config": {}}]}'' http://localhost:5000/action/publish-data' ``` -------------------------------- ### EMHASS Static Configuration for Runtime Parameters Source: https://github.com/davidusb-geek/emhass/blob/master/docs/cookbook/transport_nodered_mpc_orchestration.md Ensure your EMHASS static configuration (`config.yaml` or Web GUI) includes keys that will be driven by runtime parameters. This example shows essential keys for deferrable loads and battery usage. ```yaml optim_conf: set_use_battery: true # if you have a battery number_of_deferrable_loads: 2 # adjust to your setup nominal_power_of_deferrable_loads: [3000, 750] operating_hours_of_each_deferrable_load: [4, 0] # overridden per MPC call start_timesteps_of_each_deferrable_load: [0, 0] # overridden per MPC call end_timesteps_of_each_deferrable_load: [0, 0] # overridden per MPC call ``` -------------------------------- ### Run Multi-Day MPC with Solcast Forecast Source: https://github.com/davidusb-geek/emhass/blob/master/docs/forecasts.md Example of running a 36-hour naive-MPC optimization using a native Solcast forecast. EMHASS automatically extends the Solcast forecast window to cover the full prediction horizon without extra configuration. ```bash curl -i -H "Content-Type:application/json" -X POST -d '{ "prediction_horizon": 72, "solcast_rooftop_id": "", "solcast_api_key": "" }' http://localhost:5000/action/naive-mpc-optim ``` -------------------------------- ### Passing PV Power Forecast Data via List (curl) Source: https://github.com/davidusb-geek/emhass/blob/master/docs/forecasts.md Example of sending PV power forecast data as a list in a curl POST request. Ensure the list length matches the optimization time step and prediction horizon. ```bash curl -i -H "Content-Type: application/json" -X POST -d '{ "pv_power_forecast":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 141.22, 246.18, 513.5, 753.27, 1049.89, 1797.93, 1697.3, 3078.93, 1164.33, 1046.68, 1559.1, 2091.26, 1556.76, 1166.73, 1516.63, 1391.13, 1720.13, 820.75, 804.41, 251.63, 79.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }' http://localhost:5000/action/dayahead-optim ``` -------------------------------- ### Multiple Deferrable Loads with Thermal Battery Source: https://github.com/davidusb-geek/emhass/blob/master/docs/thermal_battery.md Integrate a thermal battery alongside other deferrable loads like EV chargers or washing machines. This example shows how to structure the configuration to include multiple loads, with the thermal battery as one of them. ```python { "def_load_config": [ {}, { "thermal_battery": { "supply_temperature": 35.0, "volume": 15.0, "start_temperature": 22.0, "min_temperatures": [20.0] * 48, # Constant 20°C minimum "max_temperatures": [26.0] * 48, # Constant 26°C maximum "u_value": 0.45, "envelope_area": 320.0, "ventilation_rate": 0.5, "heated_volume": 200.0 } }, {} ] } ``` -------------------------------- ### Passing Load Cost Forecast Data via List (curl) Source: https://github.com/davidusb-geek/emhass/blob/master/docs/forecasts.md Example of sending load cost forecast data as a list in a curl POST request. The list must contain values chronologically, starting with the current time period. ```bash curl -i -H "Content-Type: application/json" -X POST -d '{ "load_cost_forecast": [0.25, 0.24, 0.23, 0.26, 0.28, ...], "prediction_horizon": 24, "optimization_time_step": 60 }' http://localhost:5000/action/dayahead-optim ``` -------------------------------- ### Build and Run Docker Add-on Method Source: https://github.com/davidusb-geek/emhass/blob/master/docs/develop.md Builds the Docker image and runs a container, passing secrets via options.json. ```bash docker build -t emhass/test . # pass secrets via options.json (similar to what Home Assistant automatically creates from the addon configuration page) docker run -it -p 5000:5000 --name emhass-test -v ./options.json:/data/options.json emhass/test ``` -------------------------------- ### Install EMHASS using pip Source: https://github.com/davidusb-geek/emhass/blob/master/docs/installation_methods.md Install the EMHASS package into your activated virtual environment using pip. This command fetches and installs the latest stable version. ```bash python3 -m pip install emhass ``` -------------------------------- ### Create EMHASS Directory and Secrets File Source: https://github.com/davidusb-geek/emhass/blob/master/docs/installation_methods.md Demonstrates creating a directory for EMHASS configuration and appending a sample secrets_emhass.yaml file to it using a heredoc. ```bash # cli example of creating an emhass directory and appending a secrets_emhass.yaml file inside mkdir ~/emhass cd ~/emhass cat <> ~/emhass/secrets_emhass.yaml hass_url: https://myhass.duckdns.org/ long_lived_token: thatverylongtokenhere time_zone: Europe/Paris lat: 45.83 lon: 6.86 alt: 4807.8 EOT docker run --rm -it --restart always -p 5000:5000 --name emhass-container -v /emhass/share:/share -v /emhass/secrets_emhass.yaml:/app/secrets_emhass.yaml ghcr.io/davidusb-geek/emhass:latest ``` -------------------------------- ### Upgrade EMHASS Installation Source: https://github.com/davidusb-geek/emhass/blob/master/docs/installation_methods.md To upgrade your EMHASS installation to the latest version in the future, use the --upgrade flag with pip. ```bash python3 -m pip install --upgrade emhass ``` -------------------------------- ### VS-Code Task: EMHASS Install Source: https://github.com/davidusb-geek/emhass/blob/master/docs/develop.md Compiles and installs EMHASS within the VS-Code development environment. This task must be run after making changes to the EMHASS code before debugging. ```bash # control+shift+p > Tasks: Run Task > EMHASS Install ``` -------------------------------- ### Weather-Compensated Minimum Temperature Curve Example Source: https://github.com/davidusb-geek/emhass/blob/master/docs/thermal_battery.md This example defines a weather-compensated minimum temperature curve for radiator heating systems. It specifies the slope, offset, and absolute minimum and maximum supply temperatures. ```json {"slope": 1.0, "offset": 35, "min_supply": 30, "max_supply": 55} ``` -------------------------------- ### View EMHASS Prediction Logs Source: https://github.com/davidusb-geek/emhass/blob/master/docs/mlregressor.md Example log output generated by EMHASS after a successful prediction. ```default 2024-04-17 14:25:40,695 - web_server - INFO - Passed runtime parameters: {'mlr_predict_entity_id': 'sensor.predicted_hours', 'mlr_predict_unit_of_measurement': 'h', 'mlr_predict_friendly_name': 'Predicted hours', 'new_values': [8.2, 7.23, 2, 6], 'model_type': 'heating_hours_degreeday'} 2024-04-17 14:25:40,696 - web_server - INFO - >> Setting input data dict 2024-04-17 14:25:40,696 - web_server - INFO - Setting up needed data 2024-04-17 14:25:40,700 - web_server - INFO - >> Performing a machine learning regressor predict... 2024-04-17 14:25:40,715 - web_server - INFO - Performing a prediction for heating_hours_degreeday 2024-04-17 14:25:40,750 - web_server - INFO - Successfully posted to sensor.predicted_hours = 3.716600000000001 ``` -------------------------------- ### Manage version tags Source: https://github.com/davidusb-geek/emhass/wiki/Contributing Commands to create and push version tags to the repository. ```bash git tag vX.X.X ``` ```bash git push origin --tags ``` -------------------------------- ### Build and Run Docker Docker Method Source: https://github.com/davidusb-geek/emhass/blob/master/docs/develop.md Builds the Docker image and runs a container, passing secrets_emhass.yaml. ```bash docker build -t emhass/test . # pass the secrets_emhass.yaml docker run -it -p 5000:5000 --name emhass-test -v ./secrets_emhass.yaml:/app/secrets_emhass.yaml emhass/test ``` -------------------------------- ### Define Machine Learning Runtime Parameters Source: https://github.com/davidusb-geek/emhass/blob/master/docs/mlregressor.md Example dictionary structure for defining regressor model prediction parameters. ```python runtimeparams = { "mlr_predict_entity_id": "sensor.mlr_predict", "mlr_predict_unit_of_measurement": None, "mlr_predict_friendly_name": "mlr predictor", "new_values": [8.2, 7.23, 2, 6], "model_type": "heating_hours_degreeday" } ``` -------------------------------- ### Configure Home Assistant File Notification Source: https://github.com/davidusb-geek/emhass/blob/master/docs/mlregressor.md Setup a file notification platform to store sensor data in a CSV file. ```yaml notify: - platform: file name: heating_hours_prediction timestamp: false filename: /share/heating_prediction.csv ``` -------------------------------- ### Predict with MLForecaster (specific model type) Source: https://github.com/davidusb-geek/emhass/blob/master/docs/mlforecaster.md When needed, pass the correct `model_type` to the `forecast-model-predict` endpoint. This example specifies `long_train_data`. ```bash curl -i -H "Content-Type:application/json" -X POST -d '{"model_type": "long_train_data"}' http://localhost:5000/action/forecast-model-predict ``` -------------------------------- ### Perfect Optimization (7-day backtest) using Legacy CLI Source: https://github.com/davidusb-geek/emhass/blob/master/docs/study_cases/legacy_cli.md Execute a perfect optimization for a 7-day historical backtest using the legacy EMHASS CLI. Requires specifying the configuration file and cost function. ```bash emhass --action 'perfect-optim' \ --config '/home/user/emhass/config_emhass.json' \ --costfun 'profit' ``` -------------------------------- ### Build Docker Image with Add-on Build Argument Source: https://github.com/davidusb-geek/emhass/blob/master/docs/develop.md Builds the Docker image, passing a build argument for add-on local development. ```bash docker build -t emhass/test --build-arg build_version=addon-local . ``` -------------------------------- ### Override adjusted_pv_model_max_age at Runtime Source: https://github.com/davidusb-geek/emhass/blob/master/docs/forecasts.md This example shows how to override the adjusted_pv_model_max_age parameter at runtime using a curl command to adjust PV forecasts. ```bash curl -i -H "Content-Type: application/json" -X POST -d '{ "adjusted_pv_model_max_age": 6, "pv_power_forecast": [0, 0, 50, 150, ...] }' http://localhost:5000/action/naive-mpc-optim ``` -------------------------------- ### Naive MPC Optimization with Basic Parameters Source: https://github.com/davidusb-geek/emhass/blob/master/docs/advanced_math_model.md Performs a naive MPC optimization using basic parameters. Ensure the emhass server is running and accessible at the specified URL. ```bash curl -i -H 'Content-Type:application/json' -X POST -d '{"pv_power_forecast":[0, 70, 141.22, 246.18, 513.5, 753.27, 1049.89, 1797.93, 1697.3, 3078.93], "prediction_horizon":10, "soc_init":0.5,"soc_final":0.6}' http://192.168.3.159:5000/action/naive-mpc-optim ``` -------------------------------- ### Dockerfile for CPLEX Solver Source: https://github.com/davidusb-geek/emhass/blob/master/docs/advanced_solvers.md Extends the base EMHASS image and installs the CPLEX Python interface. Sets the LP_SOLVER environment variable to CPLEX. ```dockerfile FROM davidusb-geek/emhass:latest # Install the CPLEX Python interface RUN uv pip install cplex # Set the solver environment variable ENV LP_SOLVER=CPLEX ``` -------------------------------- ### Continual Publish with Multiple Optimizations Source: https://github.com/davidusb-geek/emhass/blob/master/docs/publish_data.md Run dayahead and naive-MPC optimizations with specified time steps and prefixes for continual publishing. The loop interval is determined by the lowest optimization_time_step. ```bash # RUN dayahead, with optimization_time_step=30 (default), prefix=dh_ curl -i -H 'Content-Type:application/json' -X POST -d '{"publish_prefix":"dh_"}' http://localhost:5000/action/dayahead-optim # RUN MPC, with optimization_time_step=5, prefix=mpc_ curl -i -H 'Content-Type:application/json' -X POST -d '{'optimization_time_step':5,"publish_prefix":"mpc_"}' http://localhost:5000/action/naive-mpc-optim ``` -------------------------------- ### Configure Thermal Battery in emhass Source: https://github.com/davidusb-geek/emhass/blob/master/docs/study_cases/heat_pump_walkthrough.md Add thermal battery configuration to your emhass setup. This snippet shows the parameters for a modern home with underfloor heating. ```python { "def_load_config": [ {}, { "thermal_battery": { "supply_temperature": 35.0, "volume": 20.0, "start_temperature": 22.0, "min_temperatures": [20.0] * 48, "max_temperatures": [26.0] * 48, "carnot_efficiency": 0.45, "u_value": 0.35, "envelope_area": 280.0, "ventilation_rate": 0.4, "heated_volume": 320.0, "thermal_inertia_time_constant": 2.0 } } ] } ``` -------------------------------- ### Run Daahead Optimization with PV Forecast Caching Source: https://github.com/davidusb-geek/emhass/blob/master/docs/forecasts.md Run a day-ahead optimization and store the retrieved Solcast data to cache using the 'weather_forecast_cache' runtime parameter. ```bash # Example of running day-ahead and optimization storing the retrieved Solcast data to cache curl -i -H 'Content-Type:application/json' -X POST -d '{ "weather_forecast_cache":true }' http://localhost:5000/action/dayahead-optim ``` -------------------------------- ### Build Sphinx Documentation Source: https://github.com/davidusb-geek/emhass/blob/master/AGENTS.md Build the HTML version of the documentation using Sphinx. The build process is configured in `docs/conf.py`. ```bash sphinx-build -b html docs docs/_build ``` -------------------------------- ### Heat-Pump Focused Configuration with PV Source: https://github.com/davidusb-geek/emhass/blob/master/docs/study_cases/reference_configs.md Configuration for a home with PV installed, optimizing a heat pump via its thermal battery, without an electrochemical battery or EV. ```yaml set_use_pv: true solar_forecast_kwp: 10 optimization_time_step: 30 set_use_battery: false nominal_power_of_deferrable_loads: - 0 # heat pump via thermal_battery # def_load_config with thermal_battery — see heat_pump_walkthrough.md ``` -------------------------------- ### Run EMHASS Unit Tests within Docker Container Source: https://github.com/davidusb-geek/emhass/blob/master/docs/develop.md Executes unit tests for EMHASS inside the running Docker container after installing the 'requests-mock' library. ```bash # testing unittest (add extra necessary files via volume mount) docker run --rm -it -p 5000:5000 --name emhass-test -v $(pwd)/tests/:/app/tests/ -v $(pwd)/data/:/data/ -v $(pwd)/"secrets_emhass(example).yaml":/app/"secrets_emhass(example).yaml" -v $(pwd)/options.json:/app/options.json -v $(pwd)/config_emhass.yaml:/app/config_emhass.yaml -v $(pwd)/secrets_emhass.yaml:/app/secrets_emhass.yaml emhass/test ``` ```bash # run unittest's on separate terminal after installing requests-mock docker exec emhass-test apt-get update docker exec emhass-test apt-get install python3-requests-mock -y docker exec emhass-test python3 -m unittest discover -s ./tests -p 'test_*.py' | grep error ``` -------------------------------- ### Publish Data with Multiple Deferrable Loads (JSON Payload) Source: https://github.com/davidusb-geek/emhass/blob/master/docs/thermal_model.md This JSON payload example shows how to configure multiple deferrable loads, including one thermal load, for the publish data command. The structure indicates the position of the thermal load within the list. ```json {"def_load_config": [{},{"thermal_config": {}},{}]} ``` -------------------------------- ### CSV Data Format for Forecasts Source: https://github.com/davidusb-geek/emhass/blob/master/docs/forecasts.md Example format for a CSV file used to provide custom forecast data. The file should not contain a header, and data should be timestamped. ```none 2021-04-29 00:00:00+00:00,287.07 2021-04-29 00:30:00+00:00,274.27 2021-04-29 01:00:00+00:00,243.38 ... ``` -------------------------------- ### Generate distribution archives Source: https://github.com/davidusb-geek/emhass/wiki/Contributing Commands to create distribution archives for the project. ```bash python3 -m build ``` ```bash python3 setup.py build bdist_wheel ```