After struggling to get MQTT to work with Home Assistant for a few hours, I ultimately stumbled upon the realization that the P2R docs do not match its actual implementation. I assume this is probably just a lapse in desired planning, and actual execution, and maybe forgetting to go back and change it.
To start, here is a picture from the "setup mqtt" push2run docs seen here:
It implies that one needs to place the mqtt topic as the "listen for" value. It also suggests that adding a $ will allow you to pass specifically the mqtt payload through your parameters to whatever you're executing.
e.g. (also my desired functionality)
I would be able to have my broker publish topics such as "push2run/calculator" or "push2run/shutdown" or "push2run/notify" and each one would be set up with a respective card and "listen for". And that for example on "notify" i could pass a payload such as "dinner is ready" and that would pass that payload thru to some notify tool to display the payload.
Using this method I would just set the MQTT option to listen on "push2run/#" and it would pull it all in.
This is what the docs explain to me, and I think it's a superior way for p2r to have handled MQTT. This also aligns better with how MQTT seems to be designed.
But in reality that is not how it works.
The way it actually works, is you set a single topic for push2run to listen on (or as many as you want, it doesnt matter) and only the payload is what activates the cards. This prevents you from being able to pass useful information through on the payload.
e.g. (for anyone who finds this when struggling with HA & P2R like I was) (though honestly, hopefully it changes to match the docs before you see this):
---1. set your mqtt broker to publish to `push2run`
2. set p2r to listen to `push2run`
3. set the Calculator card to listen for the payload `calculator`
4. prepare a message from your mqtt broker to `push2run`, QoS 2, with the payload `calculator`
5. send it
6. The card will run.
I understand that changing push2run to match the existing documentation would break the mqtt install for those who use it, but honestly I think this is a good breaking change. It would work in line with how it was described in Rob's docs and how MQTT is expected to work. (in my experience).
If how P2R's mqtt execution doesnt change, then the docs need to be entirely rewritten to match how it actually works.