@iz3man wrote:
2020-04-13 15:31:15 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.shelly_total_power_consumption fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update await self.async_update() File "/usr/src/homeassistant/homeassistant/components/template/sensor.py", line 224, in async_update self._state = self._template.async_render() File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 221, in async_render return compiled.render(kwargs).strip() File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render self.environment.handle_exception() File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception reraise(*rewrite_traceback_stack(source=source)) File "/usr/local/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise raise value.with_traceback(tb) File "<template>", line 1, in top-level template code TypeError: can only concatenate str (not "float") to str 2020-04-13 15:31:15 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.shelly_total_power fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update await self.async_update() File "/usr/src/homeassistant/homeassistant/components/template/sensor.py", line 224, in async_update self._state = self._template.async_render() File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 221, in async_render return compiled.render(kwargs).strip() File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render self.environment.handle_exception() File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception reraise(*rewrite_traceback_stack(source=source)) File "/usr/local/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise raise value.with_traceback(tb) File "<template>", line 1, in top-level template code TypeError: can only concatenate str (not "float") to str 2020-04-13 15:31:15 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.shelly_total_power_consumption fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update await self.async_update() File "/usr/src/homeassistant/homeassistant/components/template/sensor.py", line 224, in async_update self._state = self._template.async_render() File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 221, in async_render return compiled.render(kwargs).strip() File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render self.environment.handle_exception() File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception reraise(*rewrite_traceback_stack(source=source)) File "/usr/local/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise raise value.with_traceback(tb) File "<template>", line 1, in top-level template code TypeError: can only concatenate str (not "float") to str
This is what the two template sensors look like:
- platform: template sensors: shelly_total_power_consumption: friendly_name: 'Verbrauch Gesamt' unit_of_measurement: 'kWh' value_template: '{{ ((float(states.sensor.shelly_shem_3_dc4f227648a6_1_total_consumption.state) + float(states.sensor.shelly_shem_3_dc4f227648a6_2_total_consumption.state) + float(states.sensor.shelly_shem_3_dc4f227648a6_3_total_consumption.state)) | round(2) )}}' - platform: template sensors: shelly_total_power: friendly_name: 'Leistung Gesamt' unit_of_measurement: 'W' value_template: '{{ float(states.sensor.shelly_shem_3_dc4f227648a6_1_current_consumption.state) + float(states.sensor.shelly_shem_3_dc4f227648a6_2_current_consumption.state) + float(states.sensor.shelly_shem_3_dc4f227648a6_3_current_consumption.state | round(0) )}}'
Any idea what’s wrong? Thanks!!
Posts: 1
Participants: 1