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

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

[求助] 新手求助,esphome配置始终通不过

[复制链接]

5

主题

322

帖子

1345

积分

金牌会员

Rank: 6Rank: 6

积分
1345
金钱
1023
HASS币
0
发表于 2019-10-15 09:51:42 | 显示全部楼层
完整的:
esphome:
  name: light_led_16
  platform: ESP8266
  board: esp01_1m
  on_boot:
    then:
      - switch.turn_off: sw28121

wifi:
  networks:
  - ssid: !secret wifi_ssid
    password: !secret wifi_password
  - ssid: !secret wifi_ssid1
    password: !secret wifi_password

logger:

ota:
  password: !secret ota_password
api:
#  password: !secret api_password

mqtt:
  broker: !secret mqtt_broker
  username: !secret mqtt_username
  password: !secret mqtt_password
  discovery: True
  discovery_retain: true

switch:
  - platform: gpio
    pin:
      number: GPIO1 # TXD
      inverted: yes #高电平断,低电平合
    id: sw28121
    name: "sw2812_txd"
  
sensor:
  - platform: wifi_signal
    name: "WiFi Signal_led16"
    update_interval: 60s

binary_sensor:
  - platform: gpio
    pin: GPIO0
    id: bs28120
    name: "bs2812_gpio0"
    filters:
      - invert:
    on_multi_click: # 模仿按键
    - timing: #Double Clicked
        - ON for at most 1s
        - OFF for at most 1s
        - ON for at most 1s
        - OFF for at least 0.2s
      then:
        - homeassistant.service:
            service: persistent_notification.create
            data:
              title: "提醒:"
              message: "light_led_16按钮两次按下!!!"
              notification_id: "light_led_16_press"
#              notification_id: !lambda "return now()"
    - timing: #Single Long Clicked
        - ON for 3s to 5s
        - OFF for at least 0.5s
      then:
        - light.turn_off:
            id: ws2812016
    - timing: #Single Short Clicked
        - ON for at most 2s
        - OFF for at least 0.5s
      then:
        - light.turn_on:
            id: ws2812016
            brightness: 100%
            effect: "Color Wipe"
  - platform: gpio
    pin: GPIO3 # RXD
    name: "sw2812_rxd" # 3.3v Sensor
    device_class: motion
    id: sw28123
    filters:
      - invert:
    on_press:
      then:
        - switch.turn_on: sw28121
    on_release:
      then:
        - switch.turn_off: sw28121

light:
  - platform: fastled_clockless
    id: ws2812016
    chipset: WS2812
    pin: GPIO2
    num_leds: 16
    rgb_order: GRB
    name: "ws2812_16"
    effects:
      - random: # Use default parameters:
      - random: # Customize parameters
          name: Slow Random Effect
          transition_length: 20s
          update_interval: 15s
      - random:
          name: Fast Random Effect
          transition_length: 3s
          update_interval: 6s
      - strobe:
      - strobe:
          name: Strobe Effect With Custom Values
          colors:
            - state: True
              brightness: 100%
              red: 100%
              green: 90%
              blue: 0%
              duration: 500ms
            - state: False
              duration: 250ms
            - state: True
              brightness: 100%
              red: 0%
              green: 100%
              blue: 0%
              duration: 500ms
      - flicker:
      - flicker:
          name: Flicker Effect With Custom Values
          alpha: 95%
          intensity: 1.5%
      - addressable_rainbow:
      - addressable_rainbow:
          name: Rainbow Effect With Custom Values
          speed: 10
          width: 50
      - addressable_color_wipe:
      - addressable_color_wipe:
          name: Color Wipe Effect With Custom Values
          colors:
            - red: 100%
              green: 100%
              blue: 100%
              num_leds: 1
            - red: 0%
              green: 0%
              blue: 0%
              num_leds: 1
          add_led_interval: 100ms
          reverse: False
      - addressable_scan:
      - addressable_scan:
          name: Scan Effect With Custom Values
          move_interval: 100ms
      - addressable_twinkle:
      - addressable_twinkle:
          name: Twinkle Effect With Custom Values
          twinkle_probability: 5%
          progress_interval: 4ms
      - addressable_random_twinkle:
      - addressable_random_twinkle:
          name: Random Twinkle Effect With Custom Values
          twinkle_probability: 5%
          progress_interval: 32ms
      - addressable_fireworks:
      - addressable_fireworks:
          name: Fireworks Effect With Custom Values
          update_interval: 32ms
          spark_probability: 10%
          use_random_color: false
          fade_out_rate: 120
      - addressable_flicker:
      - addressable_flicker:
          name: Addressble Flicker Effect
          update_interval: 16ms
          intensity: 5%
      - lambda: #自定义效果
          name: My Lambda Custom Effect
          update_interval: 1s
          lambda: |-
            static int state = 0;
            auto call = id(ws2812016).turn_on();
            // Transtion of 1000ms = 1s
            call.set_transition_length(1000);
            if (state == 0) {
              call.set_rgb(0.5, 0.5, 0.5);
            } else if (state == 1) {
              call.set_rgb(0.0, 1.0, 0.0);
            } else if (state == 2) {
              call.set_rgb(0.0, 0.0, 1.0);
            } else {
              call.set_rgb(1.0, 0.0, 0.0);
            }
            call.perform();
            state += 1;
            if (state == 4)
              state = 0;
一个281216位灯,一个感应器,一个指示灯,一个按钮

回复

使用道具 举报

1

主题

11

帖子

45

积分

新手上路

Rank: 1

积分
45
金钱
34
HASS币
0
 楼主| 发表于 2019-10-15 10:16:10 | 显示全部楼层
netsnake 发表于 2019-10-15 09:51
完整的:一个281216位灯,一个感应器,一个指示灯,一个按钮

谢谢,应该是安装esphome哪里出问题了,大部分带“-”的地方都会报错,但是在别人的外网平台编译都没问题
回复

使用道具 举报

1

主题

11

帖子

45

积分

新手上路

Rank: 1

积分
45
金钱
34
HASS币
0
 楼主| 发表于 2019-10-15 16:28:58 | 显示全部楼层
netsnake 发表于 2019-10-15 09:51
完整的:一个281216位灯,一个感应器,一个指示灯,一个按钮

解决了   是esphome引用的库出问题了导致的
回复

使用道具 举报

175

主题

2967

帖子

7606

积分

超级版主

我就是六神

Rank: 8Rank: 8

积分
7606
金钱
4614
HASS币
398

活跃会员教程狂人灌水之王

QQ
发表于 2020-6-20 18:09:18 | 显示全部楼层
lxmou666 发表于 2019-10-15 16:28
解决了   是esphome引用的库出问题了导致的

怎么解决库问题???
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-25 00:41 , Processed in 0.185387 second(s), 27 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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