springfall2008 / batpred

Home battery prediction and charging automation for Home Assistant, supporting many inverter types
https://springfall2008.github.io/batpred/
124 stars 44 forks source link

Exception raised float() argument must be a string or a real number, not 'NoneType' #1556

Open mikejreading opened 1 day ago

mikejreading commented 1 day ago

Error: Exception raised float() argument must be a string or a real number, not 'NoneType'

4391 2024-10-20 13:05:03.706742: Error: float() argument must be a string or a real number, not 'NoneType'
4390 2024-10-20 13:05:03.706653: Info: record_status Error: Exception raised float() argument must be a string or a real number, not 'NoneType'
4388 TypeError: float() argument must be a string or a real number, not 'NoneType'
4375 2024-10-20 13:05:03.689749: Error: Traceback (most recent call last):
4374 2024-10-20 13:05:03.689512: Error: Exception raised float() argument must be a string or a real number, not 'NoneType'
4279 2024-10-20 13:05:01.735262: Warn: Inverter 0: Using inverter type SK - not all features are available
4244 2024-10-20 13:01:04.175602: Error: float() argument must be a string or a real number, not 'NoneType'
4243 2024-10-20 13:01:04.175515: Info: record_status Error: Exception raised float() argument must be a string or a real number, not 'NoneType'
4241 TypeError: float() argument must be a string or a real number, not 'NoneType'
4228 2024-10-20 13:01:04.159383: Error: Traceback (most recent call last):
4227 2024-10-20 13:01:04.159042: Error: Exception raised float() argument must be a string or a real number, not 'NoneType'
4118 2024-10-20 13:00:01.932925: Warn: Inverter 0: Using inverter type SK - not all features are available
4083 2024-10-20 12:56:51.428122: Error: float() argument must be a string or a real number, not 'NoneType'
4082 2024-10-20 12:56:51.428030: Info: record_status Error: Exception raised float() argument must be a string or a real number, not 'NoneType'
4080 TypeError: float() argument must be a string or a real number, not 'NoneType'
4067 2024-10-20 12:56:51.412139: Error: Traceback (most recent call last):
4066 2024-10-20 12:56:51.411891: Error: Exception raised float() argument must be a string or a real number, not 'NoneType'
4030 2024-10-20 12:56:46.310607: Warn: Inverter 0: Using inverter type SK - not all features are available
2024-10-20 13:21:27.829356: Charge window will be: 2024-10-20 13:30:00+01:00 - 2024-10-20 14:05:00+01:00 - current soc 87 target 100
2024-10-20 13:21:27.829451: Configuring charge window now (now 10-20 13:20:00 target set_window_minutes 30 charge start time 10-20 13:30:00
2024-10-20 13:21:27.829555: Adjust idle time, charge 13:30:00-14:05:00 discharge 13:00:00-13:31:00
2024-10-20 13:21:27.829705: Adjust idle time computed idle is 00:00:00-00:00:00
2024-10-20 13:21:27.829750: Next discharge window will be: 2024-10-20 13:00:00+01:00 - 2024-10-20 13:31:00+01:00 at reserve 65
2024-10-20 13:21:27.829792: Discharging now - current SOC 7.8 and target 5.85
2024-10-20 13:21:27.829881: Inverter 0 Adjust force discharge to True, change times from 13:00:00 - 13:31:00 to 13:00:00 - 13:31:00
2024-10-20 13:21:27.829896: Adjust idle time, charge 13:30:00-14:05:00 discharge 13:00:00-13:31:00
2024-10-20 13:21:27.829986: Adjust idle time computed idle is 00:00:00-00:00:00
2024-10-20 13:21:27.830053: Inverter 0 Call service template discharge_start_service = {'service': 'select.select_option', 'entity_id': 'select.sunsynk_work_mode', 'option': 'Selling First'}
2024-10-20 13:21:27.830074: Inverter 0 Call service select/select_option with data {'entity_id': 'select.sunsynk_work_mode', 'option': 'Selling First'}
2024-10-20 13:21:27.830674: Info: Web socket service select/select_option socket for url http://supervisor/core/api/websocket
2024-10-20 13:21:27.848077: Inverter 0 adjust target soc for charge to 65% based on going from 87% -> 65% total add is -1.95kWh and this battery needs to add -1.95kWh to get to 5.85kWh
2024-10-20 13:21:27.848184: Inverter 0 Current charge limit is 100% and new target is 65%
2024-10-20 13:21:27.848232: Error: Exception raised float() argument must be a string or a real number, not 'NoneType'
2024-10-20 13:21:27.848503: Error: Traceback (most recent call last):
  File "/config/predbat.py", line 11000, in run_time_loop
    self.update_pred(scheduled=True)
  File "/config/predbat.py", line 9760, in update_pred
    status, status_extra = self.execute_plan()
  File "/config/predbat.py", line 8492, in execute_plan
    self.adjust_battery_target_multi(inverter, self.discharge_limits_best[0], isCharging, isDischarging)
  File "/config/predbat.py", line 8138, in adjust_battery_target_multi
    inverter.adjust_battery_target(new_soc_percent, is_charging, is_discharging)
  File "/config/inverter.py", line 1175, in adjust_battery_target
    self.write_and_poll_value("charge_limit", self.base.get_arg("charge_limit", indirect=False, index=self.id), soc)
  File "/config/inverter.py", line 1243, in write_and_poll_value
    matched = abs(float(current_state) - new_value) <= fuzzy
TypeError: float() argument must be a string or a real number, not 'NoneType'

2024-10-20 13:21:27.864571: Info: record_status Error: Exception raised float() argument must be a string or a real number, not 'NoneType'
2024-10-20 13:21:27.864663: Error: float() argument must be a string or a real number, not 'NoneType'
springfall2008 commented 1 day ago

The error here is that 'charge_limit' in apps.yaml isn't pointing to something that is a number you are getting None instead. What did you set it to?

mikejreading commented 1 day ago

Ah - did I miss something in the set up somewhere? It's currently set to:

  charge_limit:
    - number.sunsynk_set_soc_timezone1 # Inverter SOC time slot1

From the Sunsynk example yaml - did I need to do some more config and actually set that somewhere?