Skip to content

Advise needed. #44

Answered by oywino
oywino asked this question in Q&A
Mar 13, 2021 · 3 comments · 7 replies
Discussion options

You must be logged in to vote

This is how I solved it:

alias: Daily Action
description: ' '
trigger:
  - platform: state
    entity_id: sensor.lastactive
condition:
  - condition: template
    value_template: >-
      {% if as_timestamp(states.sensor.lastactive.last_changed) |
      timestamp_custom('%H') == '07' %}true{% else %}false{% endif %}
action:
  - service: switch.turn_on
    target:
      entity_id: switch.action
  - delay:
      hours: 0
      minutes: 60
      seconds: 0
      milliseconds: 0
mode: single

The above automation will only trigger once within the 7th hour of each day.

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@sleevezipper
Comment options

@Hankanman
Comment options

@Hankanman
Comment options

@Hankanman
Comment options

@sleevezipper
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by sleevezipper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants