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

 找回密码
 立即注册
查看: 788|回复: 1

[求助] esphome api连接不上,求助!

[复制链接]

20

主题

120

帖子

770

积分

高级会员

Rank: 4

积分
770
金钱
650
HASS币
0
发表于 2022-10-12 19:41:38 | 显示全部楼层 |阅读模式
跟着论坛代码(https://bbs.hassbian.com/thread-6888-1-1.html)做了一个远程开关,但是api连接不上,各位大佬,有空帮忙看看,谢谢!

                               
登录/注册后可看大图

binary_sensor:
  - platform: homeassistant
    id: fukaiguan
    name: "fukaiguan"
    entity_id: switch.ci_wo_tong_deng
    on_state:
        - if:
            condition:
              binary_sensor.is_on: fukaiguan
            then:
              - switch.turn_on: relay1
              - logger.log: "fukaiguan is on!"
            else:
              - switch.turn_off: relay1
              - logger.log: "fukaiguan is off!"
  - platform: gpio
    id: button_1
    pin:
      number: RX   #接RX GPIO3脚和gnd线与翘板开关相连
      inverted: True
      mode: INPUT_PULLUP
    filters:
       - delayed_on_off: 100ms      
    on_state:
      then:
      - switch.toggle:
         id: relay1

switch:
  - platform: gpio
    name: "test-fuchufangdeng_sw1"
    pin: 0
    id: relay1
    icon: "mdi:ceiling-light"
    on_turn_on:
      - homeassistant.service:
          service: switch.turn_on
          data:
            entity_id: switch.ci_wo_tong_deng
    on_turn_off:
      - homeassistant.service:
          service: switch.turn_off
          data:
            entity_id: switch.ci_wo_tong_deng

回复

使用道具 举报

20

主题

120

帖子

770

积分

高级会员

Rank: 4

积分
770
金钱
650
HASS币
0
 楼主| 发表于 2022-10-12 19:44:11 | 显示全部楼层

忘记截图了

C:\Users\Admin\Desktop\微信图片_20221012194316.png
微信图片_20221012194316.png
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-16 02:07 , Processed in 0.377776 second(s), 26 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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