Closed msm8811 closed 2 years ago
Could you set the error level to debug, activate the simulation and send me the log please?
I don't see any debug options that are configurable in the integration. How do I set that level of error reporting?
You can call the logger.set_level
service :
service: logger.set_level
data:
custom_components.presence_simulation: debug
Here are the logs when I have just one light entry configured and try and turn it on:
2022-06-30 12:20:55 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=switch, service=turn_on, service_data=entity_id=switch.presence_simulation> 2022-06-30 12:20:55 DEBUG (Recorder) [homeassistant.components.recorder.core] Processing task: EventTask(event=<Event call_service[L]: domain=switch, service=turn_on, service_data=entity_id=switch.presence_simulation>) 2022-06-30 12:20:55 DEBUG (SyncWorker_5) [custom_components.presence_simulation.switch] Turn on of the presence simulation through the switch 2022-06-30 12:20:55 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=presence_simulation, service=start, service_data=> 2022-06-30 12:20:55 DEBUG (MainThread) [custom_components.presence_simulation] Is already running ? off 2022-06-30 12:20:55 DEBUG (MainThread) [custom_components.presence_simulation] setting restore states False 2022-06-30 12:20:55 DEBUG (MainThread) [custom_components.presence_simulation] Presence simulation started 2022-06-30 12:20:55 ERROR (MainThread) [custom_components.presence_simulation] Error when trying to identify entity light.bridge_bridge_wall_wash, it seems it doesn't exist. Continuing without this entity 2022-06-30 12:20:55 ERROR (MainThread) [custom_components.presence_simulation] Error during identifing entities, no valid entities has been found 2022-06-30 12:20:55 DEBUG (Recorder) [homeassistant.components.recorder.core] Processing task: EventTask(event=<Event call_service[L]: domain=presence_simulation, service=start, service_data=>)
That entity, light.bridge_bridge_wall_wash is one of many lutron lights and I assure you it exists and is controlld by home assistant just fine. I get the same error when I try and use multiple entities as well.
Well that's strange... The code is the following:
if hass.states.get(entity) is None:
_LOGGER.error("Error when trying to identify entity %s, it seems it doesn't exist. Continuing without this entity", entity)
It this error is raised, it means the entity is not found in hass.states
, which, as far as I know, is only supposed to happen if the entity doesn't exist...
The get
method of the hass.states
object :
def get(self, entity_id: str) -> State | None:
"""Retrieve state of entity_id or None if not found.
Async friendly.
"""
return self._states.get(entity_id.lower())
So if you type
{{ states.light.bridge_bridge_wall_wash.state }}
{{ states('light.bridge_bridge_wall_wash') }}
in Template
screen, what do you get?
Thanks for working this.
When I type this into the templates screen, I get
off off
in the results window.
Did you fix something in this release from yesterday (v2.1) ? The integration seems to not be throwing errors as before when activated. I have a light group and individual lights work. However, if I have multiple entities on the UI based config, light light.lights_ps, and cover.covers_ps, it fails aagin.
How are you supposed to add multiple entities on the configuration UI? Multiple entities separated by a comma?
Nop, didn't change anything concerning your issue... If you want to add several entities, you have to create group.
Sorry, I don't understand the limitation. You can't create a group with both covers and lights, or switches and lights - they all have to be in the same domain. If I want to have both covers, lights, etc.. all be simulated, don't you have to be able to add multiple entities in the configuration?
Hmm ok I understand. Actually I'm using groups that are apparently 'old fashion` that allows to group entities from different domains... And that is not possible anymore. I will then think about something to allows that...
Support for multiple entities added in v2.2
This seems to work fine. Thanks for the fix!
When I trigger the simulation to start, I always get this error:
Logger: custom_components.presence_simulation Source: custom_components/presence_simulation/init.py:182 Integration: Presence Simulation (documentation, issues) First occurred: June 14, 2022, 8:17:47 AM (4 occurrences) Last logged: 10:18:11 PM
Error during identifing entities, no valid entities has been found
I have tried making groups with the new groups helper, and it fails with this error. If I take the 30 or so lights and put them all on the entities list (separated by commas) during configuration, I get this error too. This is all with 2022.6.6.