Closed JohanAlvedal closed 9 months ago
I think it would be easy to integrate this, it's almost the same as the Octopus.
Can you show a snapshot of the above from within HA in the Developer tools, States menu and I'll get it supported?
And you want to use the values from 'today' as your import rates?
Yes exactly and tomorrow if possible. Export sensor is an equivalent but without VAT.
One question, if I don't want to use the function to charge an electric car, can I then uncomment all that apply to the car?
Yes exactly and tomorrow if possible.
Export sensor is an equivalent but without VAT.
One question, if I don't want to use the function to charge an electric car, can I then uncomment all that apply to the car?
Just set num_cars to 0 in apps.yaml and predbat won't do anything with car charging
I've submitted a change to MAIN which should now read this format of data, just point your metric_octopus_import/metric_octopus_export to the sensors and let me know if it works.
I'm not sure how? like this? metric_octopus_import: 're:(sensor.(sensor.nordpool_kwh_se3_sek_3_10_025)' metric_octopus_export: 're:(sensor.nordpool_moms)' or metric_octopus_import:
sensor.nordpool_kwh_se3_sek_3_10_025 metric_octopus_export:
And if there is anything else I need to do?
When I tried both options I get the same thing in the log in HA `s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service base-addon-banner: starting
s6-rc: info: service base-addon-banner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service base-addon-log-level: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service base-addon-log-level successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service init-appdaemon: starting s6-rc: info: service init-appdaemon successfully started s6-rc: info: service appdaemon: starting s6-rc: info: service appdaemon successfully started s6-rc: info: service legacy-services: starting [15:32:52] INFO: Starting AppDaemon... s6-rc: info: service legacy-services successfully started 2024-02-03 15:32:56.740402 WARNING pred_bat: ------------------------------------------------------------ 2024-02-03 15:32:56.740634 WARNING pred_bat: Unexpected error running initialize() for pred_bat 2024-02-03 15:32:56.740762 WARNING pred_bat: ------------------------------------------------------------ 2024-02-03 15:32:56.743692 WARNING pred_bat: Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/appdaemon/app_management.py", line 162, in initialize_app await utils.run_in_executor(self, init) File "/usr/lib/python3.11/site-packages/appdaemon/utils.py", line 304, in run_in_executor response = future.result() ^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/apps/predbat.py", line 11628, in initialize raise e File "/config/apps/predbat.py", line 11623, in initialize self.auto_config() File "/config/apps/predbat.py", line 11487, in auto_config matched, arg_value = self.resolve_arg_re(arg, arg_value, state_keys) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/apps/predbat.py", line 11452, in resolve_arg_re res = re.search(my_re, key) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/init.py", line 176, in search return _compile(pattern, flags).search(string) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/init.py", line 294, in _compile p = _compiler.compile(pattern, flags) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/_compiler.py", line 743, in compile p = _parser.parse(p, flags) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/_parser.py", line 982, in parse p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/_parser.py", line 457, in _parse_sub itemsappend(_parse(source, state, verbose, nested + 1, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/_parser.py", line 867, in _parse raise source.error("missing ), unterminated subpattern", re.error: missing ), unterminated subpattern at position 1
2024-02-03 15:32:56.743963 WARNING pred_bat: ------------------------------------------------------------`
Like this I think
metric_octopus_import:sensor.nordpool_kwh_se3_sek_3_10_025 metric_octopus_export: sensor.nordpool_moms
2024-02-03 17:59:25.788217 WARNING pred_bat: pred_bat: Entity select.predbat_manual_charge not found in namespace default 2024-02-03 17:59:25.788836 INFO AppDaemon: pred_bat: Entity select.predbat_manual_charge created in namespace: default 2024-02-03 17:59:25.864744 INFO pred_bat: Updating HA config manual_discharge to 2024-02-03 17:59:25.865544 WARNING pred_bat: pred_bat: Entity select.predbat_manual_discharge not found in namespace default 2024-02-03 17:59:25.866106 INFO AppDaemon: pred_bat: Entity select.predbat_manual_discharge created in namespace: default 2024-02-03 17:59:25.928276 INFO pred_bat: Updating HA config manual_idle to 2024-02-03 17:59:25.928830 WARNING pred_bat: pred_bat: Entity select.predbat_manual_idle not found in namespace default 2024-02-03 17:59:25.929223 INFO AppDaemon: pred_bat: Entity select.predbat_manual_idle created in namespace: default 2024-02-03 17:59:25.987995 INFO pred_bat: Updating HA config saverestore to 2024-02-03 17:59:25.988575 WARNING pred_bat: pred_bat: Entity select.predbat_saverestore not found in namespace default 2024-02-03 17:59:25.988899 INFO AppDaemon: pred_bat: Entity select.predbat_saverestore created in namespace: default 2024-02-03 17:59:25.995715 INFO pred_bat: Updating HA config auto_update to False 2024-02-03 17:59:26.009995 INFO pred_bat: Note: Disabled configuration item load_filter_modal 2024-02-03 17:59:26.011326 INFO pred_bat: Updating HA config iboost_enable to False 2024-02-03 17:59:26.018021 INFO pred_bat: Updating HA config iboost_solar to True 2024-02-03 17:59:26.024814 INFO pred_bat: Updating HA config iboost_gas to False 2024-02-03 17:59:26.031629 INFO pred_bat: Updating HA config iboost_charging to False 2024-02-03 17:59:26.037880 INFO pred_bat: Note: Disabled configuration item iboost_gas_scale 2024-02-03 17:59:26.038782 INFO pred_bat: Note: Disabled configuration item iboost_max_energy 2024-02-03 17:59:26.039624 INFO pred_bat: Note: Disabled configuration item iboost_today 2024-02-03 17:59:26.040451 INFO pred_bat: Note: Disabled configuration item iboost_max_power 2024-02-03 17:59:26.042957 INFO pred_bat: Note: Disabled configuration item iboost_min_power 2024-02-03 17:59:26.043823 INFO pred_bat: Note: Disabled configuration item iboost_min_soc 2024-02-03 17:59:26.044944 INFO pred_bat: Updating HA config holiday_days_left to 0.0 2024-02-03 17:59:26.051742 INFO pred_bat: Note: Disabled configuration item forecast_plan_hours 2024-02-03 17:59:26.052718 INFO pred_bat: Note: Disabled configuration item plan_debug 2024-02-03 17:59:26.133846 INFO pred_bat: Inverter Type: GE (GivEnergy) 2024-02-03 17:59:26.134608 INFO pred_bat: Predbat: Next run time will be 2024-02-03 18:00:00 and then every 300 seconds 2024-02-03 17:59:26.136736 INFO pred_bat: Balance inverters will run every 60 seconds (if enabled) 2024-02-03 17:59:41.203043 INFO pred_bat: --------------- PredBat - update at 2024-02-03 17:59:41.201527+01:00 with clock skew 0 minutes, minutes now 1075 2024-02-03 17:59:41.604920 INFO pred_bat: Predbat /config/apps/predbat.py version v7.15.11 currently running, latest version is v7.15.11 latest beta v7.15.11 2024-02-03 17:59:41.605848 INFO pred_bat: Autoupdate: Currently up to date 2024-02-03 17:59:41.627398 INFO pred_bat: Inverter type GE forecast_hours 48 max_windows 96 num_cars 0 debug enable is False calculate_plan_every 10 2024-02-03 17:59:41.630058 INFO pred_bat: Predbat mode is set to Monitor 2024-02-03 17:59:41.803304 INFO pred_bat: Found 11520 load_today datapoints going back 1 days 2024-02-03 17:59:43.155148 INFO pred_bat: Car charging hold True threshold 6.0 2024-02-03 17:59:43.156033 INFO pred_bat: Current data so far today: load 22.11 kWh import 22.11 kWh export 0.0 kWh pv 23.27 kWh 2024-02-03 17:59:43.156912 INFO pred_bat: Fetching futurerate data from None 2024-02-03 17:59:43.158578 INFO pred_bat: WARN: No Octopus data in sensor sensor.nordpool_kwh_se3_sek_3_10_025 attribute 'all_rates' 2024-02-03 17:59:43.159451 INFO pred_bat: Error: metric_octopus_import is not set correctly or no energy rates can be read 2024-02-03 17:59:43.167235 INFO pred_bat: ERROR: Exception raised 2024-02-03 18:00:00.005661 INFO pred_bat: --------------- PredBat - update at 2024-02-03 18:00:00.004771+01:00 with clock skew 0 minutes, minutes now 1080 2024-02-03 18:00:00.006632 INFO pred_bat: Using cached GITHub data for https://api.github.com/repos/springfall2008/batpred/releases age 0.3 minutes 2024-02-03 18:00:00.007586 INFO pred_bat: Predbat /config/apps/predbat.py version v7.15.11 currently running, latest version is v7.15.11 latest beta v7.15.11 2024-02-03 18:00:00.008594 INFO pred_bat: Autoupdate: Currently up to date 2024-02-03 18:00:00.024898 INFO pred_bat: Inverter type GE forecast_hours 48 max_windows 96 num_cars 0 debug enable is False calculate_plan_every 10 2024-02-03 18:00:00.026948 INFO pred_bat: Predbat mode is set to Monitor 2024-02-03 18:00:00.204989 INFO pred_bat: Found 11520 load_today datapoints going back 1 days 2024-02-03 18:00:01.702497 INFO pred_bat: Car charging hold True threshold 6.0 2024-02-03 18:00:01.703405 INFO pred_bat: Current data so far today: load 22.3 kWh import 22.35 kWh export 0.0 kWh pv 23.34 kWh 2024-02-03 18:00:01.704290 INFO pred_bat: Fetching futurerate data from None 2024-02-03 18:00:01.705970 INFO pred_bat: WARN: No Octopus data in sensor sensor.nordpool_kwh_se3_sek_3_10_025 attribute 'all_rates' 2024-02-03 18:00:01.706860 INFO pred_bat: Error: metric_octopus_import is not set correctly or no energy rates can be read 2024-02-03 18:00:01.713997 INFO pred_bat: ERROR: Exception raised
It doesn't look like you updated to the version on 'main'?
ok but how do i do that?
Select the version from the select.predbat_update drop down menu.
This code actually ended up released now also
it works but the price is not 100% correct, for example now at 21:00 the price is 0.02 Sek, but it shows 2.00, but perhaps it should be so?
What should the price be according to the data, is it out by a certain factor?
the price from Nordpool is correct but it is shown in kronor equivalent to pound not pence. 0.02 SEK (1 GBP = 13.36 SEK 133.6 öre (pence). But maybe it should be? it is pence in import and export but in GBP in the far right column.
Yes it’s pence on the left and pounds on the right for the total
the price from Nordpool is correct but it is shown in kronor equivalent to pound not pence. 0.02 SEK (1 GBP = 13.36 SEK 133.6 öre (pence). But maybe it should be? it is pence in import and export but in GBP in the far right column.
Predbat assumes all the prices from the energy sensors are in pence and produces the plan in pence. Just the total column on the right of the plan is pence x 100 ie GBP
Ignoring that the units are wrong for you, is the order of magnitude of everything correct?
I don't think we want predbat to start doing currency conversion but it may be possible to have a "display currency" setting or some Jinja post processing of the html plan to change the currency text strings
Well, that's right, I'm satisfied, very satisfied, thanks for the help so far. Now it will be allowed to run for a few days, then I will work with the settings a bit
Hello This seems like an interesting project. However, I have nordpool (tibber Sweden) as an integration in HA which delivers my electricity prices. Also has a Huawei inverter that communicates using modbus from HA. The question I have is if you can somehow get it in instead of octopus?
It would be nice to have these to work with Nordpool metric_octopus_import: 're:(sensor.(octopusenergy|)electricity[0-9a-z]+[0-9a-z]+_current_rate)' metric_octopus_export: 're:(sensor.(octopusenergy|)electricity[0-9a-z]+[0-9a-z]+_export_current_rate)'
I've already started getting some data into predbat, so it's looking promising.
sensor.nordpool_kwh_se3_sek_3_10_025 shows the current price and have all data current tomorrow and so on as attribute.
`