dawidchyrzynski / arduino-home-assistant

ArduinoHA allows to integrate an Arduino/ESP based device with Home Assistant using MQTT.
https://dawidchyrzynski.github.io/arduino-home-assistant/
GNU Affero General Public License v3.0
489 stars 117 forks source link

Not discovered? #247

Open Ramdough opened 5 months ago

Ramdough commented 5 months ago

Ok, so I am a bit of a newby….but please help.

I have copied your code directly but updated the MAC address, IP number, and unique ID (so it stood out more). My code compiles and writes to the arduino successfully.

I can see my arduino and pig it on the network.

Under MQTT on HA, I am able to publish to myself using the manual publish and listen feature. I have listen set to #, so I am listening to all traffic. So mosquito appears to be working. Discovery is on.

For some reason, I do not get a new sensor created using this code.

What should I try next?

Ramdough commented 5 months ago

Any thoughts anyone?

jwilleke commented 5 months ago

Got any code to share?

Ramdough commented 4 months ago

Got any code to share?

I used this exact binary-sensor example code but changed the MAC address, the unique ID, and the broker IP address.

Ramdough commented 4 months ago

I am using an arduino mega and plan to modify this code to read all dio pins.

romoloman commented 4 months ago

Same on esp32 binary sensor is not discovered but is published on MQTT... (checking with MQTT explorer)

dawidchyrzynski commented 4 months ago

Hi @Ramdough, which version of Home Assistant do you use?

romoloman commented 4 months ago

With version 2.1.0 everything is fine on HA 2024.5.4, but still persist the issue of multiple devices of the same type in the network, so I had to use the develop branch that implements enableExtendedUniqueIds() using the mac address of the esp 32 as device id.

Ramdough commented 4 months ago

Hi @Ramdough, which version of Home Assistant do you use?

I have auto updates so I am always on the latest version.

Ramdough commented 4 months ago

Thanks everyone for helping! I appreciate the support.

proasnet commented 3 months ago

Dear @romoloman , I have the same problem. On my project with ESP32, I have a Wifi connection or Ethernet connection (W5500), switching by user by UI, not in a code, so, ESP has two connections, two clients. I have a two constructors , but one unique ID

HADevice device;
HAMqtt wifi_mqtt( wificlient , device , 20 );
HAMqtt ethernet_mqtt( ethernetclient , device , 20 );

If I disable ethernet

HADevice device;
HAMqtt wifi_mqtt( wificlient , device , 20 );
//HAMqtt ethernet_mqtt( ethernetclient , device , 20 );

Discovery working.

How can I fix this for both instances?

device.enableExtendedUniqueIds() not working for me.

Thank you very much.