搞定了:https://community.home-assistant.io/t/automation-using-counters/156454/17
counter:
stairs_motion_count:
name: Stairs Motion Count
initial: 0
step: 1
timer:
stairs_motion_timer:
duration: '00:01:00'
- id: '1576869751187'
alias: 'Reset counter when timer expires.'
trigger:
platform: event
event_type: timer.finished
event_data:
entity_id: timer.stairs_motion_timer
action:
service: counter.reset
entity_id: counter.stairs_motion_count
- id: '1576869741194'
alias: 'Increase Counter and start/restart timer on motion'
description: Motion in Stairs Counter
trigger:
platform: state
entity_id: binary_sensor.commonstairs_movement
from: 'off'
to: 'on'
action:
- entity_id: counter.stairs_motion_count
service: counter.increment
- entity_id: timer.stairs_motion_timer
service: timer.start
- conditon: numeric_state
entity_id: counter.stairs_motion_count
above: 1
- <font color="Red">action you want to do if count > 1</font>
|