Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re Help re event presence_simulation_change #118 #119

Closed
Wright55 opened this issue Mar 18, 2024 · 12 comments
Closed

Re Help re event presence_simulation_change #118 #119

Wright55 opened this issue Mar 18, 2024 · 12 comments
Labels
bug Something isn't working

Comments

@Wright55
Copy link

Responded with continuing issue trying to get the automation to work.

automation does not trigger.

Anything I can do?

@slashback100
Copy link
Owner

I recommend you read this : https://www.home-assistant.io/docs/automation/troubleshooting/

@Wright55
Copy link
Author

Read, didnt realise you can test a trigger.
Tested, still not working.
This is my automation
alias: Presence Simulation Event Test
description: ""
trigger:

  • platform: event
    event_type: presence_simulation_change
    action:
  • service: notify.whatsapp
    metadata: {}
    data:
    message: >-
    Simulation of the entity {{ trigger.event.data.entity_id }}, {{
    trigger.event.data.service }} called with following parameters: {{
    trigger.event.data.service_data }}
    mode: single

Trace
Executed: 19 March 2024 at 05:53:21
Error: Error rendering data template: UndefinedError: 'dict object' has no attribute 'event'

Trace timeline

Triggered manually at 19 March 2024 at 05:53:21
Notifications 'Send a notification with whatsapp' on
Stopped because an error was encountered at 19 March 2024 at 05:53:21 (runtime: 0.01 seconds)

Error rendering data template: UndefinedError: 'dict object' has no attribute 'event'

Debug Log 1
Logger: homeassistant.components.automation.presence_simulation_event_test
Source: components/automation/init.py:687
integration: Automation (documentation, issues)
First occurred: 16 March 2024 at 16:39:35 (3 occurrences)
Last logged: 05:53:21

Error while executing automation automation.presence_simulation_event_test: Error rendering data template: UndefinedError: 'dict object' has no attribute 'event'

Debug log 2
Logger: homeassistant.components.automation.presence_simulation_event_test
Source: helpers/script.py:1805
integration: Automation (documentation, issues)
First occurred: 16 March 2024 at 16:39:35 (3 occurrences)
Last logged: 05:53:21

Presence Simulation Event Test: Error executing script. Error for call_service at pos 1: Error rendering data template: UndefinedError: 'dict object' has no attribute 'event'

Also found this that i dont think is directly related
Logger: homeassistant.helpers.frame
Source: helpers/frame.py:156
First occurred: 17 March 2024 at 11:17:10 (2 occurrences)
Last logged: 17 March 2024 at 11:17:10

Detected that custom integration 'presence_simulation' sets "data" directly to update a config entry. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to use async_update_entry instead at custom_components/presence_simulation/init.py, line 456: entry.data = entry.options, please create a bug report at https://github.com/slashback100/presence_simulation/issues

Detected that custom integration 'presence_simulation' sets "options" directly to update a config entry. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to use async_update_entry instead at custom_components/presence_simulation/init.py, line 457: entry.options = {}, please create a bug report at https://github.com/slashback100/presence_simulation/issues

@slashback100
Copy link
Owner

Since you test your automation manually, the trigger will indeed not contain any event.
Concerning the warning, I'll take in charge the adaptation, thanks

@Wright55
Copy link
Author

You advise in your readme that the event is fired, is it possible to check this actually happens.

my only alternative seems to remove the integration and start from the beginning.

@Wright55 Wright55 reopened this Mar 19, 2024
@Wright55
Copy link
Author

Exited my house which automatically triggered my PS.
Additionally the event test automation also activated at the same time, notification received 'Simulation of the entity switch.presence_simulation, homeassistant.turn_off called with following parameters: {entity_id: switch.presence_simulation}'

@slashback100
Copy link
Owner

So it works?
You can verify that the event are well fired with the deveveloment tools: https://www.home-assistant.io/docs/tools/dev-tools/#subscribe-to-an-event

@Wright55
Copy link
Author

Not as i was expecting, my understanding is that it should trigger when one of my lights turns on/off! It only triggered when the automation starting PS action (when i exit my house), no lights were on.
I will see what happens next couple days to see if anything changes when i am out again.

Thanks

@slashback100
Copy link
Owner

It is fired when the simulation starts because the first thing it does is to restore the state of the entities with the states it was x days ago.
But it should also be fired at each simulation.

@Wright55
Copy link
Author

Just to update you.
PS triggered as normal yesterday when I left home during the day. Lights started to activate as expected during the hours of darkness, until returning home and PS ‘stopped" The "change" event did not trigger at all.

@slashback100
Copy link
Owner

Hmm okay I will take a closer look at it asap

slashback100 added a commit that referenced this issue Mar 22, 2024
@slashback100
Copy link
Owner

Ok I did found an issue. For lights, the event was not correctly fired. I fixed it in last commit

@slashback100 slashback100 added bug Something isn't working and removed help wanted labels Mar 22, 2024
@Wright55
Copy link
Author

Will check it out tonight. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants