When I am cooking I use my voice to tell my Google Mini to turn on / off the (shelly) relay to control the lights , and to play the internet radio station I like to listen to (Google plays it from RadioApp).
I have HA setup and could use it the app to do this, but I don’t usually have my phone / device handy when cooking.
Question 1
What I would like to do is stop having to speak and instead have a physical button to turn the lights on / off and another one for the radio. I am thinking I could make a simple arduino / esp32 device.
My question is what code or api can I call to turn on / of the relay and is it possible to make an api call to tell google to play the radio station from RadioApp? (I suspect the later is not possible?).
Any code examples would be brilliant!!!
Question 2
On a similar theme, for my local makers shed we would like to be able to have only members who are trained on certain machines to use them. Am thinking each member has an RFID tag and only if the tag is in a list of trained users for that machine then the smart relay is switched on.
Again, am thinking esp32. The code would be similar to that for Q1 but, after reading the rdif tag, I would need to look up the rfid tag number in a central list. My question is what’s the easiest way to create this webservice? Can it be easily created in HA?
Again, any code examples would be most appreciated!
Buy Alexa devices.
(Sorry, but you gave me a straight line that I couldn’t resist).
Oh, gee- another straight line…
I’ll resist for now.
You could buy a Zigbee button or two (and a Zigbee dongle if you don’t have one yet) and use that to trigger an automation in Home Assistant to toggle your lights. You could even have automations for short-press and long-press
Turning a relay on/off is Home Assistant 101 and there’s dozens of ways to do it and hundreds of YouTube videos.
I can’t help with telling Google to play a radio station because we are an Alexa house. (And yes, it can be done with Alexa).
Alexa is more “native” to Home Assistant than Google, so finding solutions using Alexa is a bit easier. Since you haven’t gotten any Google-specific replies to your question, I would assume that no one here has done any of what you are asking. For example, I have a Zigbee button in the kitchen that triggers an automation that announces to all Alexa devices: “Dinner in ten minutes”, then sets a timer on the Echo Show on my desktop.