Anyone have any good suggestions on how to make a switch to turn_on and turn_off a media_player? I looked at a RESTful Switch, but not sure if it will do what I want. I would like a way to view if it is on then toggle the state to do the opposite.
I can think of a way to use scripts, input_boolean, and templates all in conjunction but I feel like there must be a cleaner way! I have several media_player resources and don’t want a huge collection of code to make it all work. There is a simple on/off button in HASS and there is a service call that can turn_on/turn_off, so I was hoping that this would be easy! Despite me thinking it should be easy I’m not seeing how!
My end goal is to have a single button on my Hadashboard (https://github.com/home-assistant/hadashboard) that will show the state and toggle it. I might end up going the route of making the widget over there if I can’t get it on the HASS side.
I looked at the command line switch and I don’t see a clean way of determining current status. I want to be able to quickly identify if it is on then be able to switch it off if needed… vice versa.
I don’t think that type will matter since I’m intending on going through HASS to make this work. I do have several different media players, but they all use the same on/off/status commands in HASS.
This should create an entity that I add myself into the gui, right? Because I tried this (Modified for my case) and it doesn’t, even when there are no error messages.