04-02-2024 11:41 AM
I have been successful with several other simple scripts, but I’m stymied on my latest attempt. I’m trying to write a script that will remind my wife to wear her dental appliance to bed. I want the 2nd gen hub on her nightstand to detect her getting into bed and display a reminder message. The script I wrote begins:
- starters:
- type: home.state.HomePresence
state: homePresenceMode
is: HOME
Validation does give a warning, not an error, for the type line: “This routine may perform better if more presence signals are enabled across the household”, which I ASSume to be harmless, and, I only want one of my devices, the nightstand hub, to trigger the script.
Presence Sensing is enabled in the Home app only for the hub on her nightstand. Motion Sense is enabled on the hub. Sleep Sensing and Gestures are currently disabled because enabling each did not help. When I approach the hub, the presence-detected bars appear at the bottom and right-side, and it sometimes displays, “Good evening”.
The script has started a few times but apparently when it wants to and not every time, as I want it to. When it does start, the rest of the script works fine, displaying the desired message on the hub. After a LOT of testing, I’ve almost concluded that the script likes to start after no one has been near the hub for several hours, but I’m not sure...
I even resorted to using the script editor’s “Help me script”, which suggested this:
- starters:
- type: device.state.MotionDetection
device: Master Bedroom Display - Master Bedroom
state: motionDetectionEventInProgress
is: true
But, this starter would not Validate, telling me that, “[device.state.MotionDetection] is not supported by device [Master Bedroom Display - Master Bedroom]”. Very strange, since I know the hub detects motion, whether by Soli sensor or ultrasound or some other way, I am not sure.
I have spent hours researching the problem, including the Google Community posts. I found one case, very similar to mine and ironically posted by JerryInTennessee- ironic because I too am in Tennessee, but it did not lead to a resolution for my case. Calling and Chatting with Google agents has only given me stock answers that did not begin to help. Like most support centers, the people with the real answers are fire-walled off from the lowly callers...
Any and all suggestions will be welcomed!
04-18-2024 11:18 AM
Hi there BobDollarSign!
Thanks for reaching out to our community.
It seems like you're on the right track with automating the reminder. There might be a better way to trigger the hub since the current sensors (like ambient light, motion, and sound) can't activate scripts reliably yet.
My recommendation would be to explore alternative approaches, such as a Google Assistant routine. Setting up a bedtime routine with it could be very useful. For example, when your wife says "Goodnight," it could remind her about wearing her dental appliance while triggering other functions you might need, like turning off lights if you have lights compatible with the Google Home app.
Let me know how it goes.
Regards,
Angel.