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

 找回密码
 立即注册
123
返回列表 发新帖
楼主: whxciotw

[新奇玩法] 爆改老旧电动晾衣架,使用Sonoff DIY接入

[复制链接]

0

主题

19

帖子

142

积分

注册会员

Rank: 2

积分
142
金钱
123
HASS币
0
发表于 2023-9-6 11:23:53 | 显示全部楼层
感谢楼主几次回复,我昨天重新整理了一下思路,发现自己陷入了误区,重新把上下限位飞线接入了GPIO9和GPIO10,直接当作外接物理开关来用,这样就能完全满足需求了
esphome:
  name: liangyiji
      
esp8266:
  board: esp8285

wifi:
  ssid: lijie
  password: wmjl31gq985140
   # Optional manual IP
  manual_ip:
    static_ip: 192.168.1.240
    gateway: 192.168.1.1
    subnet: 255.255.255.0
  ap:
   ssid: "liangyiji"
   password: ""

api:

logger:

ota:

light:
  - platform: binary
    name: "liangyijiden"
    output: liangyijiden_light
   
output:
  - platform: gpio
    pin: GPIO12
    id: liangyijiden_light  

switch:
  # - platform: gpio
  #   name: "Sonoff 4CH Relay 1"
  #   pin: GPIO12
  # - platform: gpio
  #   name: "Sonoff 4CH Relay 2"
  #   pin: GPIO5
  - platform: gpio
    pin: GPIO4
    interlock: [up]
    id: down
    # name: down
  - platform: gpio
    pin: GPIO5
    id: up
    interlock: [down]
    # name: up

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO3
      mode:
        input: true
        pullup: true
    id: stop
    on_state:
      then:
        - cover.stop: liangyiji


  - platform: gpio
    pin:
      number: GPIO9
      mode:
        input: true
        pullup: true
      inverted: true
    id: shangxian
    on_press:
      then:
        - cover.stop: liangyiji

  - platform: gpio
    pin:
      number: GPIO10
      mode:
        input: true
        pullup: true
      inverted: true
    id: xiaxian
    on_press:
      then:
        - cover.stop: liangyiji
        
cover:
  - platform: endstop
    name: "liangyiji"
    id: liangyiji

    open_action:
      - switch.turn_on: up
    open_duration: 21s
    open_endstop: shangxian

    close_action:
      - switch.turn_on: down
    close_duration: 20s
    close_endstop: xiaxian

    stop_action:
      - switch.turn_off: up
      - switch.turn_off: down
回复

使用道具 举报

1

主题

126

帖子

604

积分

高级会员

Rank: 4

积分
604
金钱
478
HASS币
0
发表于 2023-9-7 08:49:10 | 显示全部楼层
高手  厉害   
回复

使用道具 举报

19

主题

601

帖子

4143

积分

版主

Rank: 7Rank: 7Rank: 7

积分
4143
金钱
3527
HASS币
40
 楼主| 发表于 2023-9-7 14:53:07 | 显示全部楼层
islj5h 发表于 2023-9-6 11:23
感谢楼主几次回复,我昨天重新整理了一下思路,发现自己陷入了误区,重新把上下限位飞线接入了GPIO9和GPIO1 ...

机智!赞!
回复

使用道具 举报

0

主题

34

帖子

174

积分

注册会员

Rank: 2

积分
174
金钱
140
HASS币
0
发表于 2024-2-16 21:13:45 | 显示全部楼层
我用小爱音箱创建了一个自定义设备,对遥控凉衣架进行控制,并创建了常用的命令,用小爱音箱控制,日常使用良好,但有一定的容错。
现在有一新问题:有没有适合架衣架使用的卡片?命令都集成在实体中,没有办法使用卡片管理。在接入homeassistant时,没有办法更好的呈现出各个命令来。
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-6-14 17:10 , Processed in 0.047782 second(s), 24 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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