diff --git a/.homeychangelog.json b/.homeychangelog.json index bbca1bd..9102382 100644 --- a/.homeychangelog.json +++ b/.homeychangelog.json @@ -578,6 +578,10 @@ "1.5.23": { "en": "Changed app trigger 'entity state changed' to autocomplete field.", "de": "App-Trigger 'Entitäts-Status geändert' zu Autocomplete-Feld geändert." + }, + "1.5.24": { + "en": "Added token for previous state to app trigger 'entity state changed'.", + "de": "Token für vorherigen Status zu App-Trigger 'Entitäts-Status geändert' hinzugefügt." } } diff --git a/.homeycompose/app.json b/.homeycompose/app.json index a824f59..bcb6785 100644 --- a/.homeycompose/app.json +++ b/.homeycompose/app.json @@ -1,6 +1,6 @@ { "id": "io.home-assistant.community", - "version": "1.5.23", + "version": "1.5.24", "compatibility": ">=8.1.0", "sdk": 3, "brandColor": "#0DA6EA", diff --git a/.homeycompose/flow/triggers/event_state_changed_triggered_filter.json b/.homeycompose/flow/triggers/event_state_changed_triggered_filter.json index 4343d05..cd15184 100644 --- a/.homeycompose/flow/triggers/event_state_changed_triggered_filter.json +++ b/.homeycompose/flow/triggers/event_state_changed_triggered_filter.json @@ -32,6 +32,15 @@ "de": "Entitätsstatus", "nl": "Entiteitsstatus" } + }, + { + "name": "state_old", + "type": "string", + "title": { + "en": "Previous entity state", + "de": "Vorheriger Entitätsstatus", + "nl": "Vorige entiteitsstatus" + } } ], "args": [ diff --git a/app.json b/app.json index 86bcb0d..5f87adc 100644 --- a/app.json +++ b/app.json @@ -1,7 +1,7 @@ { "_comment": "This file is generated. Please edit .homeycompose/app.json instead.", "id": "io.home-assistant.community", - "version": "1.5.23", + "version": "1.5.24", "compatibility": ">=8.1.0", "sdk": 3, "brandColor": "#0DA6EA", @@ -630,6 +630,15 @@ "de": "Entitätsstatus", "nl": "Entiteitsstatus" } + }, + { + "name": "state_old", + "type": "string", + "title": { + "en": "Previous entity state", + "de": "Vorheriger Entitätsstatus", + "nl": "Vorige entiteitsstatus" + } } ], "args": [ diff --git a/lib/Client.js b/lib/Client.js index 32645be..76ee8de 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -653,7 +653,8 @@ class Client extends Homey.SimpleClass { // this._app.log("HA event: ", event.event_type, " Entity: ",entityId); let tokens = { entity: event.entity_id, - state: event.new_state.state + state: event.new_state.state, + state_old: event.old_state.state }; let state = { entity: event.entity_id,