Open springfall2008 opened 5 months ago
Welcome :)
I've not tried powerwall before so its hard to comment on specifics but many other systems do work with Predbat:
charge_start_hour:
"{{ expand('array', state_attr('sensor.octopus_agile_sequence_table', 'import_array')) | map(attribute='timefrom') | list }}" You can't do this, predbat YAML is not HA yaml. You need to create the helper in HA and then reference it here just as an entity name.
sensor.octopus_agile_sequence_table
What is this?
The charge_start_hour if you set this is meant to be the control of the inverters charging start time (needs to be writable)
So this is the start time found from a node red function I have that extracts the time from octopus for best charging slot. In the array you get a start and end time.
Can predbat read directly from octopus agile and read the charging times ?
Can predbat read directly from octopus agile and read the charging times ?
Yes predbat uses the octopus integration and directly gets the car charging times from the intégration if you're on octopus intelligent go
Hi there,
I am octopus agile not intelligent go.
I removed the yaml you mentioned but am now getting the following error:
2024-03-30 22:06:14.607098 INFO pred_bat: ERROR: Exception raised 2024-03-30 22:06:14.594075 INFO pred_bat: ERROR: Inverter 0 unable to read charge window time as neither REST, charge_start_time or charge_start_hour are set 2024-03-30 22:06:14.592610 INFO pred_bat: Inverter 0 SOC: 0.0 kW 0 % Current charge rate 2600.0 w Current discharge rate 2600.0 w Current power 0.0 w Current voltage 52.0 2024-03-30 22:06:14.591166 INFO pred_bat: Inverter 0 with soc_max 10.0 kWh nominal_capacity 10.0 kWh battery rate raw 2600.0 w charge rate 2.6 kW discharge rate 2.6 kW battery_rate_min 0.0 w ac limit 3.6 kW export limit 3.6 kW reserve 4.0 % current_reserve 4.0 % 2024-03-30 22:06:14.589131 INFO pred_bat: Reserve min: 4.0% Battery_min:4.0% 2024-03-30 22:06:14.587154 INFO pred_bat: Inverter 0: Type GE GivEnergy) 2024-03-30 22:06:14.556466 INFO pred_bat: Today's load divergence 100.0 % in-day adjustment 100.0 % damping 0.95x, Predicted so far 0 kWh with 0.0 kWh car excluded and 0.0 kWh import ignored and 0 forecast extra, Actual so far 0 kWh with 0.0 kWh car excluded and 0.0 kWh import ignored 2024-03-30 22:06:14.540668 INFO pred_bat: Historical days now [7] weight [1] 2024-03-30 22:06:14.404139 INFO pred_bat: WARN: Historical day 7 has no data, unable to fill gaps normally using nominal 24kWh - you should fix your system! 2024-03-30 22:06:14.400840 INFO pred_bat: Historical data totals for days [7] are [0] - min 0 2024-03-30 22:06:14.377353 INFO pred_bat: PV Data for pv_forecast_d4 total 10.23 kWh 2024-03-30 22:06:14.370412 INFO pred_bat: PV Data for pv_forecast_d3 total 13.42 kWh 2024-03-30 22:06:14.362951 INFO pred_bat: PV Data for pv_forecast_tomorrow total 12.68 kWh 2024-03-30 22:06:14.356588 INFO pred_bat: PV Data for pv_forecast_today total 20.57 kWh 2024-03-30 22:06:14.350770 INFO pred_bat: Todays energy import 10.1 kWh export 2.56 kWh cost 167.77 p import 184.9 p export -17.14 p 2024-03-30 22:06:14.296842 INFO pred_bat: Low Import rate found rates in range 8.9 to 31.12 2024-03-30 22:06:14.286845 INFO pred_bat: High export rate found rates in range 5.37 to 16.14 2024-03-30 22:06:14.276165 INFO pred_bat: Rate thresholds (for charge/discharge) are import 31.24p (0.0) export 5.23p (0.0) 2024-03-30 22:06:14.273974 INFO pred_bat: Export rates min 4.73 max 16.14 average 7.79 2024-03-30 22:06:14.264916 INFO pred_bat: Import rates min 8.9 max 31.74 average 15.6 2024-03-30 22:06:14.262803 INFO pred_bat: Rate min forward looking: now 8.9 at end of forecast 8.9 2024-03-30 22:06:13.963073 INFO pred_bat: Standing charge is set to 47.9535 p 2024-03-30 22:06:13.906930 INFO pred_bat: Fetching futurerate data from None 2024-03-30 22:06:13.904765 INFO pred_bat: Current data so far today: load 0 kWh import 10.1 kWh export 2.56 kWh pv 0.0 kWh 2024-03-30 22:06:13.902596 INFO pred_bat: Car charging hold True threshold 6.0 2024-03-30 22:06:13.700696 INFO pred_bat: Found 11520 load_today datapoints going back 7 days 2024-03-30 22:06:12.972217 INFO pred_bat: Predbat mode is set to Monitor 2024-03-30 22:06:12.970378 INFO pred_bat: Configuration: forecast_hours 24 max_windows 48 num_cars 0 debug enable is False calculate_plan_every 10 calculate_fast_plan False 2024-03-30 22:06:12.953371 INFO pred_bat: Autoupdate: Currently up to date 2024-03-30 22:06:12.952083 INFO pred_bat: Predbat /config/apps/predbat.py version v7.16.10 currently running, latest version is v7.16.10 latest beta v7.16.10 2024-03-30 22:06:12.417857 INFO pred_bat: --------------- PredBat - update at 2024-03-30 22:06:12.413800+00:00 with clock skew 0 minutes, minutes now 1325 2024-03-30 22:05:57.339803 INFO AppDaemon: App initialization complete 2024-03-30 22:05:57.337361 INFO pred_bat: Balance inverters will run every 60 seconds (if enabled) 2024-03-30 22:05:57.332435 INFO pred_bat: Predbat: Next run time will be 2024-03-30 22:10:00 and then every 300 seconds 2024-03-30 22:05:57.330376 INFO pred_bat: Watch list [] 2024-03-30 22:05:57.229806 INFO pred_bat: Note: Disabled configuration item plan_debug 2024-03-30 22:05:57.228133 INFO pred_bat: Note: Disabled configuration item forecast_plan_hours
Config below:
# ------------------------------------------------------------------
# This is an example configuration, please modify it
# ------------------------------------------------------------------
---
pred_bat:
module: predbat
class: PredBat
# Sets the prefix for all created entities in HA - only change if you want to run more than once instance
prefix: predbat
# Timezone to work in
timezone: Europe/London
# Currency, symbol for main currency second symbol for 1/100s e.g. $ c or £ p or e c
currency_symbols:
- "£"
- "p"
# Number of threads to use in plan calculation
# Can be auto for automatic, 0 for off or values 1-N for a fixed number
threads: auto
# XXX: This is a configuration template, delete this line once you edit your configuration
#template: True
# Sets the maximum period of zero load before the gap is filled, default 30 minutes
# To disable set it to 1440
load_filter_threshold: 30
#
# Sensors, more than one can be specified and they will be summed up automatically
#
# For two inverters the load today would normally be the master load sensor only (to cover the entire house)
# If you have three phase and one inverter per phase then you would need three load sensors
#
# For pv_today if you have multiple solar inverter inputs then you should include one entry for each inverter
#
load_today:
- sensor.my_home_load_power
import_today:
- sensor.my_home_site_import
export_today:
- sensor.my_home_site_export
pv_today:
- sensor.my_home_solar_import
# Load forecast can be used to add to the historical load data (heat-pump)
# To link to Predheat
# Data must be in the format of 'last_updated' timestamp and 'energy' for incrementing kWh
#load_forecast:
# - predheat.heat_energy$external
#
#
# Controls/status - must by 1 per inverter
#
num_inverters: 1
#
# Run balance inverters every N seconds (0=disabled) - only for multi-inverter
balance_inverters_seconds: 60
# When enabled automatic restart will restart the add-on if communication fails
# Example below is auto-restart for GivTCP add-on itself
#auto_restart:
# - shell: 'rm -rf /homeassistant/GivTCP/*.pkl'
# - service: hassio/addon_restart
# addon: a6a2857d_givtcp
# Example on how to restart the inverter via GivTCP
# - service: switch.turn_on
# entity_id: switch.givtcp_{geserial}_reboot_invertor
# Inverter max AC limit (one per inverter). E.g for a 3.6kw inverter set to 3600
# If you have a second inverter for PV only please add the two values together
inverter_limit:
- 3600
- 3600
# Export limit is a software limit set on your inverter that prevents exporting above a given level
# When enabled Predbat will model this limit
#export_limit:
# - 3600
# - 3600
# Some inverters don't turn off when the rate is set to 0, still charge or discharge at around 200w
# The value can be set here in watts to model this (doesn't change operation)
#inverter_battery_rate_min:
# - 200
# Workaround to limit the maximum reserve setting, some inverters won't allow 100% to be set
# Comment out if your inverter allows 100%
#inverter_reserve_max : 98
# Some batteries tail off their charge rate at high soc%
# enter the charging curve here as a % of the max charge rate for each soc percentage.
# the default is 1.0 (full power)
# The example below is from GE 9.5kwh battery with latest firmware and gen1 inverter
#
# Predbat can compute this curve automatically if you have enough data, restart the add-on and look in the logfile for the data
# once set here Predbat will no longer re-compute the curve.
# Can also be set to 'auto' to just use the calculation curve, not recommended if you are using low power charging mode.
#battery_charge_power_curve:
# 91 : 0.91
# 92 : 0.81
# 93 : 0.71
# 94 : 0.62
# 95 : 0.52
# 96 : 0.43
# 97 : 0.33
# 98 : 0.24
# 99 : 0.24
# 100 : 0.24
#battery_discharge_power_curve:
# 4 : 1.0
# Inverter clock skew in minutes, e.g. 1 means it's 1 minute fast and -1 is 1 minute slow
# Separate start and end options are applied to the start and end time windows, mostly as you want to start late (not early) and finish early (not late)
# Separate discharge skew for discharge windows only
inverter_clock_skew_start: 0
inverter_clock_skew_end: 0
inverter_clock_skew_discharge_start: 0
inverter_clock_skew_discharge_end: 0
# Clock skew adjusts the Appdaemon time
# This is the time that Predbat takes actions like starting discharge/charging
# Only use this for workarounds if your inverter time is correct but Predbat is somehow wrong (AppDaemon issue)
# 1 means add 1 minute to AppDaemon time, -1 takes it away
clock_skew: 0
# Set these to match solcast sensor names
# The regular expression (re:) makes the solcast bit optional
# If these don't match find your own names in Home Assistant
pv_forecast_today: re:(sensor.(solcast_|)(pv_forecast_|)forecast_today)
pv_forecast_tomorrow: re:(sensor.(solcast_|)(pv_forecast_|)forecast_tomorrow)
pv_forecast_d3: re:(sensor.(solcast_|)(pv_forecast_|)forecast_(day_3|d3))
pv_forecast_d4: re:(sensor.(solcast_|)(pv_forecast_|)forecast_(day_4|d4))
# Defines the number of cars modelled by the system, set to 0 for no car
num_cars: 0
# Octopus saving session points to the saving session Sensor in the Octopus plugin, when enabled saving sessions will be at the assumed
# Rate is read automatically from the add-in and converted to pence using the conversion rate below (default is 8)
octopus_saving_session: "re:(binary_sensor.octopus_energy([0-9a-z_]+|)_saving_session(s|))"
octopus_saving_session_octopoints_per_penny: 8
# Energy rates
# Please set one of these three, if multiple are set then Octopus is used first, second rates_import/rates_export and latest basic metric
# Set import and export entity to point to the Octopus Energy plugin import and export sensors
# automatically matches your meter number assuming you have only one (no need to edit the below)
# Will be ignored if you don't have the sensor but will error if you do have one and it's incorrect
# NOTE: To get detailed energy rates you need to go in and manually enable the following events in HA
# event.octopus_energy_electricity_xxxxxxxx_previous_day_rates
# event.octopus_energy_electricity_xxxxxxxx_current_day_rates
# event.octopus_energy_electricity_xxxxxxxx_next_day_rates
# and if you have export enable:
# event.octopus_energy_electricity_xxxxxxxx_export_previous_day_rates
# event.octopus_energy_electricity_xxxxxxxx_export_current_day_rates
# event.octopus_energy_electricity_xxxxxxxx_export_next_day_rates
# Predbat will automatically find the event. entities from the link below to the sensors
metric_octopus_import: "re:(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_current_rate)"
metric_octopus_export: "re:(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_export_current_rate)"
# Standing charge in pounds, can be set to a sensor or manually entered (e.g. 0.50 is 50p)
# The default below will pick up the standing charge from the Octopus Plugin
# The standing charge only impacts the cost graphs and doesn't change the way Predbat plans
# If you don't want to show the standing charge then just delete this line or set to zero
metric_standing_charge: "re:(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_current_standing_charge)"
# Can be used instead of the plugin to get import rates directly online
# Overrides metric_octopus_import and rates_import
# rates_import_octopus_url : "https://api.octopus.energy/v1/products/FLUX-IMPORT-23-02-14/electricity-tariffs/E-1R-FLUX-IMPORT-23-02-14-A/standard-unit-rates"
# rates_import_octopus_url : "https://api.octopus.energy/v1/products/AGILE-FLEX-BB-23-02-08/electricity-tariffs/E-1R-AGILE-FLEX-BB-23-02-08-A/standard-unit-rates"
# Overrides metric_octopus_export and rates_export
# rates_export_octopus_url: "https://api.octopus.energy/v1/products/FLUX-EXPORT-BB-23-02-14/electricity-tariffs/E-1R-FLUX-EXPORT-BB-23-02-14-A/standard-unit-rates"
# rates_export_octopus_url: "https://api.octopus.energy/v1/products/AGILE-OUTGOING-BB-23-02-28/electricity-tariffs/E-1R-AGILE-OUTGOING-BB-23-02-28-A/standard-unit-rates/"
# rates_export_octopus_url: "https://api.octopus.energy/v1/products/OUTGOING-FIX-12M-BB-23-02-09/electricity-tariffs/E-1R-OUTGOING-FIX-12M-BB-23-02-09-A/standard-unit-rates/"
# Import rates can be overridden with rate_import_override
# Export rates can be overridden with rate_export_override
# Use the same format as above, but a date can be included if it just applies for a set day (e.g. Octopus power ups)
# This will override even the Octopus plugin rates if enabled
#
#rates_import_override:
# - date: '2023-09-10'
# start: '14:00:00'
# end: '14:30:00'
# rate: 112
# load_scaling: 0.8
# For pv estimate, leave blank for central estimate, or add 10 for 10% curve (worst case) or 90 or 90% curve (best case)
# If you use 10 then disable pv_metric10_weight below
# pv_estimate: 10
# Days previous is the number of days back to find historical load data
# Recommended is 7 to capture day of the week but 1 can also be used
# if you have more history you could use 7 and 14 (in a list) but the standard data in HA only lasts 10 days
days_previous:
- 7
# Days previous weight can be used to control the weighting of the previous load points, the values are multiplied by their
# weights and then divided through by the total weight. E.g. if you used 1 and 0.5 then the first value would have 2/3rd of the weight and the second 1/3rd
# Include one value for each days_previous value, each weighting on a separate line.
# If any days_previous's that are not given a weighting they will assume a default weighting of 1.
days_previous_weight:
- 1
# Number of hours forward to forecast, best left as-is unless you have specific reason
forecast_hours: 24
# Specify the devices that notifies are sent to, the default is 'notify' which goes to all
#notify_devices:
# - mobile_app_treforsiphone12_2
# Battery scaling makes the battery smaller (e.g. 0.9) or bigger than its reported
# If you have an 80% DoD battery that falsely reports it's kwh then set it to 0.8 to report the real figures
# One per inverter
battery_scaling:
- 1.0
# Can be used to scale import and export data, used for workarounds
import_export_scaling: 1.0
# Export triggers:
# For each trigger give a name, the minutes of export needed and the energy required in that time
# Multiple triggers can be set at once so in total you could use too much energy if all run
# Creates an entity called 'binary_sensor.predbat_export_trigger_<name>' which will be turned On when the condition is valid
# connect this to your automation to start whatever you want to trigger
export_triggers:
- name: "large"
minutes: 60
energy: 1.0
- name: "small"
minutes: 15
energy: 0.25
# If you have a sensor that gives the energy consumed by your solar diverter then add it here
# this will make the predictions more accurate. It should be an incrementing sensor, it can reset at midnight or not
# It's assumed to be in Kwh but scaling can be applied if need be
#iboost_energy_today: 'sensor.xxxxx'
#iboost_energy_scaling: 1.0
# Gas rates for comparison
#metric_octopus_gas: 're:(sensor.(octopus_energy_|)gas_[0-9a-z]+_[0-9a-z]+_current_rate)'
# Nordpool market energy rates
#futurerate_url: 'https://www.nordpoolgroup.com/api/marketdata/page/325?currency=GBP'
#futurerate_adjust_import: True
#futurerate_adjust_export: False
#futurerate_peak_start: "16:00:00"
#futurerate_peak_end: "19:00:00"
#futurerate_peak_premium_import: 14
#futurerate_peak_premium_export: 6.5
# Watch list, a list of sensors to watch for changes and then update the plan if they change
# This is useful for things like the Octopus Intelligent Slot sensor so that the plan update as soon as you plugin in
# Only uncomment the items you actually have set up above in apps.yaml, of course you can add your own as well
# Note those using +[] are lists that are appended to this list, whereas {} items are single items only
#watch_list:
# - '{octopus_intelligent_slot}'
# - '{octopus_ready_time}'
# - '{octopus_charge_limit}'
# - '{octopus_saving_session}'
# - '+[car_charging_planned]'
# - '+[car_charging_soc]'
# - '{car_charging_now}'
inverter_type: MINE
inverter:
name: "Telsa Powerwall2"
has_rest_api: False
has_mqtt_api: False
has_service_api: True
output_charge_control: "power"
has_charge_enable_time: False
has_discharge_enable_time: False
has_target_soc: False
has_reserve_soc: False
charge_time_format: "S"
charge_time_entity_is_option: False
soc_units: "%"
num_load_entities: 1
has_ge_inverter_mode: False
time_button_press: False
clock_time_format: "%Y-%m-%d %H:%M:%S"
write_and_poll_sleep: 2
has_time_window: False
support_charge_freeze: False
support_discharge_freeze": False
# Services to control charging/discharging
charge_start_service:
service: number.set_value
data:
value: "100"
target:
entity_id: number.2_belcombe_close_backup_reserve
option: "Charge from Solar Power and Grid"
charge_stop_service:
service: number.set_value
data:
value: "16"
target:
entity_id: number.2_belcombe_close_backup_reserve
option: "Charge from Solar Power"
#discharge_start_service:
# service: select.select_option
# entity_id: "select.solaredge_i1_storage_command_mode"
# option: "Maximize Self Consumption"
Just wondered if anyone had any ideas ?
Discussed in https://github.com/springfall2008/batpred/discussions/887