Hi,
I have 2 light dimmers setup over MQTT ( ESP32 and MOSFET to switch and dim LEDs).
Also, I have temperature sensor with ESP8266 that reports data over MQTT.
All setups uses my own code I wrote in ArduinoIDE and upload to devices.
Everything worked flawlessly for almost half year.
Yesterday all stooped working.
Other non MQTT integrations seems to work fine even though I don’t have much of integrations.
But TV, phones, RaspPi statistic it works ok.
This is example of my mqtt light in HA:
- platform: mqtt
name: "Kitchen"
availability_topic: "/light/kitchen/availability"
state_topic: "/light/kitchen/state"
command_topic: "/light/kitchen/state/set"
brightness_state_topic: "/light/kitchen/brightness"
brightness_command_topic: "/light/kitchen/brightness/set"
payload_on: "ON"
payload_off: "OFF"
Arduino code uses PubSubClient library, #include "PubSubClient.h"
I use static IP address for those devices like so:
// WiFi Static IP example
IPAddress staticIP(192,168,0,X);
IPAddress gateway(192,168,0,X);
IPAddress subnet(255,255,255,0);
IPAddress dns1(X,X,X,X);
IPAddress dns2(X,X,X,X);
I try to ping device from my PC and it worked ok.
Than I took one of ESP32 boards and connect to arduinoIDE serial monitor for debugging.
I didn’t noticed any problems there.
Board connected to MQTT server and subscribed on topics, but when I would try to turn on light through HA light button device didn’t receive MQTT message for that.
Next, I try to publish and listen topics manually in HA Mosquitto, btw, I am using Mosquitto broker add on in HA.
But I can listen topics on which I subscribe properly there.
I would appreciate some help with troubleshooting of this.
Since I currently need to figgure out how should I troubleshoot this further.
I don’t think that there is any problem with HW, i.e. devices itself, since it is not likely that all 3 devices stop working at the same time.