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

Condition: Last button press at least an hour ago

$
0
0

@dantist wrote:

I have an automation that I would like to add a condition to. The last press of a specific Hue Smart Button must be at least an hour ago. Normally I would use something like that:

    - condition: template
      value_template: >
        {{ (as_timestamp(now()) - as_timestamp(state_attr('remote.hue_smart_button_1','last_triggered'))) > 3600 }}

But the Smart Button doesn’t have “last_triggered”. Instead it has “last_updated”, which is an array:

[2020-05-27], [18:37:08]

How can I concatenate both array-entries to make them work with the as_timestamp-function? Or is there an even easier way to check for the last button press?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 99217

Trending Articles



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