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

 找回密码
 立即注册
查看: 1031|回复: 6

[技术探讨] 捡垃圾插排修改固件

[复制链接]

36

主题

172

帖子

1386

积分

金牌会员

Rank: 6Rank: 6

积分
1386
金钱
1214
HASS币
0
发表于 2023-12-14 22:22:33 | 显示全部楼层 |阅读模式
本帖最后由 wodepiqi 于 2023-12-14 22:24 编辑

substitutions:
  node_name: cmcc-powerboard
  node_id: cmcc_powerboard
  node_name_friendly: ${node_name}
esphome:
  name: ${node_name}

esp8266:
  board: esp_wroom_02
  restore_from_flash: false  

wifi:
  ap:
    ssid: "Hotspot"
    password: "12345678"

captive_portal:

logger:
    level: DEBUG
api:
ota:

web_server:
  port: 80

#插排电源按钮
binary_sensor:
  - platform: gpio
    name: button_按钮
    internal: true
    pin:
      number: 4
      inverted: true
      mode:
        input: true
        pullup: true
    on_press:
      then:
        - switch.toggle: switch_button

#通电指示灯
light:
  - platform: binary
    name: "light_电源指示灯"
    id: light_power_status_output_gpio5
    output: poweron_output_gpio5
    internal: true
  - platform: binary
    name: "buled"
    internal: true
    output: buled1
    id: "buled"
  - platform: binary
    name: "redled"
    internal: true
    output: redled1
    id: "redled"

interval:
  - interval: 1s
    then:
      if:
        condition:
          wifi.connected:
        then:
          - light.turn_on: buled
          - light.turn_off: redled
        else:
          - light.turn_off: buled
          - light.turn_on: redled
output:
  - platform: gpio
    id: output_gpio15
    pin:
      number: 15
      inverted: true
  - platform: gpio
    id: "buled1"
    pin: GPIO16
    inverted: true
  - platform: gpio
    id: "redled1"
    pin: GPIO14
    inverted: true

  - id: poweron_output_gpio5
    platform: gpio
    pin:
      number: 5
      inverted: true
button:
  - platform: output
    name: "button_按钮"
    id: button_output_gpio15
    output: output_gpio15
    duration: 50ms
    internal: true

switch:
  #虚拟开关
  - platform: template
    name: switch_assemble
    id: switch_button
    restore_mode: RESTORE_DEFAULT_ON
    lambda: |-
      return id(switch_gpio0).state ? true: false;

    turn_on_action:
      - switch.turn_on: switch_gpio0
      - switch.turn_on: switch_gpio12
      - light.turn_on: light_power_status_output_gpio5
    turn_off_action:
      - switch.turn_off: switch_gpio12
      - switch.turn_off: switch_gpio0
      - light.turn_off: light_power_status_output_gpio5
  #干路继电器
  - platform: gpio
    name: switch_1
    id: switch_gpio0
    pin:
      number: 0
      inverted: true
    on_turn_on:
      then:
        - button.press: button_output_gpio15
    on_turn_off:
        - button.press: button_output_gpio15

  #分路继电器
  - platform: gpio
    name: switch_2
    id: switch_gpio12
    pin:
      number: 12
      inverted: true
    on_turn_on:
      then:
        - button.press: button_output_gpio15
    on_turn_off:
        - button.press: button_output_gpio15
#重启
  # - platform: restart
  #   name: "${node_name_friendly}-Restart"
  #   id: ${node_id}_restart
  # #重置
  # - platform: factory_reset
  #   name: ${node_name}-factory-reset
  #   id: ${node_id}_factory_reset


1.zip

1.05 KB, 下载次数: 17

评分

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

查看全部评分

回复

使用道具 举报

1

主题

86

帖子

876

积分

高级会员

Rank: 4

积分
876
金钱
790
HASS币
0
发表于 2023-12-15 10:54:44 | 显示全部楼层
大佬,可否公布以下型号呢
回复

使用道具 举报

50

主题

1316

帖子

5016

积分

论坛DIY达人

积分
5016
金钱
3700
HASS币
20
发表于 2023-12-15 11:22:47 | 显示全部楼层
本帖最后由 sorrypqa 于 2023-12-15 11:25 编辑

谢谢分享!现在对使用8266和普通继电器的插排没兴趣(家里10来个4控插排本身每年要消耗300度电),现在都用怕了,准备打板搞ESP32+多路磁保持继电器改装普通插排
回复

使用道具 举报

113

主题

1660

帖子

5213

积分

元老级技术达人

积分
5213
金钱
3548
HASS币
30
发表于 2023-12-15 16:31:37 | 显示全部楼层
sorrypqa 发表于 2023-12-15 11:22
谢谢分享!现在对使用8266和普通继电器的插排没兴趣(家里10来个4控插排本身每年要消耗300度电),现在都用 ...

你这样,可以省电吗?多搞2套呗,我想要,
回复

使用道具 举报

50

主题

1316

帖子

5016

积分

论坛DIY达人

积分
5016
金钱
3700
HASS币
20
发表于 2023-12-15 22:09:59 | 显示全部楼层
本帖最后由 sorrypqa 于 2023-12-15 22:12 编辑
bugensui 发表于 2023-12-15 16:31
你这样,可以省电吗?多搞2套呗,我想要,

16路50A磁保持继电器的控制器,全开平均耗电0.5W,如果是16路30A普通继电器的控制器全开耗电16W,这就差别,我之前买的4控插排,全开耗电4W左右,我的锐龙笔记本上网听歌耗电才9W,这破插排耗电4W,这怎么忍受???
回复

使用道具 举报

0

主题

2

帖子

20

积分

新手上路

Rank: 1

积分
20
金钱
18
HASS币
0
发表于 2023-12-16 00:55:21 | 显示全部楼层
楼主用的什么编程看着不错能告诉我一下吗
回复

使用道具 举报

0

主题

21

帖子

432

积分

中级会员

Rank: 3Rank: 3

积分
432
金钱
411
HASS币
0
发表于 2023-12-17 20:24:27 | 显示全部楼层
用的esphome
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-22 22:06 , Processed in 0.373625 second(s), 32 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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