History integration disabled after restart

For a few days the history graphs weren’t showing anything at all.
Today I tried restarting via Developer Tools/Yaml/Restart/Restart Home assistant
image
image

After restarting I had a series of errors in the log and the history graphs are just showing “History integration disabled”

Error evaluating condition in 'V_count_very_low': In 'condition': In 'template' condition: ValueError: Template error: float got invalid input 'unknown' when rendering template '{{states('sensor.filtered_voltage') | float < 194.5 }}' but no default was specified
1:20:00 PM – (WARNING) Automation - message first occurred at 11:50:00 AM and shows up 30 times
Template variable warning: 'None' has no attribute 'state' when rendering ';{{ now().strftime("%d-%m-%Y %H:%M")}},{{states.sensor.filtered_power_grid.state}},{{states.sensor.filtered_voltage.state}},{{states.sensor.filtered_power_prism.state }},{{ state_attr('sun.sun', 'elevation') }},{{ state_attr('sun.sun', 'azimuth') }}'
1:20:00 PM – (WARNING) helpers/template.py - message first occurred at 11:50:00 AM and shows up 30 times
Error while executing automation automation.sensor_values_to_file_leam: Error rendering data template: TemplateError: Invalid entity ID 'sensor.filtered_power_grid_Leam'
1:20:00 PM – (ERROR) Automation - message first occurred at 11:50:00 AM and shows up 10 times
sensor_values_to_file_Leam: Error executing script. Error for call_service at pos 1: Error rendering data template: TemplateError: Invalid entity ID 'sensor.filtered_power_grid_Leam'
1:20:00 PM – (ERROR) Automation - message first occurred at 11:50:00 AM and shows up 10 times
JSON result was not a dictionary
12:55:52 PM – (WARNING) MQTT - message first occurred at 12:55:52 PM and shows up 2 times
Error initializing 'Protect 60A fuse' trigger: In 'numeric_state' condition: unknown entity sensor.filtered_equo_current
11:44:26 AM – (WARNING) Home Assistant Core Integration
Error while processing template: Template<template=({{states('input_number.amp_limit')|float-(states('input_number.prism_corrente'))|float/1000}}) renders=2>
11:44:26 AM – (ERROR) helpers/template.py - message first occurred at 11:44:26 AM and shows up 4 times
Error initializing 'template' trigger for 'Conservatory hot': ValueError: Template error: float got invalid input 'unknown' when rendering template '{{states.sensor.shelly_ht_temp.state|float>states.sensor.cucina_temperature.state|float+1}}' but no default was specified
11:44:26 AM – (WARNING) Template - message first occurred at 11:44:26 AM and shows up 2 times
TemplateError('ValueError: Template error: float got invalid input 'unknown' when rendering template '{{states('input_number.amp_limit')|float-(states('input_number.prism_corrente'))|float/1000}}' but no default was specified') while processing template 'Template<template=({{states('input_number.amp_limit')|float-(states('input_number.prism_corrente'))|float/1000}}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.errore_corrente'
11:44:26 AM – (ERROR) helpers/template_entity.py - message first occurred at 11:44:26 AM and shows up 2 times
Entity sensor.water_usage (<class 'homeassistant.components.template.sensor.SensorTemplate'>) is using native unit of measurement 'l' which is not a valid unit for the device class ('humidity') it is using; expected one of ['%']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+template%22
11:44:26 AM – (WARNING) Sensor
Zigbee channel 11 utilization is 93.76%!
11:44:26 AM – (WARNING) components/zha/core/gateway.py - message first occurred at 11:44:26 AM and shows up 2 times
Config entry 'shelly1pm-Fridge' for shelly integration not ready yet: DeviceConnectionError(); Retrying in background
11:44:14 AM – (WARNING) config_entries.py
Setup failed for history: (DependencyError(...), 'Could not setup dependencies: recorder')
11:44:13 AM – (ERROR) setup.py - message first occurred at 11:44:02 AM and shows up 4 times
Unable to set up dependencies of history. Setup failed for dependencies: recorder
11:44:13 AM – (ERROR) setup.py - message first occurred at 11:44:02 AM and shows up 4 times
Error adding entities for domain sensor with platform command_line
11:44:05 AM – (ERROR) Sensor - message first occurred at 11:44:03 AM and shows up 2 times
Automation with alias 'input amp' could not be validated and has been disabled: template value should be a string for dictionary value @ data['action'][0]['data']. Got {'payload_template': "{{states('input_number.amp')'}}", 'topic': 'prism/1/command/set_current_user'}
11:44:05 AM – (ERROR) Automation
Unable to prepare setup for platform filter.sensor: (DependencyError(...), 'Could not setup dependencies: recorder')
11:44:02 AM – (ERROR) setup.py - message first occurred at 11:44:02 AM and shows up 10 times
Unable to set up dependencies of filter. Setup failed for dependencies: recorder
11:44:02 AM – (ERROR) setup.py - message first occurred at 11:44:02 AM and shows up 10 times
Setup of recorder is taking longer than 300 seconds. Startup will proceed without waiting any longer
11:43:46 AM – (ERROR) setup.py
Waiting on integrations to complete setup: recorder
11:43:45 AM – (WARNING) bootstrap.py - message first occurred at 11:39:45 AM and shows up 5 times
Setup of recorder is taking over 10 seconds.
11:38:56 AM – (WARNING) runner.py

It may be that HA is more current that some other components or vice versa, I’d be inclined to check everything is on the latest version, including (for example) custom integrations set up through HACS.

You also have quite a few templates producing errors because you’ve used states.whatever rather than states("whatever") and/or haven’t specified default values on things like float. This won’t impact anything much, but does add to the clutter in the log.