I’m trying to wrap my head around, but i have no idea how to do this:
I want to ask Alexa or Google Home the room temperature, taking the readings from the DHT22 sensor plugged on my raspberry pi.
The sensor itself is set up and works perfectly on my HA setup.
I run a script and make the script viewable to Google Home via the Google Actions component. It’s not the most elegant, but it works.
Using Google’s “shortcuts” you can outline different phrases you might say to ask about the temperature. For example, I can say “Hey Google, what’s the temperature in the garage” or “Hey Google, what’s the garage temp?” and GH will say okay, activating “Garage Temperature” and then tell me the temperature.
Here’s the script I run, and you can use this for multiple sensors (I also use for garage door sensor to know if I left it up, etc).
garage_temp:
alias: "Garage Temperature"
sequence:
- service: tts.google_say
entity_id: media_player.family_room_speaker
data_template:
message: 'The garage temperature is {{ states("sensor.garage_temp") }} degrees'
cache: false