Closed lostcontrol closed 10 months ago
Seeing the same error on 2023.11.2. It appears this error breaks the simulation and no light changes occur after.
Seems like there is also an issue with lights that have a brightness value. Any light in my house with a brightness value is not having issues with the simulation.
I have not had a chance to investigate yet, but the error message is:
Logger: homeassistant
Source: core.py:2001
First occurred: November 11, 2023 at 7:25:42 PM (10 occurrences)
Last logged: November 11, 2023 at 8:55:02 PM
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/presence_simulation/__init__.py", line 301, in simulate_single_entity
await update_entity(entity_id, state)
File "/config/custom_components/presence_simulation/__init__.py", line 345, in update_entity
await hass.services.async_call("light", "turn_"+state.state, service_data, blocking=False)
File "/usr/src/homeassistant/homeassistant/core.py", line 2001, in async_call
processed_data: dict[str, Any] = handler.schema(service_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 232, in __call__
return self._exec((Schema(val) for val in self.validators), v)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 355, in _exec
raise e if self.msg is None else AllInvalid(self.msg, path=path)
File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 351, in _exec
v = func(v)
^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
return schema(data)
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 229, in _run
return self._exec(self._compiled, value, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 355, in _exec
raise e if self.msg is None else AllInvalid(self.msg, path=path)
File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 353, in _exec
v = func(path, v)
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
return schema(data)
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
return base_validate(path, iteritems(data), out)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 433, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: extra keys not allowed @ data['brightness']
It appears my None
check needed to be further up. I adjusted and have seen the presence simulation working since.
I will update my PR later this evening when I'm back.
Fix should be good to go.
@slashback100 It would be nice to make a new release with this fix. This integration is broken on 2023.11. Thank you.
Yes you are right, I just need to find some time to test it before releasing it. I'll do it asap
v3.2 released. Sorry for the delay
I just noticed the following exception in my logs:
Running HA 2023.11.1 and the latest version of this project.