找回密码
 立即注册
查看: 1085|回复: 1

[求助] 求自动化怎么写

[复制链接]

45

主题

407

回帖

1657

积分

金牌会员

积分
1657
金钱
1204
HASS币
0
发表于 2023-4-12 08:47:14 | 显示全部楼层 |阅读模式
如果在22点到1点这个时间段内,只要我在家1小时以上,就运行一个动作。
怎么写。
回复

使用道具 举报

hyq 

5

主题

467

回帖

2122

积分

金牌会员

积分
2122
金钱
1650
HASS币
0
发表于 2023-4-12 09:57:03 | 显示全部楼层
trigger:
  - platform: time_pattern
    minutes: /1
action:
   - choose:
      - conditions:
          - "{{  now() >= today_at(\"22:00\") or now() <= today_at(\"1:00\") }}"
          - >-
            {{ ((as_timestamp(now())
            -as_timestamp(states.device_tracker.ikuai_xxxx))/60)|float|
            round(0)>= 60 and is_state('device_tracker.ikuai_xxxx','home') }}
         sequence:
          - service: xxxx
            target:
              entity_id: xxxx
            data: {}
         
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )

GMT+8, 2025-5-7 04:43 , Processed in 0.338786 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表