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

HA shutdown trigger: service doesn't preserve input changes #76765

Closed
ElStupid opened this issue Aug 14, 2022 · 0 comments
Closed

HA shutdown trigger: service doesn't preserve input changes #76765

ElStupid opened this issue Aug 14, 2022 · 0 comments
Labels

Comments

@ElStupid
Copy link

ElStupid commented Aug 14, 2022

The problem

When creating an automation that runs at Home Assistant shutdown (or restart), setting an input boolean to a specific value doesn't work properly. Any input for that matter.

To test this: I did create a helper with input_boolean state set to off, no special configurations. I also created an automation to do the following

  1. Push notification with the current state of an input_boolean helper
  2. Change the value by calling service Boolean input: turn on
  3. Push notification with the current state of an input_boolean helper

From the push notifications I see the value is changed, however not preserved after restart.
This also doesn't work with setting the value to off at first

What version of Home Assistant Core has the issue?

core-2022.8.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

alias: HA shutdown
description: ""
trigger:
  - platform: homeassistant
    event: shutdown
condition: []
action:
  - service: notify.mobile_app_me
    data:
      title: "System shutdown part 1"
      message: >-
        Home Assistant is shutting down. State 1st is {{
        states("input_boolean.recovery_state") }}
  - service: input_boolean.turn_on
    data: {}
    target:
      entity_id: input_boolean.recovery_state
  - service: notify.mobile_app_me
    data:
      title: "System shutdown part 2"
      message: >-
        Home Assistant is shutting down. State now is {{
        states("input_boolean.recovery_state") }}
mode: single

Anything in the logs that might be useful for us?

No response

Additional information

As discussed here: https://community.home-assistant.io/t/add-event-for-ha-restart-to-correctly-detect-power-loss/450087/20
The state preservation seems to happen before the event trigger?

@github-actions github-actions bot added the stale label Sep 13, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant