找回密码
 立即注册
查看: 6699|回复: 4

风扇定时关闭【延时开关】【自动化】

[复制链接]

219

主题

1070

回帖

8044

积分

超级版主

积分
8044
金钱
6725
HASS币
86

教程狂人论坛风云人物突出贡献

发表于 2017-11-6 14:27:26 | 显示全部楼层 |阅读模式
本帖最后由 lidicn 于 2017-11-6 20:31 编辑
input_number:
  fan_timer:
    name: fan timer
    initial: 0
    min: 0
    max: 120
    step: 10

input_boolean:
  ven_fan_switch:
    name: fan switch
    initial: off
    icon: mdi:fan

automation:
  - alias: fan start
    trigger:
      platform: numeric_state
      entity_id: input_number.fan_timer
      above: '1'
    action:
      service: input_boolean.turn_on
      entity_id: input_boolean.ven_fan_switch

  - alias: fan end
    trigger:
      platform: numeric_state
      entity_id: input_number.fan_timer
      below: '1'
    action:
      service: input_boolean.turn_off
      entity_id: input_boolean.ven_fan_switch

  - alias: fan countdown
    trigger:
      platform: time
      minutes: '/10'
      seconds: 0
    condition:
      condition: numeric_state
      entity_id: input_number.fan_timer
      above: '1'
    action:
      service: input_number.set_value
      entity_id: input_number.fan_timer
      data_template:
        value: '{{ states("input_number.fan_timer") | int -10 }}'
回复

使用道具 举报

 

123

主题

4548

回帖

1万

积分

管理员

囧死

积分
16548
金钱
11792
HASS币
45
发表于 2017-11-6 20:29:35 | 显示全部楼层
还有这种操作?
回复

使用道具 举报

1

主题

41

回帖

153

积分

论坛分享达人

积分
153
金钱
111
HASS币
0
发表于 2017-11-6 22:43:41 | 显示全部楼层
能具体些吗
回复

使用道具 举报

0

主题

16

回帖

81

积分

注册会员

积分
81
金钱
65
HASS币
0
发表于 2017-12-16 21:08:18 | 显示全部楼层
小米风扇是吗???
回复

使用道具 举报

2

主题

148

回帖

1038

积分

金牌会员

积分
1038
金钱
888
HASS币
0
发表于 2017-12-17 21:04:54 | 显示全部楼层
不错哦,跟我的思路一样。
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2025-5-3 12:56 , Processed in 0.081481 second(s), 24 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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