Utility Meter 'collecting' but stays at zero

I have been trying for days to get the utility meter integration to work.

    source: sensor.emoncms_grid_import_all_time
    name: Daily Energy Import
    cycle: daily
      - peak
      - offpeak

The source is EmonCMS which outputs an ever increasing value of kWh consumed. I have tried using the sensor EmonCMS created, and also running it through a template sensor like this:

  #Energy sensors for Energy Dashboard
  - sensor:
      - name: EmonCMS Grid Import All Time
        state: "{{ states('sensor.emoncms_grid_import_kwh') | float | round(2) }}"
        unit_of_measurement: "kWh"
        state_class: measurement
        device_class: energy

Here is a screenshot of the increase graph:

As you can see, it’s value is continually increasing

But the utility meter stays at zero:

Any ideas?

It needs to be state_class: total_increasing not measurement.

Thanks. Turns out I also had some EmonCMS sensors reporting ‘null’ which stops all the sensors updating.