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

 找回密码
 立即注册
查看: 2150|回复: 4

[技术探讨] wled如何通过mqtt添加到hass里呢?【已解决】

[复制链接]

9

主题

56

帖子

194

积分

注册会员

Rank: 2

积分
194
金钱
138
HASS币
0
发表于 2021-12-6 09:02:48 | 显示全部楼层 |阅读模式
本帖最后由 qxwo 于 2021-12-6 10:42 编辑

用hass自带的wled集成可以发现设备,但是这种情况貌似需要wled和hass服务器在一个内网下
所以试了下wled自带的mqtt服务,可以连接到mqtt服务器,请问如何在hass里发现设备,还是需要手动添加,有相关的文档或yaml 吗
回复

使用道具 举报

17

主题

183

帖子

1583

积分

金牌会员

Rank: 6Rank: 6

积分
1583
金钱
1400
HASS币
10
发表于 2021-12-6 09:56:43 | 显示全部楼层
# Example configuration.yaml entry
mqtt:
  certificate: "PATH_TO_CA.crt"
  broker: "IP_ADDRESS_BROKER"
  port: 8883
  username: "MQTT_USERNAME"
  password: !secret MQTT_PASSWORD
回复

使用道具 举报

9

主题

56

帖子

194

积分

注册会员

Rank: 2

积分
194
金钱
138
HASS币
0
 楼主| 发表于 2021-12-6 10:16:07 | 显示全部楼层
ztrx 发表于 2021-12-6 09:56
# Example configuration.yaml entry
mqtt:
  certificate: "PATH_TO_CA.crt"

mqtt里可以看到设备了,只是hass里不知道如何添加设备
回复

使用道具 举报

17

主题

183

帖子

1583

积分

金牌会员

Rank: 6Rank: 6

积分
1583
金钱
1400
HASS币
10
发表于 2021-12-6 10:22:55 | 显示全部楼层
# Example configuration.yaml entry
sensor:
  - platform: mqtt
    state_topic: "home/bedroom/temperature"
回复

使用道具 举报

9

主题

56

帖子

194

积分

注册会员

Rank: 2

积分
194
金钱
138
HASS币
0
 楼主| 发表于 2021-12-6 10:41:55 | 显示全部楼层
本帖最后由 qxwo 于 2021-12-6 10:51 编辑

手动添加,已解决https://github.com/Snipercaine/WLED-HomeAssistant
light:
  - platform: mqtt
    name: "WLED Lights"
    command_topic: "wled/all"
    brightness_command_topic: "wled/all"
    rgb_command_topic: "wled/all/col"
    rgb_command_template: "{{ '#%02x%02x%02x' | format(red, green, blue)}}"
    effect_command_topic : "wled/all/api"
    effect_list:
    - "[FX=00] Solid"
    - "[FX=01] Blink"
    - "[FX=02] Breathe"
    - "[FX=03] Wipe"
    - "[FX=04] Wipe Random"
    - "[FX=05] Random Colors"
    - "[FX=06] Sweep"
    - "[FX=07] Dynamic"
    - "[FX=08] Colorloop"
    - "[FX=09] Rainbow"
    - "[FX=10] Scan"
    - "[FX=11] Dual Scan"
    - "[FX=12] Fade"
    - "[FX=13] Chase"
    - "[FX=14] Chase Rainbow"
    - "[FX=15] Running"
    - "[FX=16] Saw"
    - "[FX=17] Twinkle"
    - "[FX=18] Dissolve"
    - "[FX=19] Dissolve Rnd"
    - "[FX=20] Sparkle"
    - "[FX=21] Dark Sparkle"
    - "[FX=22] Sparkle+"
    - "[FX=23] Strobe"
    - "[FX=24] Strobe Rainbow"
    - "[FX=25] Mega Strobe"
    - "[FX=26] Blink Rainbow"
    - "[FX=27] Android"
    - "[FX=28] Chase"
    - "[FX=29] Chase Random"
    - "[FX=30] Chase Rainbow"
    - "[FX=31] Chase Flash"
    - "[FX=32] Chase Flash Rnd"
    - "[FX=33] Rainbow Runner"
    - "[FX=34] Colorful"
    - "[FX=35] Traffic Light"
    - "[FX=36] Sweep Random"
    - "[FX=37] Running 2"
    - "[FX=38] Red & Blue"
    - "[FX=39] Stream"
    - "[FX=40] Scanner"
    - "[FX=41] Lighthouse"
    - "[FX=42] Fireworks"
    - "[FX=43] Rain"
    - "[FX=44] Merry Christmas"
    - "[FX=45] Fire Flicker"
    - "[FX=46] Gradient"
    - "[FX=47] Loading"
    - "[FX=48] In Out"
    - "[FX=49] In In"
    - "[FX=50] Out Out"
    - "[FX=51] Out In"
    - "[FX=52] Circus"
    - "[FX=53] Halloween"
    - "[FX=54] Tri Chase"
    - "[FX=55] Tri Wipe"
    - "[FX=56] Tri Fade"
    - "[FX=57] Lightning"
    - "[FX=58] ICU"
    - "[FX=59] Multi Comet"
    - "[FX=60] Dual Scanner"
    - "[FX=61] Stream 2"
    - "[FX=62] Oscillate"
    - "[FX=63] Pride 2015"
    - "[FX=64] Juggle"
    - "[FX=65] Palette"
    - "[FX=66] Fire 2012"
    - "[FX=67] Colorwaves"
    - "[FX=68] BPM"
    - "[FX=69] Fill Noise"
    - "[FX=70] Noise 1"
    - "[FX=71] Noise 2"
    - "[FX=72] Noise 3"
    - "[FX=73] Noise 4"
    - "[FX=74] Colortwinkle"
    - "[FX=75] Lake"
    - "[FX=76] Meteor"
    - "[FX=77] Smooth Meteor"
    - "[FX=78] Railway"
    - "[FX=79] Ripple"
    - "[FX=80] Twinklefox"
    - "[FX=81] Twinklecat"
    - "[FX=82] Halloween Eyes"

input_select:
  wled_presets:
    options:
      - "[PL=01] Preset 1"
      - "[PL=02] Preset 2"
      - "[PL=03] Preset 3"
      - "[PL=04] Preset 4"
      - "[PL=05] Preset 5"
      - "[PL=06] Preset 6"
      - "[PL=07] Preset 7"
      - "[PL=08] Preset 8"
      - "[PL=09] Preset 9"
      - "[PL=10] Preset 10"
      - "[PL=11] Preset 11"
      - "[PL=12] Preset 12"
      - "[PL=13] Preset 13"
      - "[PL=14] Preset 14"
      - "[PL=15] Preset 15"
      - "[PL=16] Preset 16"

  wled_palette_list:
    options:
      - "[FP=00] Default"
      - "[FP=01] Random Cycle"
      - "[FP=02] Primary color"
      - "[FP=03] Based on primary"
      - "[FP=04] Set colors"
      - "[FP=05] Based on set"
      - "[FP=06] Party"
      - "[FP=07] Cloud"
      - "[FP=08] Lava"
      - "[FP=09] Ocean"
      - "[FP=10] Forest"
      - "[FP=11] Rainbow"
      - "[FP=12] Rainbow bands"
      - "[FP=13] Sunset"
      - "[FP=14] Rivendell"
      - "[FP=15] Breeze"
      - "[FP=16] Red & Blue"
      - "[FP=17] Yellowout"
      - "[FP=18] Analoguous"
      - "[FP=19] Splash"
      - "[FP=20] Pastel"
      - "[FP=21] Sunset 2"
      - "[FP=22] Beech"
      - "[FP=23] Vintage"
      - "[FP=24] Departure"
      - "[FP=25] Landscape"
      - "[FP=26] Beach"
      - "[FP=27] Sherbet"
      - "[FP=28] Hult"
      - "[FP=29] Hult 64"
      - "[FP=30] Drywet"
      - "[FP=31] Jul"
      - "[FP=32] Grintage"
      - "[FP=33] Rewhi"
      - "[FP=34] Tertiary"
      - "[FP=35] Fire"
      - "[FP=36] Icefire"
      - "[FP=37] Cyane"
      - "[FP=38] Light Pink"
      - "[FP=39] Autumn"
      - "[FP=40] Magenta"
      - "[FP=41] Magred"
      - "[FP=42] Yelmag"
      - "[FP=43] Yelblu"
      - "[FP=44] Orange & Teal"
      - "[FP=45] Tiamat"
      - "[FP=46] April Night"
      - "[FP=47] Orangery"
      - "[FP=48] C9"
      - "[FP=49] Sakura"

input_number:
  ledspeed:
    name: Speed
    initial: 0
    min: 0
    max: 255
    step: 1
  ledintensity:
    name: Intensity
    initial: 0
    min: 0
    max: 255
    step: 1
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-27 20:26 , Processed in 0.048379 second(s), 26 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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