stevebuk1 / pv_opt

Home Assistant PV Optimisation for Solis Inverters
MIT License
0 stars 0 forks source link

Beta-12 not writing to inverter? #11

Open mergwyn opened 3 weeks ago

mergwyn commented 3 weeks ago

Describe the bug I installed beta-12 yesterday but the battery did not charge overnight. The charge plan looked OK but I suspect nothing was written to the inverter. I've included the logs which cover the last 1/2 hour slot before the end of the IOG cheap rate. With the log settings I currently have my earliest log I have is during the 03:20 run. Let me know if I can provide any more information.

I've upgraded to Beta-14 but I don't see anything in the changes between 12 and 14 which should change this behaviour.

Versions HA 2024.11.0b1 Solax: 2024.11.1 pv_opt: 3.17.0-Beta-12

It looks like there is an error just before the write:

07:30:51 05-Nov WARNING pv_opt: ------------------------------------------------------------
07:30:51 05-Nov WARNING pv_opt: Unexpected error in worker for App pv_opt:
07:30:51 05-Nov WARNING pv_opt: Worker Ags: {'id': '0717f182715a44d9a2be3011cc542447', 'name': 'pv_opt', 'objectid': '27ee4765068c40a69438b05d38b2e61b', 'type': 'scheduler', 'function': <bound method PVOpt.optimise_time of <pv_opt.PVOpt object at 0x7db60c1c70a0>>, 'pin_app': True, 'pin_thread': 1, 'kwargs': {'interval': 600, '__thread_id': 'thread-1'}}
07:30:51 05-Nov WARNING pv_opt: ------------------------------------------------------------
07:30:51 05-Nov WARNING pv_opt: Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/appdaemon/threading.py", line 1022, in worker
    funcref(self.AD.sched.sanitize_timer_kwargs(app, args["kwargs"]))
  File "/usr/local/lib/python3.10/site-packages/appdaemon/adbase.py", line 35, in f_app_lock
    return f(*args, **kw)
  File "/home-assistant/appdaemon/apps/pv_opt/pv_opt.py", line 2083, in optimise_time
    self.optimise()
  File "/usr/local/lib/python3.10/site-packages/appdaemon/adbase.py", line 35, in f_app_lock
    return f(*args, **kw)
  File "/home-assistant/appdaemon/apps/pv_opt/pv_opt.py", line 2642, in optimise
    self.inverter.control_charge(
  File "/home-assistant/appdaemon/apps/pv_opt/solis.py", line 251, in control_charge
    self._control_charge_discharge("charge", enable, **kwargs)
  File "/home-assistant/appdaemon/apps/pv_opt/solis.py", line 322, in _control_charge_discharge
    self._solis_control_charge_discharge(direction, enable, **kwargs)
  File "/home-assistant/appdaemon/apps/pv_opt/solis.py", line 374, in _solis_control_charge_discharge
    changed, written = self.host.write_and_poll_value(
  File "/home-assistant/appdaemon/apps/pv_opt/pv_opt.py", line 4025, in write_and_poll_value
    str_log += f"New state: {float(new_state):4.1f} Diff: {diff:4.1f} Tol: {tolerance:4.1f}"
TypeError: float() argument must be a string or a real number, not 'NoneType'

Here are the relevant logs: pv_opt.02.log error.log config.yaml.txt

stevebuk1 commented 2 weeks ago

Apologies I've only just seen this.

I'm on Beta-14 with no issues but I haven't updated my Solax integration nor my Octopus integration for a long time so might be that. The log file you've included certainly shows some problems with the latter. I think you've got two seperate problems although the Octopus one is non-fatal. I'll look this evening.

Does Beta-9 run ok?

mergwyn commented 2 weeks ago

Strangely after disabling pvopt when I raised this I enabled it again yesterday after updating everything to latest versions and last night worked without issues. I’ll leave this open for 24 hours and close if all good again tonight.

mergwyn commented 2 weeks ago

When I tried it again a few days ago, I still had issues. I have pulled logs but ran out of time to update this issue before I left for a holiday. I’ll have to do it when I get back in December