[BETA] YAMA (Yet Another MQTT App)

Apparently spoke too soon...

Everything worked well for a handful of minutes, then everything screeched to a crawl.
The heartbeat is stuck, and only a couple of my devices are updating regularly.
I'm not sure why some would work, while others don't...

Odd. Obviously there haven't been any app/driver changes. Have you done any hub upgrades since it stopped working (not saying it is a hub problem, but it may help identify what changed).

EDIT: I just checked my dev hub, and I'm only getting heartbeat updates as well. Clearly something in the last hub update broke the app. I'll try to find some time to troubleshoot, but may be a few days.

Thanks. Yeah, I did the most recent (two) updates.
I can wait patiently. Thanks for your work on this.

There is some weird initialization issue. I was able to claw out of it (which means you might too), which may help until I get to a "real" solution.

I did a bunch of stuff, not sure which fixed it.

I did:

  1. YAMA Driver Details
    • Clicked, Disconnect, Connect, ParentComplete (I think this is what may have unstuck it), and Initialize
  2. YAMA App
    • Re-selected my devices, turned on debug logging, and saved app. Just opening, turning on debug logging, and re-saving may have been enough once it was "unstuck" though. It is works you will see all three of these events. If it isn't unstuck you will only see the bottom one:
app:5042022-09-26 10:28:42.866 am debug YAMA app initialization: Complete
app:5042022-09-26 10:28:42.161 am debug YAMA app initialization: Beginning
app:5042022-09-26 10:28:41.127 am debug initialize starting

Now that I've done that, I can't get it back to a broken state again, which I guess is good, but will be hard to fix...

I think the "initialize" is the fix.
I was able to break it again, but Initialize fixed it.
I did:

  1. Disconnect
  2. Connect
  3. Initialize (everything appeared to un-stick)
  4. Then I turned off the debug logging on the driver. (most things got stuck again, but oddly not everything)
  5. Initialize (everything un-stuck again)

It is definitely an app/driver initialization issue.

It breaks every time I reboot the hub too, so the manual intervention is only temporary. I'll look into it some more.

The initial setup/init was always the wonkiest in my code Might be time to actually try and fix it.

YAMA App

  • V0.1.0 - 09/26/22 - Fixed a number of initialization issues.

YAMA Driver

  • V0.2.0 - 09/26/22 - Fixed a number of initialization issues.

@ancker Give these versions a try. Worked much better for me, although there may still be another init issue in the app code I need to chase down. You would need to update both the app and driver code.

I just loaded them, disconnected/connected/initialized.
So far everything looks fine, but I'll report back if things are weird again.

Thanks!

1 Like

Thanks to this amazing mqtt-exporter creator/developer, YAMA is now supported by it, and all the metrics can be exported to prometheus :tada:

mqtt_power{topic="hubitat_home-hub_pc power switch"} 7.0
# HELP mqtt_voltage metric generated from MQTT message.
# TYPE mqtt_voltage gauge
mqtt_voltage{topic="hubitat_home-hub_pc power switch"} 250.0
# HELP mqtt_energy metric generated from MQTT message.
# TYPE mqtt_energy gauge

The result of that: