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

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

[硬件DIY] Lenovo smartPlug se-341a智能插座刷固件接入HomeAssistant

[复制链接]

1

主题

19

帖子

109

积分

注册会员

Rank: 2

积分
109
金钱
90
HASS币
0
QQ
发表于 2024-2-6 16:25:54 | 显示全部楼层 |阅读模式
本帖最后由 orangetree 于 2024-2-6 16:42 编辑

在咸鱼上买的联想插座,App已不能用,到手拆机后刷esphome固件,已可以接入HomeAssistant,还要完善,时间控制功能还没有。
gpio5是控制继电器,gpio12是控制蓝色LED,gpio4是按键。

<font _mstmutation="1"><font _mstmutation="1">esphome:
  name: smartplug2
  friendly_name: smartplug2

esp8266:
  board: esp07

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "****************" #esphome自动生成

ota:
  password: "88888888"  #自己设置的密码

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Smartplug2"   #自己设置的AP名称
    password: "88888888"  #自己设置的密码

captive_portal:

# web_server调试时用,可取消。
web_server:
  port: 80

binary_sensor:
- platform: gpio
  pin:
    number: GPIO4
    mode:
      input: true
      pullup: true
    inverted: true
  name: "smartplug Button"
  on_press:
    - switch.toggle: relay
- platform: status
  name: "smartplug Status"


switch:
  - platform: gpio
    name: "smartplug Relay"
    pin: GPIO5
    id: relay

output:
  # Register the green LED as a dimmable output ....
  - platform: esp8266_pwm
    id: smartplug_blue_led
    pin:
      number: GPIO12
      inverted: true

light:
  # ... and then make a light out of it.
  - platform: monochromatic
    name: "smartplug Green LED"
    output: smartplug_blue_led</font></font></font></font></font>





插座由10个卡扣固定

插座由10个卡扣固定

发现插座

发现插座

输入AP密码

输入AP密码

连接上插座

连接上插座

选择WiFi进行配网

选择WiFi进行配网

输入WiFi密码

输入WiFi密码
回复

使用道具 举报

13

主题

405

帖子

2453

积分

金牌会员

Rank: 6Rank: 6

积分
2453
金钱
2048
HASS币
0
发表于 2024-2-6 17:39:39 来自手机 | 显示全部楼层
时间控制功能用hh自动化不就好了
回复

使用道具 举报

0

主题

80

帖子

619

积分

高级会员

Rank: 4

积分
619
金钱
539
HASS币
0
发表于 2024-4-4 19:09:05 | 显示全部楼层
开关状态和灯不联动
回复

使用道具 举报

9

主题

106

帖子

543

积分

高级会员

Rank: 4

积分
543
金钱
437
HASS币
0
发表于 2024-4-4 19:23:34 | 显示全部楼层
这个我也有


web_server:
  port: 80
  auth:
    username: !secret web_server_username
    password: !secret web_server_password

time:
  - platform: homeassistant
    id: ha_time
    timezone: "Asia/Shanghai"

text_sensor:
  - platform: wifi_info
    ip_address:
      name: "IP"
      id: id_sensor_ip
      icon: mdi:ip

sensor:
  - platform: wifi_signal
    name: "WiFi Signal Sensor"
    update_interval: 60s

button:
  - platform: restart
    name: "Restart"

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO4
      mode: INPUT_PULLUP
      inverted: True
    name: "Smart Plug Button"
    on_press:
      - switch.toggle: relay
      

switch:
  - platform: gpio
    pin: GPIO5
    name: "Switch"
    id: relay
    on_turn_on:
     then: 
      - light.turn_on: indicator_light
    on_turn_off:
      then: 
        - light.turn_off: indicator_light

light:
  - platform: binary
    name: "Indicator Light"
    id: indicator_light
    output: relay_led

  - platform: status_led
    name: "Switch Status"
    pin: 
      number: GPIO14 #红色指示灯
      inverted: true
      
output:
  - platform: gpio
    pin:
      number: GPIO12 ##蓝色指示灯
      inverted: true
    id: relay_led


回复

使用道具 举报

0

主题

80

帖子

619

积分

高级会员

Rank: 4

积分
619
金钱
539
HASS币
0
发表于 2024-4-4 21:06:16 | 显示全部楼层
xjol 发表于 2024-4-4 19:09
开关状态和灯不联动

我的问题搞定
回复

使用道具 举报

0

主题

80

帖子

619

积分

高级会员

Rank: 4

积分
619
金钱
539
HASS币
0
发表于 2024-4-4 21:09:11 | 显示全部楼层

谢谢提供
回复

使用道具 举报

43

主题

1317

帖子

5411

积分

论坛元老

Rank: 8Rank: 8

积分
5411
金钱
4089
HASS币
20
发表于 2024-4-4 21:43:31 | 显示全部楼层
时间可以用esphome输入配合time组件,实现输入控制
折腾精神永存,感恩感谢论坛每一位愿意分享和帮助过我的大佬,论坛有你更精彩
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

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

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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