7

Overview

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.

Android setup

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.

The logs

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.

What now?

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.


Update 1

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

/[0]: 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?

4
  • May be you should interconnect your phone and apartment via MQTT broker where you have an access to logs? It can be any of servers deployed and managed by you or you can try any public MQTT broker with logs, e.g. flespi (list of log events).
    – shal
    Apr 5, 2018 at 11:14
  • Are these logs confidential? Otherwise you might want to share relevant parts. Otherwise it will be quite tricky to figure this out.
    – Helmar
    Apr 5, 2018 at 14:53
  • /[0]: value does not match to any of the required schemas You need to specify something in either 'expire ' nor 'ttl' field.
    – shal
    Apr 11, 2018 at 12:45
  • can you share your code
    – Raj
    Sep 27, 2019 at 17:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.