springfall2008 / predai

predai
Apache License 2.0
7 stars 0 forks source link

Crashing #9

Open abbottcam opened 2 months ago

abbottcam commented 2 months ago

Hello

So it works fine for a few days but then stops working...

Added 0 rows to database table sensor_givtcp_ch2330g177_load_energy_today_kwh Stored dataset in database and retrieved full history from database length 5680 Getting history for sensor sensor.givenergy_ev_energy Making API call to http://supervisor/core/api/history/period/2024-04-15T18:00:00+0100 Response <Response [200]> History for sensor sensor.givenergy_ev_energy starts at 2024-04-15 17:00:00+00:00 ends at 2024-04-29 03:24:00+00:00 Traceback (most recent call last): File "/config/predai.py", line 374, in asyncio.run(main()) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete return future.result() File "/config/predai.py", line 354, in main subtract_data, start, end = await get_history(interface, nw, subtract_name, now, incrementing, days, use_db, reset_low, reset_high) File "/config/predai.py", line 302, in get_history dataset, last_dataset_value = await nw.process_dataset(sensor_name, dataset, start, end, incrementing=incrementing, reset_low=reset_low, reset_high=reset_high) File "/config/predai.py", line 112, in process_dataset last_value = float(new_data[0]["state"]) ValueError: could not convert string to float: 'unknown' [18:41:39] INFO: PredAI init script running Running App Process Management Your API key is: (I deleted this) Bootstrap predai Copy initial python files Startup Importing plotly failed. Interactive plots will not work. Importing plotly failed. Interactive plots will not work. HA Interface started key (I deleted this) url http://supervisor/core Configuration loaded Processing sensor sensor.givtcp_ch2330g177_load_energy_today_kwh incrementing True reset_daily True interval 30 days 14 export_days 14 subtract sensor.givenergy_ev_energy Getting history for sensor sensor.givtcp_ch2330g177_load_energy_today_kwh Making API call to http://supervisor/core/api/history/period/2024-04-15T18:00:00+0100 Response <Response [200]> History for sensor sensor.givtcp_ch2330g177_load_energy_today_kwh starts at 2024-04-15 17:00:00+00:00 ends at 2024-04-29 16:55:00+00:00 ds y 0 2024-04-15 17:00:00+00:00 0.0 1 2024-04-15 17:30:00+00:00 0.4 2 2024-04-15 18:00:00+00:00 0.0 3 2024-04-15 18:30:00+00:00 0.3 4 2024-04-15 19:00:00+00:00 0.1 .. ... ... 667 2024-04-29 14:30:00+00:00 0.2 668 2024-04-29 15:00:00+00:00 0.1 669 2024-04-29 15:30:00+00:00 0.4 670 2024-04-29 16:00:00+00:00 0.4 671 2024-04-29 16:30:00+00:00 0.4

springfall2008 commented 4 weeks ago

The line numbers don't seem to line up, have you updated to latest?