Hey, i had to change my rest sensor to poll daily values instead of hourly, so the value1 and value2 in below screenshot is updating every 60 seconds, and goes back to 0 next day …
Next, created template sensors, als had to divide extra /100 for the gas, to give me m3 results , and used total increasing, since they are every 60 seconds based on scan interval i can define…
- name: Smappee Water Consumption
unit_of_measurement: "m³"
state_class: total_increasing
state: >-
{% if state_attr('sensor.smappee_water_gas', 'records') %}
{{ state_attr('sensor.smappee_water_gas', 'records')[0]["value1"]|float(0)/1000 }}
{% endif %}
- name: Smappee Gas Consumption
unit_of_measurement: "m³"
state_class: total_increasing
state: >-
{% if state_attr('sensor.smappee_water_gas', 'records') %}
{{ state_attr('sensor.smappee_water_gas', 'records')[0]["value2"] | float(0)/100 }}
{% endif %}
Gives me:
So far so good … i believe…
now for the utility … i dont think i need delta values? since they increase now? and you told me i dont need to cycle?
is this correct then?
smappee_water_consumption_m3:
source: sensor.smappee_water_consumption
name: Smappee Water Consumption m3
unique_id: smappee_water_consumption_m3
smappee_gas_consumption_m3:
source: sensor.smappee_gas_consumption
name: Smappee Gas Consumption m3
unique_id: smappee_gas_consumption_m3
i now see unavaible…
and this in log:
2023-01-11 21:26:58.565 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform utility_meter
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 438, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 709, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 803, in add_to_platform_finish
await self.async_added_to_hass()
File "/usr/src/homeassistant/homeassistant/components/utility_meter/sensor.py", line 511, in async_added_to_hass
dt_util.parse_datetime(state.attributes.get(ATTR_LAST_RESET))
File "/usr/src/homeassistant/homeassistant/util/dt.py", line 188, in parse_datetime
return ciso8601.parse_datetime(dt_str)
TypeError: argument must be str
2023-01-11 21:26:58.567 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform utility_meter
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 438, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 709, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 803, in add_to_platform_finish
await self.async_added_to_hass()
File "/usr/src/homeassistant/homeassistant/components/utility_meter/sensor.py", line 511, in async_added_to_hass
dt_util.parse_datetime(state.attributes.get(ATTR_LAST_RESET))
File "/usr/src/homeassistant/homeassistant/util/dt.py", line 188, in parse_datetime
return ciso8601.parse_datetime(dt_str)
TypeError: argument must be str
2023-01-11 21:26:58.749 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up utility_meter platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 297, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 438, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 709, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 803, in add_to_platform_finish
await self.async_added_to_hass()
File "/usr/src/homeassistant/homeassistant/components/utility_meter/sensor.py", line 511, in async_added_to_hass
dt_util.parse_datetime(state.attributes.get(ATTR_LAST_RESET))
File "/usr/src/homeassistant/homeassistant/util/dt.py", line 188, in parse_datetime
return ciso8601.parse_datetime(dt_str)
TypeError: argument must be str