What's wrong in my configuration?

I’m building my system from scratch after I updated from 0.114.3 to whatever is the latest version today

This was working fine, but apparently something has changed, and causes home assistant to be slow on manual restart and also randomly restarts sometimes which I cannot accept

I’ve already setup my lights, switches and binary sensors, and it restarts in a few minutes and I only get 3 or 4 warnings, the like of “platform xxx is taking more than 10 secnds to setup”, which I understand to be fine

However, when I add the following, everything is so much slower

sensor:
#  - platform: integration
#    name: Energia Casa
#    source: sensor.prism_power_grid
  - platform: mqtt
    name: "Prism hello"
    state_topic: "prism/hello"
  - platform: mqtt
    name: "Prism stato"
    state_topic: "prism/1/state"
    value_template: >
      {% set map = {
      '1': 'nessun veicolo connesso',
      '2': 'veicolo connesso, in attesa di ricaricare',
      '3': 'veicolo in carica',
      '4': 'carica in pausa'
       } %}
       {{ map[value] if value in map else 'error' }}
  - platform: mqtt
    name: "Prism corrente"
    state_topic: "prism/1/amp"
    unit_of_measurement: 'mA'
  - platform: mqtt
    name: "Prism wh sessione"
    state_topic: "prism/1/wh"
    unit_of_measurement: 'Wh'
  - platform: mqtt
    name: "Prism corrente pilotata dall’auto"
    state_topic: "prism/1/pilot"
    unit_of_measurement: 'A'
  - platform: mqtt
    name: "Prism user_amp"
    state_topic: "prism/1/user_amp"
    unit_of_measurement: 'A'
  - platform: mqtt
    name: "Prism tensione attuale"
    state_topic: "prism/1/volt"
    unit_of_measurement: 'V'
  - platform: mqtt
    name: "Prism potenza"
    state_topic: "prism/1/w"
    unit_of_measurement: 'W'
  - platform: mqtt
    name: "Prism energia totale"
    state_topic: "prism/1/wh_total"
    unit_of_measurement: 'Wh'

  - platform: mqtt
    name: "Prism durata sessione"
    state_topic: "prism/1/session_time"
    unit_of_measurement: 's'
  - platform: mqtt
    name: "Prism error"
    state_topic: "prism/1/error"
  - platform: mqtt
    name: "Prism mode"
    state_topic: "prism/1/mode"
    value_template: >
      {% set map = {
      '1': 'Solare',
      '2': 'Normale',
      '3': 'Pausa',
      '7': 'Pausa causata da autolimit'
       } %}
       {{ map[value] if value in map else 'error' }}  
  - platform: mqtt
    name: "Prism temperatura"
    state_topic: "prism/0/info/temperature/cover"
    unit_of_measurement: '°C'
  - platform: mqtt
    name: "Prism Tocco"
    state_topic: "prism/1/input/touch"
  - platform: mqtt
    name: "Prism Bussata"
    state_topic: "prism/0/input/knock"
  - platform: mqtt
    name: "Prism power grid"
    state_topic: "prism/energy_data/power_grid"
    unit_of_measurement: 'W'


  - platform: mqtt
    name: "Sonoff Code"
    state_topic: "tele/RF_Bridge/RESULT"
    value_template: "{{ value_json.RfReceived }}"


  - platform: mqtt
    name: "Dishwasher Power"
    state_topic: "shellies/shelly1pm-B90DC2/relay/0/power"
    unit_of_measurement: 'W'
  - platform: mqtt
    name: "Shelly Plug Power"
    state_topic: "shellies/shellyplug-s-977AE9/relay/0/power"
    unit_of_measurement: 'W'
  - platform: mqtt
    name: "Shelly Plug Temperature"
    state_topic: "shellies/shellyplug-s-977AE9/temperature"
    unit_of_measurement: '°C'
  - platform: mqtt
    name: "Home Power"
    state_topic: "esp32/em/W"
    unit_of_measurement: 'W'
  - platform: mqtt
    name: "Home Energy"
    state_topic: "esp32/em/kWh"
    value_template: "{{ value|float + states('sensor.home_energy')|float }}"
    unit_of_measurement: 'Wh'
  - platform: mqtt
    name: "Dishwasher Energy"
    state_topic: "shellies/shelly1pm-B90DC2/relay/0/energy"
    value_template: "{{ value|float / 60000 }}" # Fix for Watt-minutes
    unit_of_measurement: 'kWh'
  - platform: mqtt
    name: "Dishwasher Cost"
    state_topic: "shellies/shelly1pm-B90DC2/relay/0/energy"
    value_template: "{{ (value|float / 60000 * 0.14145)}}" # Fix for Watt-minutes and electricity price
    unit_of_measurement: '£'
  - platform: template
    sensors:
      ricarica_auto:
       unit_of_measurement: 'kWh'
       value_template: "{{ (states('sensor.prism_energia_totale')|float / 1000 )}}" 
  - platform: mqtt
    name: "Dishwasher Temperature"
    state_topic: "shellies/shelly1pm-B90DC2/temperature"
    unit_of_measurement: '°C'
#  - platform: mqtt
#    name: "Camera1 Temperature"
#    state_topic: "shellies/shelly1pm-B9139A/temperature"
#    unit_of_measurement: '°C'
  - platform: filter
    name: "filtered voltage"
    entity_id: sensor.prism_tensione_attuale
    filters:
      - filter: time_simple_moving_average
        window_size: "00:10"
        precision: 2    
  - platform: filter
    name: "filtered power grid"
    entity_id: sensor.prism_power_grid
    filters:
      - filter: time_simple_moving_average
        window_size: "00:10"
        precision: 2   
  - platform: filter
    name: "filtered power prism"
    entity_id: sensor.prism_potenza
    filters:
      - filter: time_simple_moving_average
        window_size: "00:10"
        precision: 2   
  - platform: filter
    name: "filtered power grid 3hr"
    entity_id: sensor.prism_power_grid
    filters:
      - filter: time_simple_moving_average
        window_size: "03:00"
        precision: 2   
  - platform: filter
    name: "filtered power grid 2hr30"
    entity_id: sensor.prism_power_grid
    filters:
      - filter: time_simple_moving_average
        window_size: "02:30"
        precision: 2   
  - platform: template
    sensors: 
      prism_potenza_casa:
       value_template: "{{(   states('sensor.prism_power_grid') | float - (states('sensor.prism_potenza') | float) ) | round(3) }}"
       unit_of_measurement: "W"
  - platform: template
    sensors: 
      prism_corrente_grid:
       value_template: "{{(   states('sensor.prism_power_grid') | float / (states('sensor.prism_tensione_attuale') | float) ) | round(3) }}"
       unit_of_measurement: "A"
  - platform: template
    sensors: 
      home_energy_cost:
       friendly_name: 'Home Energy Cost' 
       value_template: "{{ (14.145/100/1000 * states('sensor.energy')|float)| round(4) }}"
       unit_of_measurement: '£'
  - platform: template
    sensors: 
      conformita_tensione:
       value_template: "{{(states.input_number.v_count_high.state | float/(states.input_number.v_count_low.state | float + states.input_number.v_count_high.state | float)*100) | round(1)}}"
       unit_of_measurement: "%"
       
utility_meter:
  monthly_cost:
    source: sensor.dishwasher_cost
    cycle: monthly
  daily_cost:
    source: sensor.dishwasher_cost
    cycle: daily
  energy:
    source: sensor.home_energy
    cycle: daily
  energy_monthly:
    source: sensor.home_energy
    cycle: monthly
  energy_weekly:
    source: sensor.home_energy
    cycle: weekly
#  km_giornaliero:
#    source: sensor.tesla_model_3_mileage_sensor
#    cycle: daily
  auto_giornaliero:
    source: sensor.prism_energia_totale
    cycle: daily
    offset:
      days: 0
      hours: 12
      minutes: 0
    tariffs:
      - F1
      - F2
      - F3
  auto_settimanale:
    source: sensor.prism_energia_totale
    cycle: weekly
    tariffs:
      - F1
      - F2
      - F3
  auto_mensile:
    source: sensor.prism_energia_totale
    cycle: monthly
    tariffs:
      - F1
      - F2
      - F3
  casa_giornaliero:
    source: sensor.energia_casa
    cycle: daily
    tariffs:
      - F1
      - F2
      - F3
  casa_settimanale:
    source: sensor.energia_casa
    cycle: weekly
    tariffs:
      - F1
      - F2
      - F3
  casa_mensile:
    source: sensor.energia_casa
    cycle: monthly
    tariffs:
      - F1
      - F2
      - F3
  casa_giornaliero_totale:
    source: sensor.casa_costo_giornaliero
    cycle: daily
  casa_settimanale_totale:
    source: sensor.casa_costo_giornaliero
    cycle: weekly
  casa_mensile_totale:
    source: sensor.casa_costo_giornaliero
    cycle: monthly
      

``

Slower in what way? The MQTT sensors might not be available until a state message is received after a restart.

30 minutes instead of 2-3 for a restart

this is what I see when it restarts quickly (5 minutes)


[17:23:53] INFO: Using udev information from host
[cont-init.d] udev.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2021-04-27 17:24:28 WARNING (MainThread) [homeassistant.setup] Setup of utility_meter is taking over 10 seconds.
2021-04-27 17:24:37 WARNING (MainThread) [homeassistant.components.switch] Setup of switch platform mqtt is taking over 10 seconds.
2021-04-27 17:24:37 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform filter is taking over 10 seconds.
2021-04-27 17:26:33 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform mobile_app is taking over 10 seconds.
2021-04-27 17:26:33 WARNING (MainThread) [homeassistant.setup] Setup of default_config is taking over 10 seconds.
2021-04-27 17:26:33 WARNING (MainThread) [homeassistant.components.device_tracker] Setup of device_tracker platform mobile_app is taking over 10 seconds.
2021-04-27 17:26:33 WARNING (MainThread) [homeassistant.components.weather] Setup of weather platform met is taking over 10 seconds.
2021-04-27 17:28:49 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: utility_meter, default_config
2021-04-27 17:28:49 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating workday binary_sensor took longer than the scheduled update interval 0:00:30
2021-04-27 17:28:49 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating ping binary_sensor took longer than the scheduled update interval 0:00:30
2021-04-27 17:29:01 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 19)
2021-04-27 17:29:01 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 20)
2021-04-27 17:29:01 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 21)
2021-04-27 17:29:01 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 22)
2021-04-27 17:29:01 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 23)
2021-04-27 17:29:01 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 24)
2021-04-27 17:29:01 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 25)
2021-04-27 17:29:01 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 26)
2021-04-27 17:29:01 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 27)
2021-04-27 17:29:01 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 28)
2021-04-27 17:29:01 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 29)
2021-04-27 17:29:01 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 30)
2021-04-27 17:29:01 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 31)
2021-04-27 17:29:01 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 32)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 33)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 34)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 35)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 36)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 37)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 38)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 39)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 40)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 41)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 42)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 43)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 44)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 45)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 46)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 47)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 48)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 49)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 50)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 51)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 52)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 53)
2021-04-27 17:29:02 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 54)
2021-04-27 17:29:06 WARNING (MainThread) [homeassistant.components.automation.input_amp_limit] input amp limit: Already running
2021-04-27 17:29:15 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 55)
2021-04-27 17:29:16 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 56)
2021-04-27 17:29:16 WARNING (MainThread) [homeassistant.components.mqtt] No ACK from MQTT server in 10 seconds (mid: 57)

``

When I add the configuration from the first post…

2021-04-27 17:30:56 ERROR (MainThread) [homeassistant.components.hassio.handler] Timeout on /homeassistant/restart request
s6-svscanctl: fatal: unable to control /var/run/s6/services: supervisor not listening
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] udev.sh: executing... 
[17:31:04] INFO: Using udev information from host
[cont-init.d] udev.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2021-04-27 17:31:45 WARNING (MainThread) [homeassistant.setup] Setup of utility_meter is taking over 10 seconds.
2021-04-27 17:31:51 WARNING (MainThread) [homeassistant.components.light] Setup of light platform mqtt is taking over 10 seconds.
2021-04-27 17:31:51 WARNING (MainThread) [homeassistant.components.switch] Setup of switch platform mqtt is taking over 10 seconds.
2021-04-27 17:31:52 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform mqtt is taking over 10 seconds.
2021-04-27 17:31:52 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform filter is taking over 10 seconds.
2021-04-27 17:37:56 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating workday binary_sensor took longer than the scheduled update interval 0:00:30
2021-04-27 17:37:56 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating ping binary_sensor took longer than the scheduled update interval 0:00:30
2021-04-27 17:38:07 ERROR (MainThread) [homeassistant.components.hassio.handler] Timeout on /ingress/validate_session request
2021-04-27 17:38:07 ERROR (MainThread) [homeassistant.components.hassio] Failed to to call /ingress/validate_session - 
2021-04-27 17:38:07 ERROR (MainThread) [homeassistant.components.hassio.handler] Timeout on /ingress/validate_session request
2021-04-27 17:38:07 ERROR (MainThread) [homeassistant.components.hassio] Failed to to call /ingress/validate_session - 
2021-04-27 17:38:07 ERROR (MainThread) [homeassistant.components.hassio.handler] Timeout on /ingress/validate_session request
2021-04-27 17:38:07 ERROR (MainThread) [homeassistant.components.hassio] Failed to to call /ingress/validate_session - 
2021-04-27 17:38:07 ERROR (MainThread) [homeassistant.components.hassio.handler] Timeout on /ingress/validate_session request
2021-04-27 17:38:07 ERROR (MainThread) [homeassistant.components.hassio] Failed to to call /ingress/validate_session - 
2021-04-27 17:40:35 WARNING (MainThread) [homeassistant.components.automation.input_amp_limit] input amp limit: Already running

Hi, I have your same configuration but no problem for me.

I landed to your post after a google search. My problem is that when the prism/1/mode is in “Pausa causata da autolimit” it stays that way, even if after the power from solar is enough to charge the car.

YOu experience the same?