I have been experimenting with Stringify. Asside from having to say “ok, google. tell stringify…”, its works a lot better than IFTTT. You can string a lot of triiggers and actions together.
You can use the maker component to call scripts in HA Good alternative to IFTTT
I’ve just done this by setting up the demo switch component that creates two switches (all I needed); switch.ac and switch.decorative_lights.
I’ve added an automation that turns these switches on and then straight off again after calling a script that reads either the garage door status or the pool temperature. The switches, customization and automations are all held in a package which is below.
I’ve then added switch.ac and switch.decorative_lights to both Alexa and Google Home and then created shortcuts in Google Home for “is the garage door open or closed” which fires “turn on garage status” and “what’s the pool temperature” that fires “turn on pool status” Works for me!
P.S Here is one of the scripts. Going to see if they’ll stick inside the package too.
pool_status:
alias: 'Check Pool Temperature'
sequence:
- service: tts.google_say
entity_id: media_player.gaming_room_home
data_template:
message: >-
The pool temperature is currently {{states('sensor.pool_temperature')}} degrees
Hi Sir
My name is Mubeen i am an electrical engineer and working with Google Home Mini.
i want that google Home read my sensor data like
i ask what is the voltage and power factor in phase 1
and speak out the value .
I have zero knowledge of IFFT and Google home i am just learning it .
lease guide me step by step . i will be very thankful to you for this favor.
Regards
Mubeen
Thank you for the response Sir
i just bought the Google home mini and watching videos from you tube to integrate it with my circuit .
this is very new thing for me please guide me
thank you
Hi, I’ve read you can use Home Assistant integrated TTS (Google Assistant - GA) to check the garage door status and report it to Home Assistant (HA).
I have an AC switche recognized by Google Home (GH) -Google Assistant (GS) but not by HA. I’m able to command it via HA using a script:
#Switch Google Home
- platform: command_line
switches:
filtro_piscina:
command_on: "/usr/bin/curl -X GET http://192.168.1.110:5000/command?message=accendi%20filtro%20piscina"
command_off: "/usr/bin/curl -X GET http://192.168.1.110:5000/command?message=spegni%20filtro%20piscina"`
I’d like to “ask” to GA the status of the “filtro_piscina” switch and report it to HA in order to have a different icon or something similar.
Could you help me? Thanks a lot!
You can do it that way, I did the same for being able to check/open/close the garage door with a switch. But you unfortunately have to use on/off as the state not open/closed.
You can create shortcuts in GA to recognise you saying ‘Open the garage door’ or ‘Is the garage door closed’, and translate that to what is required for switches being ‘Turn on the Garage Door’ or ‘Is the Garage Door turned on?’.
Not quite sure what you mean when you say Google can ‘see’ your switch but Home Assistant can’t. You could look into creating a template switch for your command line switch which may be better and simpler than my method and template switches show up in both Google and Alexa inside the HA cloud.
You need to get to a point where HA knows the state of your ‘filtro_piscina’ and when it does, you can then use my method to query Google by asking Google to turn on a fake switch. The fake switch could be the new template switch which I’m going to try at some point.
It will be something like EWeLink which has native Google Assistant support but is not supported by HA without setting up IFTTT and binary switches/sensors or flashing with Tasmota
Meross switch has a native Google Home support, Home Assistant none.
So, I have to use Google Assistant Webserver with HA in order to create a switch in HA, using text command, as I wrote. So I have the possibility to use the Meross in HA.
But this method gives no feedback about switch state on or off.
So how can I “ask” to GA via GH? You wrote about a script for the garage, but you didn’t published it. Could you post it?
The garage script is exactly the same as the pool one except with a different entitiy ID. Have Google home read out sensor state when asked? - #24 by xbmcnut. When I did this, Google and Alexa could only control switches so you need to be able to get a switch into Home Assistant that you can voice control then you run a script when that switch is activated. I believe now that you might be able to get Google (and Alexa) to control input_booleans and if so, that would be easier.
So the steps are:
Have the device you need to get the feedback on reporting its state to Home Assistant.
Create a fake switch that you can turn on with voice control. (My method, input_boolean if controllable with Google/Alexa or maybe a template switch).
Use that fake switch to run a script that grabs the value from your device and reads it aloud using the TTS engine.
I just played around with creating a bogus switch and it works.
switch:
- platform: template
switches:
pool_status:
friendly_name: "Ask Google for the Pool Temperature"
value_template: "{{ is_state('input_boolean.pool_status', 'on') }}"
turn_on:
service: script.pool_status
turn_off:
service: script.none
There is no input_boolean defined and no script called script.none but no errors throw up and it works a treat. Turning on this switch reads out the pool temperature and the switch turns itself off ready to use again. Much easier than setting up the whole demo platform.
Welcome to any ideas on a better way to set up a fake switch.
Furthermore, I have confirmed input_boolean function directly within Google Home and Alexa via the HA cloud. No need for fake switches at all. Here is a high tide example which gets Google or Alexa to tell me the time of the next high tide. Cool.
input_boolean:
next_high_tide:
name: Next high tide by Google
icon: mdi:swim
script:
speak_next_high_tide:
alias: 'Ask Google for next High Tide time'
sequence:
- service: tts.google_say
entity_id:
- media_player.kitchen_home
- media_player.gaming_room_home
data_template:
message: >-
The next high tide is at {{ as_timestamp(states.sensor.onetaunga_bay_tides.attributes.high_tide_time_utc) | timestamp_custom("%H:%M") }}
automation:
- alias: 'Check Next High Tide'
trigger:
- platform: state
entity_id: input_boolean.next_high_tide
from: 'off'
to: 'on'
action:
- delay:
seconds: 2
- service: script.turn_on
entity_id: script.speak_next_high_tide
- service: input_boolean.turn_off
entity_id: input_boolean.next_high_tide
Lastly, say “OK Google, sync my devices” to add the input_boolean in and discover devices in Alexa to have it added there. Then give the device a nickname in each platform and create a routine in Google so you can ask for the high tide using different phrases.
Is there a way that you can turn on the input_boolean without it responding “sure turning on …” I thought that was the point of doing it with a boolean and not just exposing the script to GH. Otherwise you could just make sure that scripts is exposed to Google like this.
google_assistant:
project_id: something_something
api_key: <its mine and I'm not telling>
exposed_domains:
- switch
- light
- group
- script
With scripts you can just say “Turn on …” or “activate …” and GH responds with “sure, Activating …” but I want to just have my TTS and not that part.
Not sure what you’re looking for, but if you want a customized request and response, you could use IFTTT, and say something like “what is the current water temperature?”.
As for the state of certain devices, you should be able to just ask,“are my kitchen lights on” and GH will respond with the state.
My end goal is to ask Google “What is the battery percentage of my car …” and have it respond only with the sensor value. I was trying to avoid using ifttt because it adds a extra level of complication.
Anyone clever enough to figure out how I could add a condition to my TTS automation to define the Google Home speaker that just activated and to speak back only to that one?