Jase1703

Predbat yaml 2025 plain text

Oct 16th, 2025
3
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.75 KB | None | 0 0
  1. pred_bat:
  2. module: predbat
  3. class: PredBat
  4.  
  5. # Sets the prefix for all created entities in HA - only change if you want to run more than once instance
  6. prefix: predbat
  7.  
  8.  
  9.  
  10. # Timezone to work in
  11. timezone: Europe/London
  12.  
  13. # Currency, symbol for main currency second symbol for 1/100s e.g. $ c or £ p or e c
  14. currency_symbols:
  15. - '£'
  16. - 'p'
  17.  
  18. # Number of threads to use in plan calculation
  19. # Can be auto for automatic, 0 for off or values 1-N for a fixed number
  20. threads: auto
  21.  
  22. # If you are using Predbat outside of HA then set the HA URL and Key (long lived access token here)
  23. ha_url: 'http://homeassistant.local:8123'
  24. ha_key: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJmOGQzZGJmZjE5YjQ0N2QxOTgwNGFjNTQxMzEwMTBlOSIsImlhdCI6MTc0ODU1Njc4NywiZXhwIjoyMDYzOTE2Nzg3fQ.bX0n2cx1raWrvRBKMLPVJY8xY9KAnLip95oAAY9jfDw'
  25.  
  26. # Set to auto-match with a GivEnergy serial number, but you can override the serial or the sensor names
  27. # if it doesn't work or if you have more than one inverter you will need to list both
  28. # geserial: 'ch2315g286'
  29. geserial2: 'ch2315g286'
  30.  
  31. # Sets the maximum period of zero load before the gap is filled, default 30 minutes
  32. # To disable set it to 1440
  33. load_filter_threshold: 40
  34.  
  35. #
  36. # Sensors, more than one can be specified and they will be summed up automatically
  37. #
  38. # For two inverters the load today would normally be the master load sensor only (to cover the entire house)
  39. # If you have three phase and one inverter per phase then you would need three load sensors
  40. #
  41. # For pv_today if you have multiple solar inverter inputs then you should include one entry for each inverter
  42. #
  43. load_today:
  44. - sensor.givtcp2_{geserial2}_load_energy_today_kwh
  45. import_today:
  46. - sensor.givtcp2_{geserial2}_import_energy_today_kwh
  47. export_today:
  48. - sensor.givtcp2_{geserial2}_export_energy_today_kwh
  49. pv_today:
  50. - sensor.givtcp2_{geserial2}_pv_energy_today_kwh
  51.  
  52. # Load forecast can be used to add to the historical load data (heat-pump)
  53. # To link to Predheat
  54. # Data must be in the format of 'last_updated' timestamp and 'energy' for incrementing kWh
  55. #load_forecast:
  56. # - predheat.heat_energy$external
  57. #
  58. # If you enable ge_cloud_data then the load/import and export data will be fetches from the GE cloud instead of from GivTCP sensors
  59. # this is usually less efficient and of course prone to internet downtime, but could be useful if you lost your GivTCP data
  60. # Set the serial to the inverter serial to pull the data from and the key to your API key
  61. # When this is set load_today, import_today and export_today are not used
  62. #
  63. ge_cloud_data: false
  64. ge_cloud_serial: '{geserial2}'
  65. ge_cloud_key: 'xxxx'
  66. #
  67. # Controls/status - must by 1 per inverter
  68. #
  69. inverter_type:
  70. - "GE"
  71. num_inverters: 1
  72. #
  73. # Run balance inverters every N seconds (0=disabled) - only for multi-inverter
  74. balance_inverters_seconds: 0
  75. #
  76. # When set use the REST API rather than HA entity for control, should be more reliable/faster to control
  77. # Set one per inverter
  78. # If using Docker then change homeassistant.local to the Docker IP address
  79. givtcp_rest:
  80. # - 'http://homeassistant.local:6345'
  81. - 'http://homeassistant.local:6346'
  82.  
  83. # When enabled automatic restart will restart the add-on if communication fails
  84. # Example below is auto-restart for GivTCP add-on itself
  85. # auto_restart:
  86. # - shell: 'rm -rf /homeassistant/GivTCP/*.pkl'
  87. # - service: hassio/addon_restart
  88. # addon: 533ea71a_givtcp
  89.  
  90. # Example on how to restart the inverter via GivTCP
  91. # - service: switch.turn_on
  92. # entity_id: switch.givtcp_{geserial}_reboot_invertor
  93.  
  94. # If not using REST then instead set the Control here (one for each inverter)
  95. # You should keep this section even when using REST as a fallback if it fails and for charge curve calculations
  96. charge_rate:
  97. # - number.givtcp_{geserial}_battery_charge_rate
  98. - number.givtcp2_{geserial2}_battery_charge_rate
  99. discharge_rate:
  100. # - number.givtcp_{geserial}_battery_discharge_rate
  101. - number.givtcp2_{geserial2}_battery_discharge_rate
  102. battery_power:
  103. # - sensor.givtcp_{geserial}_battery_power
  104. - sensor.givtcp2_{geserial2}_battery_power
  105. pv_power:
  106. # - number.givtcp_{geserial}_pv_power
  107. - sensor.givtcp2_{geserial2}_pv_power
  108. load_power:
  109. # - number.givtcp_{geserial}_load_power
  110. - sensor.givtcp2_{geserial2}_load_power
  111. soc_kw:
  112. # - sensor.givtcp_{geserial}_soc_kwh
  113. - sensor.givtcp2_{geserial2}_soc_kwh
  114. soc_max:
  115. # - sensor.givtcp_{geserial}_battery_capacity_kwh
  116. - sensor.givtcp2_{geserial2}_battery_capacity_kwh
  117. reserve:
  118. # - number.givtcp_{geserial}_battery_power_reserve
  119. - number.givtcp2_{geserial2}_battery_power_reserve
  120. inverter_mode:
  121. # - select.givtcp_{geserial}_mode
  122. - select.givtcp2_{geserial2}_mode
  123. inverter_time:
  124. # - sensor.givtcp_{geserial}_invertor_time
  125. - sensor.givtcp2_{geserial2}_invertor_time
  126. charge_start_time:
  127. # - select.givtcp_{geserial}_charge_start_time_slot_1
  128. - select.givtcp2_{geserial2}_charge_start_time_slot_1
  129. charge_end_time:
  130. # - select.givtcp_{geserial}_charge_end_time_slot_1
  131. - select.givtcp2_{geserial2}_charge_end_time_slot_1
  132. charge_limit:
  133. # - number.givtcp_{geserial}_target_soc
  134. - number.givtcp2_{geserial2}_target_soc
  135. scheduled_charge_enable:
  136. # - switch.givtcp_{geserial}_enable_charge_schedule
  137. - switch.givtcp2_{geserial2}_enable_charge_schedule
  138. scheduled_discharge_enable:
  139. # - switch.givtcp_{geserial}_enable_discharge_schedule
  140. - switch.givtcp2_{geserial2}_enable_discharge_schedule
  141. discharge_start_time:
  142. # - select.givtcp_{geserial}_discharge_start_time_slot_1
  143. - select.givtcp2_{geserial2}_discharge_start_time_slot_1
  144. discharge_end_time:
  145. # - select.givtcp_{geserial}_discharge_end_time_slot_1
  146. - select.givtcp2_{geserial2}_discharge_end_time_slot_1
  147.  
  148. # Pause mode is not supported by all firmware's and will be ignored if not present
  149. pause_mode:
  150. #- select.givtcp_{geserial}_battery_pause_mode
  151. - select.givtcp2_{geserial2}_battery_pause_mode
  152.  
  153. # Not all firmwares support pause start/end time, delete these if not supported
  154. # to avoid spurious writes/warnings
  155. pause_start_time:
  156. #- select.givtcp_{geserial}_battery_pause_start_time_slot
  157. - select.givtcp2_{geserial2}_battery_pause_start_time_slot
  158. pause_end_time:
  159. #- select.givtcp_{geserial}_battery_pause_end_time_slot
  160. - select.givtcp2_{geserial2}_battery_pause_end_time_slot
  161.  
  162. # Inverter max AC limit (one per inverter). E.g for a 3.6kw inverter set to 3600
  163. # If you have a second inverter for PV only please add the two values together
  164. inverter_limit:
  165. - 11000
  166.  
  167. # Export limit is a software limit set on your inverter that prevents exporting above a given level
  168. # When enabled Predbat will model this limit
  169. #export_limit:
  170. # - 3600
  171. # - 3600
  172.  
  173. # Some inverters don't turn off when the rate is set to 0, still charge or discharge at around 200w
  174. # The value can be set here in watts to model this (doesn't change operation)
  175. #inverter_battery_rate_min:
  176. # - 200
  177.  
  178. # Workaround to limit the maximum reserve setting, some inverters won't allow 100% to be set
  179. # Comment out if your inverter allows 100%
  180. inverter_reserve_max: 98
  181.  
  182. # Some batteries tail off their charge rate at high soc%
  183. # enter the charging curve here as a % of the max charge rate for each soc percentage.
  184. # the default is 1.0 (full power)
  185. # The example below is from GE 9.5kwh battery with latest firmware and gen1 inverter
  186. #
  187. # Predbat can compute this curve automatically if you have enough data, restart the add-on and look in the logfile for the data
  188. # once set here Predbat will no longer re-compute the curve.
  189. # Can also be set to 'auto' to just use the calculation curve, not recommended if you are using low power charging mode.
  190. battery_charge_power_curve:
  191. 91: 0.91
  192. 92: 0.81
  193. 93: 0.71
  194. 94: 0.62
  195. 95: 0.52
  196. 96: 0.43
  197. 97: 0.33
  198. 98: 0.24
  199. 99: 0.24
  200. 100: 0.24
  201. #battery_discharge_power_curve:
  202. # 4 : 1.0
  203.  
  204. # Inverter clock skew in minutes, e.g. 1 means it's 1 minute fast and -1 is 1 minute slow
  205. # 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)
  206. # Separate discharge skew for discharge windows only
  207. inverter_clock_skew_start: 0
  208. inverter_clock_skew_end: 0
  209. inverter_clock_skew_discharge_start: 0
  210. inverter_clock_skew_discharge_end: 0
  211.  
  212. # Clock skew adjusts the Appdaemon time
  213. # This is the time that Predbat takes actions like starting discharge/charging
  214. # Only use this for workarounds if your inverter time is correct but Predbat is somehow wrong (AppDaemon issue)
  215. # 1 means add 1 minute to AppDaemon time, -1 takes it away
  216. clock_skew: 0
  217.  
  218. # Solcast cloud interface, set this or the local interface below
  219. solcast_host: 'https://api.solcast.com.au/'
  220. solcast_api_key: 'MSITX62sThn3vbYXWDDZ9HG7wkyFKYAL'
  221. solcast_poll_hours: 8
  222.  
  223. # Set these to match solcast sensor names if not using the cloud interface
  224. # The regular expression (re:) makes the solcast bit optional
  225. # If these don't match find your own names in Home Assistant
  226. #pv_forecast_today: re:(sensor.(solcast_|)(pv_forecast_|)forecast_today)
  227. #pv_forecast_tomorrow: re:(sensor.(solcast_|)(pv_forecast_|)forecast_tomorrow)
  228. #pv_forecast_d3: re:(sensor.(solcast_|)(pv_forecast_|)forecast_(day_3|d3))
  229. #pv_forecast_d4: re:(sensor.(solcast_|)(pv_forecast_|)forecast_(day_4|d4))
  230.  
  231. # car_charging_energy defines an incrementing sensor which measures the charge added to your car
  232. # is used for car_charging_hold feature to filter out car charging from the previous load data
  233. # Automatically set to detect Wallbox and Zappi, if it doesn't match manually enter your sensor name
  234. # Also adjust car_charging_energy_scale if it's not in kwH to fix the units
  235. car_charging_energy: 're:(sensor.myenergi_zappi_[0-9a-z]+_charge_added_session|sensor.wallbox_portal_added_energy)'
  236.  
  237. # Defines the number of cars modelled by the system, set to 0 for no car
  238. num_cars: 1
  239.  
  240. # car_charging_planned is set to a sensor which when positive indicates the car will charged in the upcoming low rate slots
  241. # This should not be needed if you use Intelligent Octopus slots which will take priority if enabled
  242. # The list of possible values is in car_charging_planned_response
  243. # Auto matches Zappi and Wallbox, or change it for your own
  244. # One entry per car
  245. car_charging_planned:
  246. - 're:(sensor.wallbox_portal_status_description|sensor.myenergi_zappi_[0-9a-z]+_plug_status)'
  247.  
  248. car_charging_planned_response:
  249. - 'yes'
  250. - 'on'
  251. - 'true'
  252. - 'connected'
  253. - 'ev connected'
  254. - 'charging'
  255. - 'paused'
  256. - 'waiting for car demand'
  257. - 'waiting for ev'
  258. - 'waiting'
  259. - 'scheduled'
  260. - 'stopped'
  261. - 'enabled'
  262. - 'latched'
  263. - 'locked'
  264. - 'plugged in'
  265.  
  266. # In some cases car planning is difficult (e.g. Ohme with Intelligent doesn't report slots)
  267. # The car charging now can be set to a sensor to indicate the car is charging and to plan
  268. # for it to charge during this 30 minute slot
  269. #car_charging_now:
  270. # - off
  271.  
  272. # Positive responses for car_charging_now
  273. car_charging_now_response:
  274. - 'yes'
  275. - 'on'
  276. - 'true'
  277.  
  278. # To make planned car charging more accurate, either using car_charging_planned or the Octopus Energy plugin,
  279. # specify your battery size in kwh, charge limit % and current car battery soc % sensors/values.
  280. # If you have Intelligent Octopus the battery size and limit will be extracted from the Octopus Energy plugin directly.
  281. # Set the car SOC% if you have it to give an accurate forecast of the cars battery levels.
  282. # One entry per car if you have multiple cars.
  283. car_charging_battery_size:
  284. - 100
  285. #car_charging_limit:
  286. # - 're:number.EV_max_charge'
  287. car_charging_soc:
  288. - 're:sensor.polestar_8173_battery_charge_level_2'
  289.  
  290. # If you have Octopus intelligent, enable the intelligent slot information to add to pricing
  291. # Will automatically disable if not found, or comment out to disable fully
  292. # When enabled it overrides the 'car_charging_planned' feature and predict the car charging based on the intelligent plan (unless octopus intelligent charging is False)
  293. # This matches either the intelligent slot from the Octopus Plugin or from the Intelligent plugin
  294. #octopus_intelligent_slot: 're:(binary_sensor.octopus_energy([0-9a-z_]+|)_intelligent_dispatching)'
  295. #octopus_ready_time: 're:(time.octopus_energy([0-9a-z_]+|)_intelligent_ready_time)'
  296. #octopus_charge_limit: 're:(number.octopus_energy([0-9a-z_]+|)_intelligent_charge_limit)'
  297. # Example alternative configuration for Ohme integration release >=v0.6.1
  298. #octopus_intelligent_slot: 'binary_sensor.ohme_slot_active'
  299. #octopus_ready_time: 'time.ohme_target_time'
  300. #octopus_charge_limit: 'number.ohme_target_percent
  301.  
  302. # Carbon Intensity data from National grid
  303. # carbon_intensity: 're:(sensor.carbon_intensity_uk)'
  304.  
  305. # Octopus saving session points to the saving session Sensor in the Octopus plugin, when enabled saving sessions will be at the assumed
  306. # Rate is read automatically from the add-in and converted to pence using the conversion rate below (default is 8)
  307. octopus_saving_session: 're:(binary_sensor.octopus_energy([0-9a-z_]+|)_saving_session(s|))'
  308. octopus_saving_session_octopoints_per_penny: 8
  309.  
  310. # Energy rates
  311. # Please set one of these three, if multiple are set then Octopus is used first, second rates_import/rates_export and latest basic metric
  312.  
  313. # Set import and export entity to point to the Octopus Energy plugin import and export sensors
  314. # automatically matches your meter number assuming you have only one (no need to edit the below)
  315. # Will be ignored if you don't have the sensor but will error if you do have one and it's incorrect
  316. # NOTE: To get detailed energy rates you need to go in and manually enable the following events in HA
  317. # event.octopus_energy_electricity_xxxxxxxx_previous_day_rates
  318. # event.octopus_energy_electricity_xxxxxxxx_current_day_rates
  319. # event.octopus_energy_electricity_xxxxxxxx_next_day_rates
  320. # and if you have export enable:
  321. # event.octopus_energy_electricity_xxxxxxxx_export_previous_day_rates
  322. # event.octopus_energy_electricity_xxxxxxxx_export_current_day_rates
  323. # event.octopus_energy_electricity_xxxxxxxx_export_next_day_rates
  324. # Predbat will automatically find the event. entities from the link below to the sensors
  325. metric_octopus_import: 're:(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_current_rate)'
  326. metric_octopus_export: 're:(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_export_current_rate)'
  327.  
  328. # Standing charge in pounds, can be set to a sensor or manually entered (e.g. 0.50 is 50p)
  329. # The default below will pick up the standing charge from the Octopus Plugin
  330. # The standing charge only impacts the cost graphs and doesn't change the way Predbat plans
  331. # If you don't want to show the standing charge then just delete this line or set to zero
  332. metric_standing_charge: 're:(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_current_standing_charge)'
  333.  
  334. # Or set your actual rates across time for import and export
  335. # If start/end is missing it's assumed to be a fixed rate
  336. # Gaps are filled with zero rate
  337. #rates_import:
  338. # - start: "00:30:00"
  339. # end: "04:30:00"
  340. # rate: 7.5
  341. # - start: "04:30:00"
  342. # end: "00:30:00"
  343. # rate: 40.0
  344. #
  345. #rates_export:
  346. # - rate: 4.2
  347.  
  348. # Can be used instead of the plugin to get import rates directly online
  349. # Overrides metric_octopus_import and rates_import
  350. # 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"
  351. # 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"
  352.  
  353. # Overrides metric_octopus_export and rates_export
  354. # 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"
  355. # 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/"
  356. # 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/"
  357.  
  358. # Import rates can be overridden with rate_import_override
  359. # Export rates can be overridden with rate_export_override
  360. # 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)
  361. # This will override even the Octopus plugin rates if enabled
  362. #
  363. rates_import_override:
  364. - date: '2025-10-05'
  365. start: '11:00:00'
  366. end: '11:30:00'
  367. rate: 0
  368. load_scaling: 1
  369. - date: '2025-10-04'
  370. start: '13:00:00'
  371. end: '13:30:00'
  372. rate: 0
  373. load_scaling: 1
  374.  
  375. #For DFS sessions
  376. rates_export_override:
  377. - date: '2025-06-30'
  378. start: '18:00:00'
  379. end: '19:00:00'
  380. rate_increment: 12
  381.  
  382. # For pv estimate, leave blank for central estimate, or add 10 for 10% curve (worst case) or 90 or 90% curve (best case)
  383. # If you use 10 then disable pv_metric10_weight below
  384. # pv_estimate: 10
  385.  
  386. # Days previous is the number of days back to find historical load data
  387. # Recommended is 7 to capture day of the week but 1 can also be used
  388. # if you have more history you could use 7 and 14 (in a list) but the standard data in HA only lasts 10 days
  389. days_previous:
  390. - 2
  391. - 3
  392.  
  393.  
  394.  
  395. # Days previous weight can be used to control the weighting of the previous load points, the values are multiplied by their
  396. # 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
  397. # Include one value for each days_previous value, each weighting on a separate line.
  398. # If any days_previous's that are not given a weighting they will assume a default weighting of 1.
  399. days_previous_weight:
  400. - 1
  401.  
  402. # Number of hours forward to forecast, best left as-is unless you have specific reason
  403. forecast_hours: 48
  404.  
  405. # Specify the devices that notifies are sent to, the default is 'notify' which goes to all
  406. #notify_devices:
  407. # - mobile_app_treforsiphone12_2
  408.  
  409. # Battery scaling makes the battery smaller (e.g. 0.9) or bigger than its reported
  410. # If you have an 80% DoD battery that falsely reports it's kwh then set it to 0.8 to report the real figures
  411. # One per inverter
  412. battery_scaling:
  413. - 0.846
  414.  
  415. # Can be used to scale import and export data, used for workarounds
  416. import_export_scaling: 1.0
  417.  
  418. # Export triggers:
  419. # For each trigger give a name, the minutes of export needed and the energy required in that time
  420. # Multiple triggers can be set at once so in total you could use too much energy if all run
  421. # Creates an entity called 'binary_sensor.predbat_export_trigger_<name>' which will be turned On when the condition is valid
  422. # connect this to your automation to start whatever you want to trigger
  423. export_triggers:
  424. - name: 'large'
  425. minutes: 60
  426. energy: 1.0
  427. - name: 'small'
  428. minutes: 15
  429. energy: 0.25
  430.  
  431. # If you have a sensor that gives the energy consumed by your solar diverter then add it here
  432. # this will make the predictions more accurate. It should be an incrementing sensor, it can reset at midnight or not
  433. # It's assumed to be in Kwh but scaling can be applied if need be
  434. #iboost_energy_today: 'sensor.xxxxx'
  435. #iboost_energy_scaling: 1.0
  436. # Gas rates for comparison
  437. #metric_octopus_gas: 're:(sensor.(octopus_energy_|)gas_[0-9a-z]+_[0-9a-z]+_current_rate)'
  438.  
  439. # Nordpool market energy rates
  440. futurerate_url: 'https://dataportal-api.nordpoolgroup.com/api/DayAheadPrices?date=DATE&market=N2EX_DayAhead&deliveryArea=UK&currency=GBP'
  441. futurerate_adjust_import: true
  442. futurerate_adjust_export: false
  443. futurerate_peak_start: "16:00:00"
  444. futurerate_peak_end: "19:00:00"
  445. #futurerate_peak_premium_import: 14
  446. #futurerate_peak_premium_export: 6.5
  447.  
  448. # Watch list, a list of sensors to watch for changes and then update the plan if they change
  449. # This is useful for things like the Octopus Intelligent Slot sensor so that the plan update as soon as you plugin in
  450. # Only uncomment the items you actually have set up above in apps.yaml, of course you can add your own as well
  451. # Note those using +[] are lists that are appended to this list, whereas {} items are single items only
  452. #watch_list:
  453. # - '{octopus_intelligent_slot}'
  454. # - '{octopus_ready_time}'
  455. # - '{octopus_charge_limit}'
  456. # - '{octopus_saving_session}'
  457. # - '+[car_charging_planned]'
  458. # - '+[car_charging_soc]'
  459. # - '{car_charging_now}'
Add Comment
Please, Sign In to add comment