Lovelace: Mini Media Player

I tried searching here to see if it’s already been mentioned but couldn’t find anything. The toggle_power option solved my problem.

I have a media player that doesn’t have an on/off remote control so I control it with a smart plug (basically a RPi that’s always on and connected to a retro audio player that only has manual buttons). I combined these two devices into a universal media player.

The problem was then that MMP would correctly show the on/off state but the power button wouldn’t do anything. I started at the bottom of the stack by calling the various power services directly and discovered that the on/off service calls worked as expected but not the toggle. After checking the code for the universal media player it looks like one of the internal functions will return early based on the fact that there’s no active children (in my case, only one child). The normal turn on/off works because there is an override set.

That’s when I learnt about MMP’s option to force whether to use the toggle service or not: Setting toggle_power: false solved the issue.