找回密码
 立即注册

微信扫码登录

搜索
查看: 2424|回复: 1

[求助] MQTT灯光自动发现的状态不可控是什么原因

[复制链接]

1

主题

21

回帖

132

积分

注册会员

积分
132
金钱
109
HASS币
0
发表于 2025-2-2 02:02:54 | 显示全部楼层
var id = "demo_light_21"
msg.topic = "homeassistant/light/" + id + "/config"
msg.payload = {
    '~': 'homeassistant/light/' +id,
    'name':'light_'+id,
    'command_topic':'~/set',
    'state_topic': '~/statre',
    "unique_id": "light_" +id,
    "schema" :"json",
    "payload_on": "ON",
    "payload_off": "OFF"
}
return msg;

你自己对比下吧
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )

GMT+8, 2025-10-13 05:13 , Processed in 0.084380 second(s), 11 queries , MemCached On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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