请选择 进入手机版 | 继续访问电脑版

『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 4448|回复: 5

[新奇玩法] 分享一个笨方法的晾衣架自动化,联动洗衣机

[复制链接]

11

主题

270

帖子

3019

积分

论坛元老

Rank: 8Rank: 8

积分
3019
金钱
2749
HASS币
10
发表于 2021-1-12 00:32:27 | 显示全部楼层 |阅读模式
本帖最后由 roc227 于 2021-1-12 00:31 编辑

硬件:
阳台插的小米网关(用于接入传感器和判断阳台流明),晾衣架门磁2个(根据晾衣架两侧X结构,判断晾衣架是升起还是降到某预置位置),博联(用于发射晾衣架的射频),小米插座(用于采集洗衣机功率),洗衣机门磁1个

虚拟状态:
流明700(switch.lux700)和流明800(switch.lux800)(作为判断黑天和白天的分界点),普通洗衣模式(switch.wash),洗衣机烘干模式(switch.washdry)

几个基础自动化:
根据流明判断当前是白天还是黑天
#流明低于800
- alias: lux800low
  trigger:
    - platform: numeric_state
      entity_id: sensor.illumination_78
      below: '800'
  action:
    - service: switch.turn_on
      entity_id: switch.lux800

#流明高于800
- alias: lux800high
  trigger:
    - platform: numeric_state
      entity_id: sensor.illumination_78
      above: '800'
  condition:
    condition: time
    after: '00:04:00'
    before: '9:30:00'
  action:
    - service: switch.turn_off
      entity_id: switch.lux800
    - service: switch.turn_off
      entity_id: switch.lux700

      

#流明低于700
- alias: lux700low
  trigger:
    - platform: numeric_state
      entity_id: sensor.illumination_78
      below: '700'
  action:
    - service: switch.turn_on
      entity_id: switch.lux700


根据功率判断洗衣机当前为普通洗衣状态,开门后需要晾衣服(比如大于100W),打开洗衣虚拟状态
根据功率判断洗衣机当前为烘干状态,开门后不需要晾衣服(比如大于800W),打开烘干虚拟状态
洗衣虚拟状态或烘干虚拟状态打开时,打开洗衣机门后,复归洗衣机状态至停机(洗衣机两个虚拟状态为关)

#烘干状态
- alias: washdry
  trigger:
    - platform: numeric_state
      entity_id: switch.plug_15
      value_template: '{{ state.attributes.load_power }}'
      above: '800'
  action:
    - service: switch.turn_on
      entity_id: switch.washdry
    - service: switch.turn_off
      entity_id: switch.wash

#复归洗衣
- alias: restwash
  trigger:
    - platform: state
      entity_id: binary_sensor.door_window_sensor_15
      from: 'off'
      to: 'on'
  condition:
    condition: or
    conditions:
      - condition: state
        entity_id: switch.wash
        state: 'on'
      - condition: state
        entity_id: switch.washdry
        state: 'on'
  action:
  #复归洗衣模式
    - delay:
        seconds: 0.5
    - service: switch.turn_off
      entity_id: switch.wash
   #复归烘干模式
    - delay:
        seconds: 0.8
    - service: switch.turn_off
      entity_id: switch.washdry


开始联动了:
洗衣机停机状态下,因为洗机衣两个虚拟状态都是关闭状态,晾衣架不会动作。
普通洗完,打开门,降下晾衣架,延时恢复至升起前状态(其中晚上会把窗帘打开一半,打开晾衣架灯)。
烘干洗完,因为因为洗机衣两个虚拟状态都是打开状态,晾衣架不会动作。

#晚上降晾衣架
- alias: bondnightdown
  trigger:
    - platform: state
      entity_id: binary_sensor.door_window_sensor_15
      from: 'off'
      to: 'on'
  condition:
    condition: and
    conditions:
      - condition: state
        entity_id: switch.lux700
        state: 'on'
      - condition: state
        entity_id: switch.wash
        state: 'on'
  action:
    #开一半客厅纱帘
    - service: cover.set_cover_position
      data:
        entity_id: cover.curtain_15
        position: 30
    #开一半客厅窗帘
    - delay:
        seconds: 1
    - service: cover.set_cover_position
      data:
        entity_id: cover.curtain_15
        position: 30
  #开晾衣架灯
    - delay:
        seconds: 2
    - service: switch.turn_on
      entity_id: switch.bondlight
   #降晾衣架
    - delay:
        seconds: 2
    - service: switch.turn_on
      entity_id: switch.bondupdown
    - service: hello_miai.force_send
      data_template:
        message: "正在为您降下晾衣架"
        miai_num: "3"  
   #停降晾衣架
    - delay:
        seconds: 18
    - service: switch.turn_off
      entity_id: switch.bondstop
   #升晾衣架
    - delay:
        seconds: 280
    - service: switch.turn_off
      entity_id: switch.bondupdown
  #关晾衣架灯
    - delay:
        seconds: 2
    - service: switch.turn_off
      entity_id: switch.bondlight
    - service: hello_miai.force_send
      data_template:
        message: "正在为您升起晾衣架"
        miai_num: "3"  
    #关客厅纱帘
    - delay:
        seconds: 2
    - service: cover.set_cover_position
      data:
        entity_id: cover.curtain_15
        position: 0
    #关客厅窗帘
    - delay:
        seconds: 2
    - service: cover.set_cover_position
      data:
        entity_id: cover.curtain_15
        position: 0


#白天降晾衣架
- alias: bonddown
  trigger:
    - platform: state
      entity_id: binary_sensor.door_window_sensor_15
      from: 'off'
      to: 'on'
  condition:
    condition: and
    conditions:
      - condition: state
        entity_id: switch.lux700
        state: 'off'
      - condition: state
        entity_id: switch.wash
        state: 'on'
  action:
   #降晾衣架
    - delay:
    - service: switch.turn_on
      entity_id: switch.bondupdown
    - service: hello_miai.force_send
      data_template:
        message: "正在为您降下晾衣架"
        miai_num: "3"  
   #停降晾衣架
    - delay:
        seconds: 15
    - service: switch.turn_off
      entity_id: switch.bondstop
   #升晾衣架
    - delay:
        seconds: 290
    - service: switch.turn_off
      entity_id: switch.bondupdown
    - service: hello_miai.force_send
      data_template:
        message: "正在为您升起晾衣架"
        miai_num: "3"  
还做了一个按钮,白天按一下降下晾衣架,延时升起或者再按一下升起。晚上按一下,降晾衣架+开一半窗帘+打开晾衣架灯,延时恢复或再按一下恢复。
[size=15.008px] 微信图片_20210112001949.png

评分

参与人数 1金钱 +20 收起 理由
+ 20 感谢楼主分享!

查看全部评分

回复

使用道具 举报

0

主题

10

帖子

142

积分

注册会员

Rank: 2

积分
142
金钱
132
HASS币
0
发表于 2021-3-4 18:55:21 来自手机 | 显示全部楼层
正好有个别的问题不完美,可以通过楼主的思路解决,蟹蟹
回复

使用道具 举报

32

主题

1929

帖子

4881

积分

论坛元老

Rank: 8Rank: 8

积分
4881
金钱
2952
HASS币
50
QQ
发表于 2021-3-4 19:00:19 | 显示全部楼层
厉害了,膜拜
我不生产技术,我只是技术的搬运工。
回复

使用道具 举报

6

主题

191

帖子

980

积分

高级会员

Rank: 4

积分
980
金钱
789
HASS币
0
发表于 2021-3-6 13:47:30 | 显示全部楼层
大神,我给你磕头了。。。。。牛X
回复

使用道具 举报

0

主题

19

帖子

142

积分

注册会员

Rank: 2

积分
142
金钱
123
HASS币
0
发表于 2023-8-9 17:14:42 | 显示全部楼层
膜拜大神
回复

使用道具 举报

0

主题

121

帖子

896

积分

高级会员

Rank: 4

积分
896
金钱
775
HASS币
0
发表于 2023-8-20 06:33:07 | 显示全部楼层
学习了,谢谢分享
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-3-19 19:29 , Processed in 0.056529 second(s), 32 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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