Utility meter taking 6 minutes to start

Could someone have a look at my configuration and tell me if there is anything wrong with it?
The utility meter takes ages to start, I see the message “starting utility meter, not everything will be available until it’s finished…” for 6 long minutes

I’m running it on a Raspberry PI3

I am monitoring 4 things:

  • a dishwasher
  • a whole house (referred to as “home”)
  • another whole house (referred to as “casa”, using a power sensor called “prism_power_grid”)
  • an EV chargin point (referred to as “Prism”, “auto” or “charge”)

After restarting a few times, these entities couldn’t be loaded (it was working fine until a while ago)
image

I’m including the whole configuration, but I’ve also split it into 4 down below for ease of understanding

sensor:
  - platform: mqtt
    name: "Prism power grid"
    state_topic: "prism/energy_data/power_grid"
    unit_of_measurement: 'W'
  - platform: integration
    name: Energia Casa
    source: sensor.prism_power_grid
  - 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: "Prism energia totale"
    state_topic: "prism/1/wh_total"
    unit_of_measurement: 'Wh'
  - 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: '£'
      charge_costo_giornaliero:
       value_template: "{{ (((states('input_number.f1')|float * states('sensor.auto_giornaliero_F1')|float))|round(2)+((states('input_number.f2')|float * states('sensor.auto_giornaliero_F2')|float))|round(2)+((states('input_number.f3')|float * states('sensor.auto_giornaliero_F3')|float)))|round(2)/1000}}"
       unit_of_measurement: '€'
      charge_costo_settimanale:
       value_template: "{{ (((states('input_number.f1')|float * states('sensor.auto_settimanale_F1')|float))|round(2)+((states('input_number.f2')|float * states('sensor.auto_settimanale_F2')|float))|round(2)+((states('input_number.f3')|float * states('sensor.auto_settimanale_F3')|float)))|round(2)/1000}}"
       unit_of_measurement: '€'
      charge_costo_mensile:
       value_template: "{{ (((states('input_number.f1')|float * states('sensor.auto_mensile_F1')|float))|round(2)+((states('input_number.f2')|float * states('sensor.auto_mensile_F2')|float))|round(2)+((states('input_number.f3')|float * states('sensor.auto_mensile_F3')|float)))|round(2)/1000}}"
       unit_of_measurement: '€'
      casa_costo_giornaliero:
       value_template: "{{ (((states('input_number.f1')|float/1000 * states('sensor.casa_giornaliero_F1')|float))+((states('input_number.f2')|float/1000 * states('sensor.casa_giornaliero_F2')|float))+((states('input_number.f3')|float/1000 * states('sensor.casa_giornaliero_F3')|float)))|round(2)}}"
       unit_of_measurement: '€'
      casa_costo_settimanale:
       value_template: "{{ (((states('input_number.f1')|float/1000 * states('sensor.casa_settimanale_F1')|float))+((states('input_number.f2')|float/1000 * states('sensor.casa_settimanale_F2')|float))+((states('input_number.f3')|float/1000 * states('sensor.casa_settimanale_F3')|float)))|round(2)}}"
       unit_of_measurement: '€'
      casa_costo_mensile:
       value_template: "{{ (((states('input_number.f1')|float/1000 * states('sensor.casa_mensile_F1')|float))+((states('input_number.f2')|float/1000 * states('sensor.casa_mensile_F2')|float))+((states('input_number.f3')|float/1000 * states('sensor.casa_mensile_F3')|float)))|round(2)}}"
       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

  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
  auto_giornaliero_totale:
    source: sensor.auto_costo_giornaliero
    cycle: daily
  auto_settimanale_totale:
    source: sensor.auto_costo_giornaliero
    cycle: weekly
  auto_mensile_totale:
    source: sensor.auto_costo_giornaliero
    cycle: monthly     

    

Dishwasher only:

sensor:

  - 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'

       
utility_meter:
  monthly_cost:
    source: sensor.dishwasher_cost
    cycle: monthly
  daily_cost:
    source: sensor.dishwasher_cost
    cycle: daily

    

Home only:

sensor:
  - platform: mqtt
    name: "Home Energy"
    state_topic: "esp32/em/kWh"
    value_template: "{{ value|float + states('sensor.home_energy')|float }}"
    unit_of_measurement: 'Wh'
 
  - 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: '£'


       
utility_meter:
  energy:
    source: sensor.home_energy
    cycle: daily
  energy_monthly:
    source: sensor.home_energy
    cycle: monthly
  energy_weekly:
    source: sensor.home_energy
    cycle: weekly

Casa only:

sensor:
  - platform: mqtt
    name: "Prism power grid"
    state_topic: "prism/energy_data/power_grid"
    unit_of_measurement: 'W'
  - platform: integration
    name: Energia Casa
    source: sensor.prism_power_grid
  - platform: template
    sensors: 
      casa_costo_giornaliero:
       value_template: "{{ (((states('input_number.f1')|float/1000 * states('sensor.casa_giornaliero_F1')|float))+((states('input_number.f2')|float/1000 * states('sensor.casa_giornaliero_F2')|float))+((states('input_number.f3')|float/1000 * states('sensor.casa_giornaliero_F3')|float)))|round(2)}}"
       unit_of_measurement: '€'
      casa_costo_settimanale:
       value_template: "{{ (((states('input_number.f1')|float/1000 * states('sensor.casa_settimanale_F1')|float))+((states('input_number.f2')|float/1000 * states('sensor.casa_settimanale_F2')|float))+((states('input_number.f3')|float/1000 * states('sensor.casa_settimanale_F3')|float)))|round(2)}}"
       unit_of_measurement: '€'
      casa_costo_mensile:
       value_template: "{{ (((states('input_number.f1')|float/1000 * states('sensor.casa_mensile_F1')|float))+((states('input_number.f2')|float/1000 * states('sensor.casa_mensile_F2')|float))+((states('input_number.f3')|float/1000 * states('sensor.casa_mensile_F3')|float)))|round(2)}}"
       unit_of_measurement: '€'     


       
utility_meter:
  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

    

EV charging only

sensor:
  - platform: mqtt
    name: "Prism energia totale"
    state_topic: "prism/1/wh_total"
    unit_of_measurement: 'Wh'
  - platform: template
    sensors: 
      charge_costo_giornaliero:
       value_template: "{{ (((states('input_number.f1')|float * states('sensor.auto_giornaliero_F1')|float))|round(2)+((states('input_number.f2')|float * states('sensor.auto_giornaliero_F2')|float))|round(2)+((states('input_number.f3')|float * states('sensor.auto_giornaliero_F3')|float)))|round(2)/1000}}"
       unit_of_measurement: '€'
      charge_costo_settimanale:
       value_template: "{{ (((states('input_number.f1')|float * states('sensor.auto_settimanale_F1')|float))|round(2)+((states('input_number.f2')|float * states('sensor.auto_settimanale_F2')|float))|round(2)+((states('input_number.f3')|float * states('sensor.auto_settimanale_F3')|float)))|round(2)/1000}}"
       unit_of_measurement: '€'
      charge_costo_mensile:
       value_template: "{{ (((states('input_number.f1')|float * states('sensor.auto_mensile_F1')|float))|round(2)+((states('input_number.f2')|float * states('sensor.auto_mensile_F2')|float))|round(2)+((states('input_number.f3')|float * states('sensor.auto_mensile_F3')|float)))|round(2)/1000}}"
       unit_of_measurement: '€'

       
utility_meter:
  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
  auto_giornaliero_totale:
    source: sensor.auto_costo_giornaliero
    cycle: daily
  auto_settimanale_totale:
    source: sensor.auto_costo_giornaliero
    cycle: weekly
  auto_mensile_totale:
    source: sensor.auto_costo_giornaliero
    cycle: monthly     

    

Have you found a solution for that? Mine doesn’t take 6min, but 2min, and that is 4x the time HA core needs for startup.

No, I have since then switched to a raspberry 4; it might not take 6 minutes but it still takes a few minutes for a restart (not sure if it’s still down to utility meter)

Thanks :frowning: I’m on a RPI4 that’s why it may take like 2min here :wink:

Now it’s taking about 30 seconds to go through a lot of “starting xxx”, then gets stuck on “starting input datetime” for 2.30min; total restart time 3minutes