I applied tour changes but still doesn’t work.
Now sensors.yaml
looks like this:
#Air purifier
- platform: template
sensors:
air_purifier_bedroom_aqi:
friendly_name: PM2.5
unit_of_measurement: μg/m³
value_template: "{{ state_attr('fan.oczyszczacz_powietrza', 'aqi') }}"
In log file I see:
2021-10-30 21:56:11 ERROR (MainThread) [homeassistant.config] Unknown error validating config for template platform for sensor component with PLATFORM_SCHEMA
Traceback (most recent call last):
File "/data/data/com.termux/files/home/hass/lib/python3.9/site-packages/homeassistant/config.py", line 861, in async_process_component_config
p_validated = platform.PLATFORM_SCHEMA(p_config) # type: ignore
File "/data/data/com.termux/files/home/hass/lib/python3.9/site-packages/voluptuous/validators.py", line 218, in __call__
return self._exec((Schema(val) for val in self.validators), v)
File "/data/data/com.termux/files/home/hass/lib/python3.9/site-packages/voluptuous/validators.py", line 337, in _exec
v = func(v)
File "/data/data/com.termux/files/home/hass/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
File "/data/data/com.termux/files/home/hass/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
return schema(data)
File "/data/data/com.termux/files/home/hass/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
File "/data/data/com.termux/files/home/hass/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
return base_validate(path, iteritems(data), out)
File "/data/data/com.termux/files/home/hass/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 386, in validate_mapping
cval = cvalue(key_path, value)
File "/data/data/com.termux/files/home/hass/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
return schema(data)
File "/data/data/com.termux/files/home/hass/lib/python3.9/site-packages/homeassistant/helpers/config_validation.py", line 487, in verify
return cast(dict, schema(value))
File "/data/data/com.termux/files/home/hass/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
File "/data/data/com.termux/files/home/hass/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
return base_validate(path, iteritems(data), out)
File "/data/data/com.termux/files/home/hass/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 386, in validate_mapping
cval = cvalue(key_path, value)
File "/data/data/com.termux/files/home/hass/lib/python3.9/site-packages/voluptuous/validators.py", line 215, in _run
return self._exec(self._compiled, value, path)
File "/data/data/com.termux/files/home/hass/lib/python3.9/site-packages/voluptuous/validators.py", line 339, in _exec
v = func(path, v)
File "/data/data/com.termux/files/home/hass/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
return schema(data)
File "/data/data/com.termux/files/home/hass/lib/python3.9/site-packages/homeassistant/helpers/config_validation.py", line 738, in validator
if key in config:
TypeError: argument of type 'NoneType' is not iterable