本帖最后由 kingmos 于 2021-5-6 11:44 编辑
小白一个,一直是看着论坛各位大侠的葫芦比着画四不像的瓢,受益良多!
马上动手就拆:提醒一下,W380底边的螺丝有个三叉的特异螺丝,需要专用的螺丝刀。 电路板背面如图:
file:///C:/Users/King/AppData/Local/Temp/msohtmlclip1/01/clip_image002.png 和继电器连接:
file:///C:/Users/King/AppData/Local/Temp/msohtmlclip1/01/clip_image004.png
前面板上竟然有大大的5V,莫非夏普早就知道我要改装?
file:///C:/Users/King/AppData/Local/Temp/msohtmlclip1/01/clip_image006.jpg
file:///C:/Users/King/AppData/Local/Temp/msohtmlclip1/01/clip_image008.jpg
现在遇到的问题:
1. 面板上有8个键,nodemcu上使用了:D1,D2,D5,D6,D7,D8, 不够,还差两个,其他接口还有那些能使用而不影响单片机运行呢?
switch: ##设备类型;
- platform: gpio ##平台;
id: air_close ##ID 为继电器开关;
pin: GPIO5
icon: "mdi:fan-off"
name: "air_close"
- platform: gpio ##平台;
id: air_water_open ##ID 为继电器开关;
pin: GPIO4
icon: "mdi:fan-off"
name: "air_water_open"
- platform: gpio ##平台;
id: air_open ##ID 为继电器开关;
pin:
number: GPIO14 ##管脚D5
inverted: no ## inverted 参数,表示高电平有效,即继电器是高电平触发;
icon: "mdi:fan-off"
name: "air_open" ##自定义名称,最好起关联的名称;
- platform: gpio
id: air_kill_open
pin: GPIO12
icon: "mdi:fan"
name: "air_kill_open"
- platform: gpio
id: air_changewind
pin:
number: D7
inverted: no
icon: "mdi:fan"
name: "air_changewind"
- platform: gpio
id: air_lightchange
pin:
number: D8
inverted: no
icon: "mdi:fan"
name: "air_lightchange"
2. 按键应该短按后释放,而switch操纵的继电器按下后会使按键长时间闭合。按照教程,可以使用模板:
- platform: template
name: "Gate Remote"
icon: "mdi:gate"
internal: yes
turn_on_action:
- switch.turn_on: switch_0
- delay: 500ms
- switch.turn_off: switch_0
但没教多个按键怎么写,我就每个都写了一遍:
- platform: template
name: "off1"
icon: "mdi:gate"
internal: yes
turn_on_action:
- switch.turn_on: air_close
- delay: 500ms
- switch.turn_off: air_close
- platform: template
name: "off2"
icon: "mdi:gate"
internal: yes
turn_on_action:
- switch.turn_on: air_water_open
- delay: 500ms
- switch.turn_off: air_water_open
- platform: template
name: "off3"
icon: "mdi:gate"
internal: yes
turn_on_action:
- switch.turn_on: air_open
- delay: 500ms
- switch.turn_off: air_open
- platform: template
name: "off4"
icon: "mdi:gate"
internal: yes
turn_on_action:
- switch.turn_on: air_kill_open
- delay: 500ms
- switch.turn_off: air_kill_open
- platform: template
name: "off5"
icon: "mdi:gate"
internal: yes
turn_on_action:
- switch.turn_on: air_changewind
- delay: 500ms
- switch.turn_off: air_changewind
- platform: template
name: "off6"
icon: "mdi:gate"
internal: yes
turn_on_action:
- switch.turn_on: air_lightchange
- delay: 500ms
- switch.turn_off: air_lightchange
- platform: template
name: "off7"
icon: "mdi:gate"
internal: yes
turn_on_action:
- switch.turn_on: air_Ionswitch
- delay: 500ms
- switch.turn_off: air_Ionswitch
目前是switch已经正常了,可以控制继电器,是按下去的效果,继电器保持闭合,但瞬时开关丝毫没有效果,按键不会在500毫秒后弹起。那位大侠可以解惑?
|