I'm running Tasker on my Android phone in an attempt to control lights in my apartment through MQTT via adafruit.io. It works, sometimes. I want to make it work every time, but I don't know what is sporadically failing. As far as I can tell, Tasker and adafruit.io seem to not communicate reliably.
Adafruit and light control
The lights are connected to Nexa 433 MHz outlets, which are controlled by an Adafruit Feather Huzzah board. The board runs code I found on the internet, modified by me, so of course this is a prime candidate for any suspicion. However, the lights come on and off reliably every time that the Adafruit feed shows a new value.
In Tasker, I have a Wifi Near profile with an entry task (Lights On) and an exit task (Lights Off).
The task Lights On uses MQTT Client to do a Publish MQTT Message to io.adafruit.com with topic "user/f/Lights", value 1, QoS 1 and Retained = false. The timeout is set to None.
The task Lights Off uses MQTT Client to do a Publish MQTT Message to io.adafruit.com with topic "user/f/Lights", value 0, QoS 1 and Retained = false. The timeout is set to None.
I have access to two logs - the Adafruit feed history, and the Run log in Tasker.
The Run log appears fine - the Wifi Near profile doesn't always trigger at the same distance from home, but whenever it triggers, the correct entry and exit tasks are run without any indication that anything goes wrong.
The Adafruit feed history does not show all events that the Tasker log indicates should be there. In particular, it seems to receive value 1 (from Lights On, entry task) much more reliably than value 0 (from Lights Off, exit task). It also seems like "the first few attempts" are more likely to fail - if I run the Lights On or Lights Off tasks manually, once I get one successful event to show in Adafruit feed history, it is fairly reliable.
I hope the above info dump is enough to get us started on figuring out what is going wrong, because I'm at a total loss as to how to proceed from here.
shal suggested using another MQTT broker, mentioning flespi. I've used my github account to log in to flespi, but have so far been unable to make a new token for my Android MQTT client to use. No matter how I fill in the Create Token form, I get
/: value does not match to any of the required schemas
helmar suggested posting the logs, but a) I don't have an easy way of moving them from my Android device to a computer to post here and b) they literally say nothing more than "this event triggered, so this task ran, and it worked".
Any further ideas on how to proceed?