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

Connection loss after a certain time with homeassistant #19

Closed nabbl closed 2 years ago

nabbl commented 2 years ago

Hi there,

So there seems to be a problem with connection loss to home assistant after a certain time, usually a day or so. It seems to be working again as soon as I "redeploy" my node-red config via the UI, or when I restart node-red completely.

When I don't do this all the auto generated entities in homeassistant stop working. Any fix for this issue? Might be somethig on my end ?

shaonianzhentan commented 2 years ago

There are two ways to generate entities in home assistant

  1. Send configuration information during deployment
  2. Receive the mqtt online status sent when homeassistant starts

If the home assistant loses the entity and does not notify this node, it cannot be used again

You need to use the Auto Discovery nodes and trigger it to tell it to resend the configuration


You can regularly trigger Auto Discovery node to solve this problem, but it will put pressure on your mqtt service

nabbl commented 2 years ago

Thank you for the fast reply. I had the Auto Discovery node but no trigger on it as I thought that would work automagically. Thx!