Formatting mqtt button cards

First post so apologies in advance…

I’ve used the mosquito broker add on and mqtt integration to control my magic mirror. I can turn it on/off, change pages, and am working on the brightness control of the screen. The on/off was relatively easy as it is just a light, but the page changes are set up as buttons. Based on my minimal experience, buttons seem to only have a command topic and no state topic, so they don’t hold a state value. This is where my issue arises with the cards on my homepage. I’d like to have the active page (or at least the one pressed last) highlighted. What do you think would be the best option to do this?

  1. Convert all the page changes from buttons to switches so they can subscribe to a state topic?
  2. Some type of automation?
  3. Some type of custom config?
  4. Something else I haven’t even considered?

The provided picture currently shows what the cards look like. The magic mirror is on and on the big calendar page, which is not highlighted.

Any help would be appreciated.

PS. Yes I am aware that my on and off are buttons and not a light card, I’m still working to get the brightness control via mqtt dialed in before making the switch.

1 Like