Ask google to know where person x is and show location

Superb! Thx!
Yeah i’m looking for a fix to try to cast any tab/dashboard to google using the homecast with duckdns.
But it seems there are a lot of problems with it.
Maybe a way to go is using catt… that one has more options too; i’m still looking to find a way, as soon as i got it, i keep you posted !

May be try this as well

Mmm interesting…
Did you try it, is it indeed safer than duckdns?
Also the casting would be solved?
I’m a bit , laid back switching from duckdns… cause verything (except the casting) works now

Superb tutorial !
I replaced my duckdns now with ths cloudflare, as its more safe…
Now retrying to cast the map to google home (or any dashboard, cause it failed using duckdns)…
I’m a step further now, cause it says nabu casa is connected (although its running cloudflare) and i get a white screen casted…

Very strange that you get just a white screen, because in my case it was casted at my first try. Did you try by using the same time delays as what I have done in the program? May be as first it is calling the media player (for the announcement) and then again for the cast, the time delay should be correctly adjusted.

These days I’m little bit busy with my heating system that is not working. It’s summer but I must change it before the winter in France. As soon as I finish that, I will get back to the update of this program. I want to check the solution where you cast a sound to identify which Nesthub is sending the command.

At the same time I’m working on a program that detects when my baby (1 year old) is up and alert me on my Nesthub that I have to get there before she tries to get down from the bed :smiley: This is now working and I was struggling to add one of my Cams that was working with “Smart Life”. But I found out that HA is not able to capture the live stream from cams that are linked to “Smart Life”. Ideally, I need to have a cam that can send Rtsp streams. So as it costs only 30€ on Ali-express, I’ve ordered one and waiting for that. My Goal is in addition to the messages saying that the baby is up, I want to have the live stream directly on my Nesthub, so in this case, I can gauge if the baby is up or just moved here arms or legs while sleeping. All of this process is also enabled / disabled by a scenario remote that can switched on or off the monitoring system. So, when we are in the room, we can just by pressing one button on the remote switch on or off the system (scene / automation). Each time you switch it on or off there is a message on Google saying that the baby monitoring system is powered on or off. Ones it’s off, there are no detection or announcements on the Nesthubs.

Hi @skank

Here below is a new update to my program given in the PDF. This update will make the process more easier. From now, you don’t need to create an automation, you can directly create all in the script. Here below the script for you, you just have to replace “Person X” by any name of your choice. Now in my PDF you can drectly jump to the section 4: creating a routing in Google Home. Done.

alias: PersonX Location Script to Google Home v1
sequence:
  - if:
      - condition: state
        entity_id: person.personx
        state: not_home
    then:
      - service: tts.cloud_say
        data:
          entity_id: media_player.nest_hub
          message: The Person X is out of known zones, but I will cast you a map withing few seconds
      - delay:
          hours: 0
          minutes: 0
          seconds: 6
          milliseconds: 0
      - service: cast.show_lovelace_view
        data:
          entity_id: media_player.nest_hub
          dashboard_path: lovelace
          view_path: psxmap
      - delay:
          hours: 0
          minutes: 1
          seconds: 10
          milliseconds: 0
      - service: media_player.turn_off
        data: {}
        target:
          device_id: 82c4023ee17f86bf5177ab8ce2f6aXXX
    else:
      - service: tts.cloud_say
        data:
          entity_id: media_player.nest_hub
          message: The Person X is nearby {{ states('person.personx')}}
      - delay:
          hours: 0
          minutes: 0
          seconds: 6
          milliseconds: 0
      - service: cast.show_lovelace_view
        data:
          entity_id: media_player.nest_hub
          dashboard_path: lovelace
          view_path: psxmap
      - delay:
          hours: 0
          minutes: 1
          seconds: 10
          milliseconds: 0
      - service: media_player.turn_off
        data: {}
        target:
          device_id: 82c4023ee17f86bf5177ab8ce2f6aXXX
mode: single

1 Like

Nice !
I’m still strugling with the cast thing… still getting a white screen …
But its not cause of your script…
I have it too when i just go to the media seciton ,and try to cast any dashboard

I should get that fixed, before going further with ur automation… (which i would very like)

Will try asap when casting works
Edit: i figured out why i couldnt cast, the view should be in panel mode.
However i ran into other problems.
Since i’m using the cloudflare thing, with a freenom .tk domain, i cant use my google assistant anymore…
i changed the fulfillment url, but google says it cant synchronize devices
Any idea?
Did you set up the cloudflare?

Another possibility,

May be this is not the most secured way. I didn’t check this but as per the author of the video it seems to work. May be first you should activate all security systems such as double authentification factor etc…

Yeah i came from that method lol
But casting didnt work then, with your way (cloudflare) it was working and safer but i still need to figure out how google assistant works then

It works! with cloudflare !
I can finally continue with your script now

i dont get it, ur pdf still has the automation…
Do i still need it now or can i delete?

Here’s my code (script)

toon_x_op_kaart:
  alias: Waar is x
  icon: "mdi:map"
  description: 'Toont x op een kaart op google home'
  sequence:
  - if:
      - condition: state
        entity_id: person.x
        state: not_home
    then:
      - service: script.turn_on
        target:
          entity_id: script.google_home_say
        data:
          variables:
            tts_message: "x is buiten een gekende zone, ik toon je zijn locatie op kaart binnen enkele seconden!"
            tts_target: media_player.keuken
            tts_volume: 0.50
      - delay:
          hours: 0
          minutes: 0
          seconds: 6
          milliseconds: 0
      - service: cast.show_lovelace_view
        data:
          entity_id: media_player.keuken
          dashboard_path: lovelace
          view_path: Map_x
      - delay:
          hours: 0
          minutes: 1
          seconds: 10
          milliseconds: 0
      - service: media_player.turn_off
        target:
            entity_id: media_player.keuken
    else:
      - service: script.turn_on 
        target:
          entity_id: script.google_home_say
        data:
          variables:
            tts_message: "x is in de buurt van {{ states('person.x')}}!"
            tts_target: media_player.keuken
            tts_volume: 0.50
      - delay:
          hours: 0
          minutes: 0
          seconds: 6
          milliseconds: 0
      - service: cast.show_lovelace_view
        data:
          entity_id: media_player.keuken
          dashboard_path: lovelace
          view_path: Map_x
      - delay:
          hours: 0
          minutes: 1
          seconds: 10
          milliseconds: 0
      - service: media_player.turn_off
        target:
          entity_id: media_player.keuken
  mode: single

The media player turn off doesnt seem to work lol
Also , i deleted the automation, but do i still need that zone then? I guess not?

Sorry for my late answer, as I have mentionned above, now you don’t need automation or creating a nowhere zone. If you creat the script as written in my post, then once the sript is created you can jump to section 4 of the PDF.

1 Like

Are you sure the media player turn off doesn’t work, because your script seems to be ok for me. Can you do the following test:

Ask the question from Google about where is Person X, then let Google answer you with the MAP etc…

1/ What happen after 1min and 16 second ? Does the MAP go away ?
2/ Wait for 2 mins after your first question, the repeat the question to Google, and tell me what happen ? Is Google answer you back giving the position and the MAP ?

  1. is goes away indeed, and shows the “welcome to home assistant” screen
    I then swipe away and wait till 2 mins
  2. after 2 mins, i ask again, he shows me quickly the map, then answers my question, (but then the map should come) but it doenst

Its ok i guess, it works

I just need to lower the 1min and 16 sec, its too long

Yes the timer can be set to whatevere you want. This is up to you.

And good news for you, I think I found the way to make this program to respond from only the the screen you call it. I’m still testing and this might be ready in few days. In theory, this should work with any Nest Hub.

So let’s keep in touch. :grinning_face_with_smiling_eyes:

1 Like

Very cool!
Thx for you work !

You are welcome this was also somthing I needed, so I’m happy that I found someone to follow me in my work and to share it. :grinning_face_with_smiling_eyes:

1 Like

I wonder if actionable notifications on google is possible…