Skip to content

add user_id of scheduler device with scheduler.run_action #482

Description

@agentmnm

Checklist

  • [ check! ] I checked for similar existing requests (both open and closed) before posting.
  • [ check! ] My request is generic, other users may benefit from it too.

Proposal

I propose that when a scheduled action is triggered, that the scheduler-component code is adding the edit: parent_id of the scheduler device, so one can read out who triggered the action of the entity in an automation.

Additional info

in my example I want to know who switched on / off or changed the temperature of a smart thermostat of a radiator. I have entities of the climate domain.
I am reading out the user_id (in an automation (that gets triggered when the climate entity changes)

Now, when I or an other user changes the thermostat via the HA-interface then I can read back the user_id with the statement

actions:
  - action: notify.persistent_notification
    metadata: {}
    data:
      message: >-
        {{ trigger.to_state.context.id }}, {{ trigger.to_state.context.parent_id }}, {{ trigger.to_state.context.user_id }}

In case a person changes it directly at the physical thermostat then it results in none as expected.

Unfortunately I also read back none when the scheduler executed the action of changing or switching on / off the thermostat.

It would be really helpful to know if the scheduler switched a device on or off, or a user did that.
This way you could pause further scheduled events of the entity for a period of time, or for the rest of the day or so...

Thanks and best regards, Martin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions