Hi!
HA version is 0.69.1.
I would like to change hours_to_show attribute dynamically via input_number.
collector:
entities:
- sensor.collector_air_temperature
- sensor.collector_in_temperature
- sensor.collector_out1_temperature
hours_to_show: {{ states('input_number.history_period') | int }}
refresh: 60
But there is a check configuration error:
Error loading /home/homeassistant/.homeassistant/configuration.yaml: invalid key: “OrderedDict([(“states(‘input_number.history_period’) | int”, None)])” in “/home/homeassistant/.homeassistant/history_graph.yaml”, line 8, column 0
If I add double quotes I receive an error handling request.
collector:
entities:
- sensor.collector_air_temperature
- sensor.collector_in_temperature
- sensor.collector_out1_temperature
hours_to_show: "{{ states('input_number.history_period') | int }}"
refresh: 60
Error handling request
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_protocol.py”, line 381, in start
resp = await self._request_handler(request)
File “/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_app.py”, line 322, in _handle
resp = await handler(request)
File “/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_middlewares.py”, line 88, in impl
return await handler(request)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/http/static.py”, line 68, in staticresource_middleware
return await handler(request)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/http/real_ip.py”, line 27, in real_ip_middleware
return await handler(request)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/http/ban.py”, line 68, in ban_middleware
return await handler(request)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/http/auth.py”, line 54, in auth_middleware
return await handler(request)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/http/view.py”, line 104, in handle
result = await result
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/config/core.py”, line 24, in post
errors = yield from async_check_ha_config_file(request.app[‘hass’])
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/config.py”, line 690, in async_check_ha_config_file
check_ha_config_file, hass)
File “/usr/lib/python3.5/asyncio/futures.py”, line 380, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.5/asyncio/tasks.py”, line 304, in _wakeup
future.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/scripts/check_config.py”, line 347, in check_ha_config_file
config = component.CONFIG_SCHEMA(config)
File “/srv/homeassistant/lib/python3.5/site-packages/voluptuous/schema_builder.py”, line 267, in call
return self._compiled(, data)
File “/srv/homeassistant/lib/python3.5/site-packages/voluptuous/schema_builder.py”, line 587, in validate_dict
return base_validate(path, iteritems(data), out)
File “/srv/homeassistant/lib/python3.5/site-packages/voluptuous/schema_builder.py”, line 379, in validate_mapping
cval = cvalue(key_path, value)
File “/srv/homeassistant/lib/python3.5/site-packages/voluptuous/schema_builder.py”, line 769, in validate_callable
return schema(data)
File “/srv/homeassistant/lib/python3.5/site-packages/voluptuous/schema_builder.py”, line 267, in call
return self._compiled(, data)
File “/srv/homeassistant/lib/python3.5/site-packages/voluptuous/schema_builder.py”, line 587, in validate_dict
return base_validate(path, iteritems(data), out)
File “/srv/homeassistant/lib/python3.5/site-packages/voluptuous/schema_builder.py”, line 379, in validate_mapping
cval = cvalue(key_path, value)
File “/srv/homeassistant/lib/python3.5/site-packages/voluptuous/schema_builder.py”, line 769, in validate_callable
return schema(data)
File “/srv/homeassistant/lib/python3.5/site-packages/voluptuous/schema_builder.py”, line 267, in call
return self._compiled(, data)
File “/srv/homeassistant/lib/python3.5/site-packages/voluptuous/schema_builder.py”, line 587, in validate_dict
return base_validate(path, iteritems(data), out)
File “/srv/homeassistant/lib/python3.5/site-packages/voluptuous/schema_builder.py”, line 379, in validate_mapping
cval = cvalue(key_path, value)
File “/srv/homeassistant/lib/python3.5/site-packages/voluptuous/schema_builder.py”, line 769, in validate_callable
return schema(data)
File “/srv/homeassistant/lib/python3.5/site-packages/voluptuous/validators.py”, line 535, in call
if self.min is not None and not v >= self.min:
TypeError: unorderable types: str() >= int()
What’s wrong in my configuration? Or is it a bug?