diff --git a/blueprints/controllers/ikea_e1524_e1810/ikea_e1524_e1810.yaml b/blueprints/controllers/ikea_e1524_e1810/ikea_e1524_e1810.yaml index 74a3e6f8..7fa453eb 100644 --- a/blueprints/controllers/ikea_e1524_e1810/ikea_e1524_e1810.yaml +++ b/blueprints/controllers/ikea_e1524_e1810/ikea_e1524_e1810.yaml @@ -436,13 +436,13 @@ action: {%- elif integration_id == "zha" -%} {{ trigger.event.data.command }}{{"_" if trigger.event.data.args|length > 0}}{{ trigger.event.data.args|join("_") }} {%- endif -%} - trigger_delta: '{{ (as_timestamp(now()) - as_timestamp((states(helper_last_controller_event) | from_json).last_triggered if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{(\".*\": \".*\"(, )?)*\}$")) else "1970-01-01 00:00:00")) * 1000 }}' - last_controller_event: '{{ (states(helper_last_controller_event) | from_json).trigger_action if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{(\".*\": \".*\"(, )?)*\}$")) else "" }}' + trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event) | from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else as_timestamp("1970-01-01 00:00:00"))) * 1000 }}' + last_controller_event: '{{ (states(helper_last_controller_event) | from_json).a if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else "" }}' # update helper - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":trigger_action,"last_triggered":now()|string} | to_json }}' + value: '{{ {"a":trigger_action,"t":as_timestamp(now())} | to_json }}' # choose the sequence to run based on the received button event - choose: - conditions: '{{ trigger_action | string in button_left_short }}' @@ -459,7 +459,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event @@ -542,7 +542,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event @@ -625,7 +625,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event @@ -708,7 +708,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event @@ -791,7 +791,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event diff --git a/blueprints/controllers/ikea_e1743/ikea_e1743.yaml b/blueprints/controllers/ikea_e1743/ikea_e1743.yaml index 0cd63776..9f390469 100644 --- a/blueprints/controllers/ikea_e1743/ikea_e1743.yaml +++ b/blueprints/controllers/ikea_e1743/ikea_e1743.yaml @@ -277,13 +277,13 @@ action: {%- elif integration_id == "zha" -%} {{ trigger.event.data.command }}{{"_" if trigger.event.data.args|length > 0}}{{ trigger.event.data.args|join("_") }} {%- endif -%} - trigger_delta: '{{ (as_timestamp(now()) - as_timestamp((states(helper_last_controller_event) | from_json).last_triggered if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{(\".*\": \".*\"(, )?)*\}$")) else "1970-01-01 00:00:00")) * 1000 }}' - last_controller_event: '{{ (states(helper_last_controller_event) | from_json).trigger_action if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{(\".*\": \".*\"(, )?)*\}$")) else "" }}' + trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event) | from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else as_timestamp("1970-01-01 00:00:00"))) * 1000 }}' + last_controller_event: '{{ (states(helper_last_controller_event) | from_json).a if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else "" }}' # update helper - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":trigger_action,"last_triggered":now()|string} | to_json }}' + value: '{{ {"a":trigger_action,"t":as_timestamp(now())} | to_json }}' # choose the sequence to run based on the received button event - choose: - conditions: '{{ trigger_action | string in button_up_short }}' @@ -300,7 +300,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event @@ -383,7 +383,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event diff --git a/blueprints/controllers/ikea_e1744/ikea_e1744.yaml b/blueprints/controllers/ikea_e1744/ikea_e1744.yaml index 56aa56c2..633498ae 100644 --- a/blueprints/controllers/ikea_e1744/ikea_e1744.yaml +++ b/blueprints/controllers/ikea_e1744/ikea_e1744.yaml @@ -239,13 +239,13 @@ action: {%- elif integration_id == "zha" -%} {{ trigger.event.data.command }}{{"_" if trigger.event.data.args|length > 0}}{{ trigger.event.data.args|join("_") }} {%- endif -%} - trigger_delta: '{{ (as_timestamp(now()) - as_timestamp((states(helper_last_controller_event) | from_json).last_triggered if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{(\".*\": \".*\"(, )?)*\}$")) else "1970-01-01 00:00:00")) * 1000 }}' - last_controller_event: '{{ (states(helper_last_controller_event) | from_json).trigger_action if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{(\".*\": \".*\"(, )?)*\}$")) else "" }}' + trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event) | from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else as_timestamp("1970-01-01 00:00:00"))) * 1000 }}' + last_controller_event: '{{ (states(helper_last_controller_event) | from_json).a if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else "" }}' # update helper - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":trigger_action,"last_triggered":now()|string} | to_json }}' + value: '{{ {"a":trigger_action,"t":as_timestamp(now())} | to_json }}' # choose the sequence to run based on the received button event - choose: - conditions: '{{ trigger_action | string in rotate_left }}' diff --git a/blueprints/controllers/ikea_e1766/ikea_e1766.yaml b/blueprints/controllers/ikea_e1766/ikea_e1766.yaml index 87a58f8c..df255816 100644 --- a/blueprints/controllers/ikea_e1766/ikea_e1766.yaml +++ b/blueprints/controllers/ikea_e1766/ikea_e1766.yaml @@ -216,13 +216,13 @@ action: {%- elif integration_id == "zha" -%} {{ trigger.event.data.command }}{{"_" if trigger.event.data.args|length > 0}}{{ trigger.event.data.args|join("_") }} {%- endif -%} - trigger_delta: '{{ (as_timestamp(now()) - as_timestamp((states(helper_last_controller_event) | from_json).last_triggered if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{(\".*\": \".*\"(, )?)*\}$")) else "1970-01-01 00:00:00")) * 1000 }}' - last_controller_event: '{{ (states(helper_last_controller_event) | from_json).trigger_action if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{(\".*\": \".*\"(, )?)*\}$")) else "" }}' + trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event) | from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else as_timestamp("1970-01-01 00:00:00"))) * 1000 }}' + last_controller_event: '{{ (states(helper_last_controller_event) | from_json).a if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else "" }}' # update helper - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":trigger_action,"last_triggered":now()|string} | to_json }}' + value: '{{ {"a":trigger_action,"t":as_timestamp(now())} | to_json }}' # choose the sequence to run based on the received button event - choose: - conditions: '{{ trigger_action | string in button_up_short }}' @@ -239,7 +239,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event @@ -306,7 +306,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event diff --git a/blueprints/controllers/ikea_e1812/ikea_e1812.yaml b/blueprints/controllers/ikea_e1812/ikea_e1812.yaml index a1d37c0e..c82cea8a 100644 --- a/blueprints/controllers/ikea_e1812/ikea_e1812.yaml +++ b/blueprints/controllers/ikea_e1812/ikea_e1812.yaml @@ -212,12 +212,12 @@ action: {%- elif integration_id == "zha" -%} {{ trigger.event.data.command }}{{"_" if trigger.event.data.args|length > 0}}{{ trigger.event.data.args|join("_") }} {%- endif -%} - trigger_delta: '{{ (as_timestamp(now()) - as_timestamp((states(helper_last_controller_event) | from_json).last_triggered if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{(\".*\": \".*\"(, )?)*\}$")) else "1970-01-01 00:00:00")) * 1000 }}' + trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event) | from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else as_timestamp("1970-01-01 00:00:00"))) * 1000 }}' # update helper - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":trigger_action,"last_triggered":now()|string} | to_json }}' + value: '{{ {"a":trigger_action,"t":as_timestamp(now())} | to_json }}' # choose the sequence to run based on the received button event - choose: - conditions: '{{ trigger_action | string in button_short }}' @@ -234,7 +234,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event diff --git a/blueprints/controllers/ikea_ictc_g_1/ikea_ictc_g_1.yaml b/blueprints/controllers/ikea_ictc_g_1/ikea_ictc_g_1.yaml index af8ec4a0..74e28c6e 100644 --- a/blueprints/controllers/ikea_ictc_g_1/ikea_ictc_g_1.yaml +++ b/blueprints/controllers/ikea_ictc_g_1/ikea_ictc_g_1.yaml @@ -209,13 +209,13 @@ action: {%- elif integration_id == "zha" -%} {{ trigger.event.data.command }}{{"_" if trigger.event.data.args|length > 0}}{{ trigger.event.data.args|join("_") }} {%- endif -%} - trigger_delta: '{{ (as_timestamp(now()) - as_timestamp((states(helper_last_controller_event) | from_json).last_triggered if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{(\".*\": \".*\"(, )?)*\}$")) else "1970-01-01 00:00:00")) * 1000 }}' - last_controller_event: '{{ (states(helper_last_controller_event) | from_json).trigger_action if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{(\".*\": \".*\"(, )?)*\}$")) else "" }}' + trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event) | from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else as_timestamp("1970-01-01 00:00:00"))) * 1000 }}' + last_controller_event: '{{ (states(helper_last_controller_event) | from_json).a if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else "" }}' # update helper - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":trigger_action,"last_triggered":now()|string} | to_json }}' + value: '{{ {"a":trigger_action,"t":as_timestamp(now())} | to_json }}' # choose the sequence to run based on the received button event - choose: - conditions: '{{ trigger_action | string in rotate_left }}' diff --git a/blueprints/controllers/osram_ac025xx00nj/osram_ac025xx00nj.yaml b/blueprints/controllers/osram_ac025xx00nj/osram_ac025xx00nj.yaml index 915efc9f..935796a8 100644 --- a/blueprints/controllers/osram_ac025xx00nj/osram_ac025xx00nj.yaml +++ b/blueprints/controllers/osram_ac025xx00nj/osram_ac025xx00nj.yaml @@ -338,12 +338,12 @@ action: {%- elif integration_id == "zha" -%} {{ trigger.event.data.command }} {%- endif -%} - trigger_delta: '{{ (as_timestamp(now()) - as_timestamp((states(helper_last_controller_event) | from_json).last_triggered if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{(\".*\": \".*\"(, )?)*\}$")) else "1970-01-01 00:00:00")) * 1000 }}' + trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event) | from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else as_timestamp("1970-01-01 00:00:00"))) * 1000 }}' # update helper - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":trigger_action,"last_triggered":now()|string} | to_json }}' + value: '{{ {"a":trigger_action,"t":as_timestamp(now())} | to_json }}' # choose the sequence to run based on the received button event - choose: - conditions: '{{ trigger_action | string in button_up_short }}' @@ -360,7 +360,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event @@ -440,7 +440,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event @@ -520,7 +520,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event diff --git a/blueprints/controllers/philips_324131092621/philips_324131092621.yaml b/blueprints/controllers/philips_324131092621/philips_324131092621.yaml index 27cce35c..11c88306 100644 --- a/blueprints/controllers/philips_324131092621/philips_324131092621.yaml +++ b/blueprints/controllers/philips_324131092621/philips_324131092621.yaml @@ -401,12 +401,12 @@ action: {%- elif integration_id == "zha" -%} {{ trigger.event.data.command }} {%- endif -%} - trigger_delta: '{{ (as_timestamp(now()) - as_timestamp((states(helper_last_controller_event) | from_json).last_triggered if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{(\".*\": \".*\"(, )?)*\}$")) else "1970-01-01 00:00:00")) * 1000 }}' + trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event) | from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else as_timestamp("1970-01-01 00:00:00"))) * 1000 }}' # update helper - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":trigger_action,"last_triggered":now()|string} | to_json }}' + value: '{{ {"a":trigger_action,"t":as_timestamp(now())} | to_json }}' # choose the sequence to run based on the received button event - choose: - conditions: '{{ trigger_action | string in button_on_short }}' @@ -423,7 +423,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event @@ -503,7 +503,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event @@ -583,7 +583,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event @@ -663,7 +663,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event diff --git a/blueprints/controllers/philips_8718699693985/philips_8718699693985.yaml b/blueprints/controllers/philips_8718699693985/philips_8718699693985.yaml index 786d15e0..70b0aad8 100644 --- a/blueprints/controllers/philips_8718699693985/philips_8718699693985.yaml +++ b/blueprints/controllers/philips_8718699693985/philips_8718699693985.yaml @@ -189,12 +189,12 @@ action: {%- elif integration_id == "zha" -%} {{ trigger.event.data.command }} {%- endif -%} - trigger_delta: '{{ (as_timestamp(now()) - as_timestamp((states(helper_last_controller_event) | from_json).last_triggered if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{(\".*\": \".*\"(, )?)*\}$")) else "1970-01-01 00:00:00")) * 1000 }}' + trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event) | from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else as_timestamp("1970-01-01 00:00:00"))) * 1000 }}' # update helper - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":trigger_action,"last_triggered":now()|string} | to_json }}' + value: '{{ {"a":trigger_action,"t":as_timestamp(now())} | to_json }}' # choose the sequence to run based on the received button event - choose: - conditions: '{{ trigger_action | string in button_short }}' @@ -211,7 +211,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event diff --git a/blueprints/controllers/philips_929002398602/philips_929002398602.yaml b/blueprints/controllers/philips_929002398602/philips_929002398602.yaml index 462168dd..4adaa58e 100644 --- a/blueprints/controllers/philips_929002398602/philips_929002398602.yaml +++ b/blueprints/controllers/philips_929002398602/philips_929002398602.yaml @@ -386,12 +386,12 @@ action: {%- elif integration_id == "zha" -%} {{ trigger.event.data.command }} {%- endif -%} - trigger_delta: '{{ (as_timestamp(now()) - as_timestamp((states(helper_last_controller_event) | from_json).last_triggered if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{(\".*\": \".*\"(, )?)*\}$")) else "1970-01-01 00:00:00")) * 1000 }}' + trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event) | from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else as_timestamp("1970-01-01 00:00:00"))) * 1000 }}' # update helper - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":trigger_action,"last_triggered":now()|string} | to_json }}' + value: '{{ {"a":trigger_action,"t":as_timestamp(now())} | to_json }}' # choose the sequence to run based on the received button event - choose: - conditions: '{{ trigger_action | string in button_on_short }}' @@ -408,7 +408,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event @@ -488,7 +488,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event @@ -568,7 +568,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event @@ -648,7 +648,7 @@ action: - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":"double_press","last_triggered":now() | string} | to_json }}' + value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' # run the double press action # fire the event - event: ahb_controller_event diff --git a/blueprints/controllers/xiaomi_wxcjkg11lm/xiaomi_wxcjkg11lm.yaml b/blueprints/controllers/xiaomi_wxcjkg11lm/xiaomi_wxcjkg11lm.yaml index cee6dc42..943f723c 100644 --- a/blueprints/controllers/xiaomi_wxcjkg11lm/xiaomi_wxcjkg11lm.yaml +++ b/blueprints/controllers/xiaomi_wxcjkg11lm/xiaomi_wxcjkg11lm.yaml @@ -273,12 +273,12 @@ action: {%- elif integration_id == "zha" -%} {{ trigger.event.data.command }} {%- endif -%} - trigger_delta: '{{ (as_timestamp(now()) - as_timestamp((states(helper_last_controller_event) | from_json).last_triggered if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{(\".*\": \".*\"(, )?)*\}$")) else "1970-01-01 00:00:00")) * 1000 }}' + trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event) | from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else as_timestamp("1970-01-01 00:00:00"))) * 1000 }}' # update helper - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":trigger_action,"last_triggered":now()|string} | to_json }}' + value: '{{ {"a":trigger_action,"t":as_timestamp(now())} | to_json }}' # choose the sequence to run based on the received button event - choose: - conditions: '{{ trigger_action | string in button_1_short }}' diff --git a/blueprints/controllers/xiaomi_wxcjkg12lm/xiaomi_wxcjkg12lm.yaml b/blueprints/controllers/xiaomi_wxcjkg12lm/xiaomi_wxcjkg12lm.yaml index 6af411a7..701e32d0 100644 --- a/blueprints/controllers/xiaomi_wxcjkg12lm/xiaomi_wxcjkg12lm.yaml +++ b/blueprints/controllers/xiaomi_wxcjkg12lm/xiaomi_wxcjkg12lm.yaml @@ -413,12 +413,12 @@ action: {%- elif integration_id == "zha" -%} {{ trigger.event.data.command }} {%- endif -%} - trigger_delta: '{{ (as_timestamp(now()) - as_timestamp((states(helper_last_controller_event) | from_json).last_triggered if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{(\".*\": \".*\"(, )?)*\}$")) else "1970-01-01 00:00:00")) * 1000 }}' + trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event) | from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else as_timestamp("1970-01-01 00:00:00"))) * 1000 }}' # update helper - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":trigger_action,"last_triggered":now()|string} | to_json }}' + value: '{{ {"a":trigger_action,"t":as_timestamp(now())} | to_json }}' # choose the sequence to run based on the received button event - choose: - conditions: '{{ trigger_action | string in button_1_short }}' diff --git a/blueprints/controllers/xiaomi_wxcjkg13lm/xiaomi_wxcjkg13lm.yaml b/blueprints/controllers/xiaomi_wxcjkg13lm/xiaomi_wxcjkg13lm.yaml index 8674ed36..885f1fa6 100644 --- a/blueprints/controllers/xiaomi_wxcjkg13lm/xiaomi_wxcjkg13lm.yaml +++ b/blueprints/controllers/xiaomi_wxcjkg13lm/xiaomi_wxcjkg13lm.yaml @@ -553,12 +553,12 @@ action: {%- elif integration_id == "zha" -%} {{ trigger.event.data.command }} {%- endif -%} - trigger_delta: '{{ (as_timestamp(now()) - as_timestamp((states(helper_last_controller_event) | from_json).last_triggered if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{(\".*\": \".*\"(, )?)*\}$")) else "1970-01-01 00:00:00")) * 1000 }}' + trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event) | from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else as_timestamp("1970-01-01 00:00:00"))) * 1000 }}' # update helper - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":trigger_action,"last_triggered":now()|string} | to_json }}' + value: '{{ {"a":trigger_action,"t":as_timestamp(now())} | to_json }}' # choose the sequence to run based on the received button event - choose: - conditions: '{{ trigger_action | string in button_1_short }}' diff --git a/blueprints/controllers/xiaomi_wxkg11lm/xiaomi_wxkg11lm.yaml b/blueprints/controllers/xiaomi_wxkg11lm/xiaomi_wxkg11lm.yaml index 9d9bd7b2..077ef782 100644 --- a/blueprints/controllers/xiaomi_wxkg11lm/xiaomi_wxkg11lm.yaml +++ b/blueprints/controllers/xiaomi_wxkg11lm/xiaomi_wxkg11lm.yaml @@ -193,12 +193,12 @@ action: {%- elif integration_id == "zha" -%} {{ trigger.event.data.command }}{{"_" if trigger.event.data.args|length > 0}}{{ trigger.event.data.args|join("_") }} {%- endif -%} - trigger_delta: '{{ (as_timestamp(now()) - as_timestamp((states(helper_last_controller_event) | from_json).last_triggered if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{(\".*\": \".*\"(, )?)*\}$")) else "1970-01-01 00:00:00")) * 1000 }}' + trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event) | from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else as_timestamp("1970-01-01 00:00:00"))) * 1000 }}' # update helper - service: input_text.set_value data: entity_id: !input helper_last_controller_event - value: '{{ {"trigger_action":trigger_action,"last_triggered":now()|string} | to_json }}' + value: '{{ {"a":trigger_action,"t":as_timestamp(now())} | to_json }}' # choose the sequence to run based on the received button event - choose: - conditions: '{{ trigger_action | string in button_short }}'