shaonianzhentan / node-red-contrib-ha-mqtt

在HomeAssistant中生成MQTT实体
https://github.com/shaonianzhentan/node-red-contrib-ha-mqtt
MIT License
37 stars 19 forks source link

Devices not being Discovered #20

Closed fuzails closed 2 years ago

fuzails commented 2 years ago

Hi I have setup as follows:

Screenshot 2022-05-14 at 14 05 36 Screenshot 2022-05-14 at 14 05 50

The configuration for the entity is:

{ "state_topic": "kitchen/downlights/status", "command_topic": "kitchen/downlights/switch", "brightness_state_topic": "kitchen/downlights/brightness", "brightness_command_topic": "kitchen/downlights/brightness/set" } and have a default entity definition:

{ "qos": 0, "payload_on": "ON", "payload_off": "OFF", "optimistic": false, "brightness": true, "brightness_scale": 100 }

Device is not being discovered in HA or MQTT

Logs show that it does connect: 14 May 14:09:58 - [info] Stopping flows 14 May 14:09:58 - [info] Stopped flows 14 May 14:09:58 - [info] Starting flows 14 May 14:09:58 - [info] Started flows 14 May 14:09:58 - [info] [mqtt-broker:HA MQTT] Connected to broker: mqtt://core-mosquitto:1883

1652527824: New connection from 172.30.32.2:44540 on port 1883.

shaonianzhentan commented 2 years ago

You need to clear the configuration state_topic command_topic brightness_state_topic brightness_command_topic is default config

shaonianzhentan commented 2 years ago

I added a simple example It contains relatively complete functions https://github.com/shaonianzhentan/node-red-contrib-ha-mqtt/blob/main/examples/light.json

fuzails commented 2 years ago

Thanks.