Two questions about devices: EspEasy+MQTT, and Xiaomi PM2.5 Monitor

I spent quite a bit of time in the past few days and I am now almost happy with my HA setup :slight_smile: However…

  1. I have a Sonoff Basic (WiFi) connected to my night light. I used to control it using Domoticz (http), but as I moved to HA, I now use MQTT. Took a while to set up, but seems to be working now. However, the switch has poor WiFi signal and loses MQTT broker connection from time to time - it then flips the GPIO to zero (and switches off the light). Has anyone had this issue? I use Retain=true on both EspEasy and HA. Should I switch to Generic HTTP (EspEasy) + RESTApi (HA)?
  2. One of the devices I have is a Xiaomi portable PM2.5 Air Quality Monitor - which works fine in HA, but I keep it off most of the time. As a result, the reading in HA ‘badge’ is usually ‘Unavailable’, and it also floods my log with failed connect attempts. Is there a way to show the last value in sensor? And disable logging? Or would you advise me to remove the device from HA altogether?

OK, I’ll respond to myself on the first thing (MQTT+EspEasy), as it might help someone :slight_smile:

So, when the EspEasy Sonoff was losing MQTT broker connection (due to weak WiFi signal), it would then restore the state based on the last MQTT message (disregarding the fact that I manually switched the state using the button afterwards). This is why it woke me a few times last night - the light would switch on a few times.

I think I have it sorted out now - I had to set ‘retain: false’ in the switch configuration in configuration.yaml. It seems like the problems are gone now.