Utility Meter - Configuration

Hi,

Currently I have a Solax inverter connected with HA with Energy Dashboard setup with the following entities in kWh and working fine:

  • sensor.solax_XXX_total_consumption
  • sensor.solax_XXX_total_energy
  • sensor.solax_XXX_total_feed_in_energy
  • sensor.solax_XXX_today_s_energy

I’m trying to setup the utility_meter now to have the entities required to setup energy dashboard with peak and offpeak details but my configuration does not create the peak / offpeak entities for monthly cycle giving an error:

---------------------------------------------------
"Error adding entities for domain sensor with platform utility_meter

Logger: homeassistant.components.sensor
Source: components/utility_meter/sensor.py:314
Integration: Sensor ([documentation](https://www.home-assistant.io/integrations/sensor), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sensor%22))
First occurred: 4:18:54 PM (2 occurrences)
Last logged: 4:18:54 PM

* Error adding entities for domain sensor with platform utility_meter
* Error while setting up utility_meter platform for sensor

Traceback (most recent call last): 
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 613, in _async_add_entity await entity.add_to_platform_finish() 
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 747, in add_to_platform_finish await self.async_added_to_hass() 
File "/usr/src/homeassistant/homeassistant/components/utility_meter/sensor.py", line 314, in async_added_to_hass float(state.attributes.get(ATTR_LAST_PERIOD)) 
ValueError: could not convert string to float: 'None'
---------------------------------------------------

It’s strange because the entities for daily/weekly/yearly are created successfully - is this related with the last_reset attribute?

This is my configuration:

utility_meter:
  daily_energy:
    source: sensor.solax_XXX_total_consumption
    cycle: daily
    tariffs:
      - peak
      - offpeak
  weekly_energy:
    source: sensor.solax_XXX_total_consumption
    cycle: weekly
    tariffs:
      - peak
      - offpeak
  monthly_energy:
    source: sensor.solax_XXX_total_consumption
    cycle: monthly
    tariffs:
      - peak
      - offpeak
  yearly_energy:
    source: sensor.solax_XXX_total_consumption
    cycle: yearly
    tariffs:
      - peak
      - offpeak

Please let me know if there is way to have monthly_energy also working. If I remove it then HA creates everything fine … only monthly is trigering this issue.

Thanks

Double name :thinking:
monthly_energy: in configuration.yaml

Hi Krskrab,

Really appreciate your input :grinning: … after your comment I renamed monthly_energy to month_energy and it worked :smiley:! Did a search but didn’t found any “monthly” name in configuration.yaml but not sure of there is an entity with that (I have dozens) - bottom line: it worked the rename.

Thanks a lot.

GoodWeather