alias: Heating xiaomi trigger
description: ''
trigger:
- platform: state
entity_id: sensor.0x00158d0002b57f51_temperature
- platform: time
at: '23:00:00'
condition:
- condition: time
after: '23:00:00'
before: '05:30:00'
action:
- service: climate.set_temperature
data:
temperature: |
{% if states('sensor.0x00158d0002b57f51_temperature')|float < 19 %}
22
{% endif %}
entity_id: climate.room_1
- service: climate.set_hvac_mode
data:
hvac_mode: |
{% if states('sensor.0x00158d0002b57f51_temperature')|float > 19 %}
auto
{% else %}
heat
{% endif %}
entity_id: climate.room_1
mode: single
Now I have this. It is working but have a lot of error in log.
While executing automation automation.heating_xiaomi_trigger
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 404, in async_trigger
await self.action_script.async_run(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1026, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 242, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 250, in _async_step
await getattr(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 457, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1399, in async_call
processed_data = handler.schema(service_data)
File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 218, in __call__
return self._exec((Schema(val) for val in self.validators), v)
File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 341, in _exec
raise e if self.msg is None else AllInvalid(self.msg, path=path)
File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 337, in _exec
v = func(v)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 215, in _run
return self._exec(self._compiled, value, path)
File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 341, in _exec
raise e if self.msg is None else AllInvalid(self.msg, path=path)
File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 339, in _exec
v = func(path, v)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
return schema(data)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
return base_validate(path, iteritems(data), out)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: expected float for dictionary value @ data['temperature']
and:
Already running
Heating xiaomi trigger: Error executing script. Invalid data for call_service at pos 1: expected float for dictionary value @ data['temperature']