Reading failed reported states

Hello!
I’m currently working on an issue with a device I have. It randomly sends messages in the wrong format, and I need to be alerted when it happens.

To make things clear, this is the kind of error that will appear in the app log:

Unfortunately, I can’t seem to find a way of triggering something with this message. The only plausible nodes available are the MQTT Trigger and Device: State Trigger
image
But there’s not exactly a “state” being reported and the MQTT trigger doesn’t subscribe to private topics.
image

I also tried, from the Losant API node, to get the app logs and device logs, but no relevant information is returned.

Is there currently a way of using error messages as triggers? Can I read past error messages?

Thanks in advance!

One thing you can catch here is that the Device: State Trigger should fire, but with an empty data object in this particular case. It won’t have the raw payload (your “Test” string) but this would at least tell you that something went wrong by checking if the data object has 0 keys in it.

But this a good use case. I’m running it by the team now and will see if there is a better solution we can offer.

Actually, in some cases (depending on the format of the message you’re sending) this may not fire the Device: State Trigger. My mistake.

I’ll follow up if I can come up with a better recommendation.

1 Like