Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Cannot trigger automation on event

$
0
0

@Kelli wrote:

Hi all
I am trying to setup a very simple automation which should trigger on a button push of a Friends Of Hue switch. For the integration of the switch, I use the “Hue sensor advanced” integration from HACS, however I don’t think my issue is related to that integration.

I can observe the event which I’m trying to listen to in the event listener, it looks as follows:

{
    "event_type": "state_changed",
    "data": {
        "entity_id": "remote.schalter",
        "old_state": {
            "entity_id": "remote.schalter",
            "state": "left_upper_release",
            "attributes": {
                "last_updated": [
                    "2020-02-23",
                    "20:12:20"
                ],
                "last_button_event": "left_upper_release",
                "friendly_name": "Schalter",
                "icon": "mdi:light-switch",
                "supported_features": 0
            },
            "last_changed": "2020-02-23T20:12:20.079984+00:00",
            "last_updated": "2020-02-23T20:12:20.079984+00:00",
            "context": {
                "id": "45bc2685c7274f14a9c00ec131cf3f54",
                "parent_id": null,
                "user_id": null
            }
        },
        "new_state": {
            "entity_id": "remote.schalter",
            "state": "left_upper_release",
            "attributes": {
                "last_updated": [
                    "2020-02-24",
                    "15:11:30"
                ],
                "last_button_event": "left_upper_release",
                "friendly_name": "Schalter",
                "icon": "mdi:light-switch",
                "supported_features": 0
            },
            "last_changed": "2020-02-24T15:11:30.057561+00:00",
            "last_updated": "2020-02-24T15:11:30.057561+00:00",
            "context": {
                "id": "2cf27fb6365345fd8f8bf0389984cd1c",
                "parent_id": null,
                "user_id": null
            }
        }
    },
    "origin": "LOCAL",
    "time_fired": "2020-02-24T15:11:30.057649+00:00",
    "context": {
        "id": "2cf27fb6365345fd8f8bf0389984cd1c",
        "parent_id": null,
        "user_id": null
    }
}

I prepared the following trigger section of the automation, however it doesn’t trigger at all:

platform: event
event_type: state_changed
event_data:
  entity_id: remote.schalter
  new_state:
    state: left_upper_release

The following simplified version of the trigger behaves as expected; it triggers on all state changes of the switch:

platform: event
event_type: state_changed
event_data:
  entity_id: remote.schalter

I feel like I I’m missing out on a basic concept of the trigger structure. In general, how can I generate a YAML automation from the output of the event log?

Edit: typo

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>