Echo Speaks Examples

This is very smart. Two questions

  1. What is the purpose of lines 128? It is for presense but doesn/t the entire rest of the piston assume that either through motion or physical interaction a sensor till trigger the appropriate speaker? Otherwise, why not say restriction for the entire piston only when presense 1, 2, or 3 are present?

  2. Wouldn’t some of your zones not work. What I mean is you need to have motion active or contact open or switch on. what happens with the motion becomes inactive, contact closes or you turn of the switch? That would mean the speaker wouldnt work and you might still be in the room.

Forgot to respond , that was it, I had the echo’s defined in both sections

1 Like

@BBoy486 , I will respond a lil later, out shopping for Thanksgiving Dinner

1 Like

Thanks.

The section at line 128 is for my 2 sons room. They are both 18 and one spends 90% of his time at his girlfriends and the other lives full time at college. So, that room is only occupied when either of them is present.

Yes, I agree there might be times that the message may not come thru to an occupied room. What I’ve tried to do it set up for every possible way the rooms are occupied. I look at each persons habits when they are in their rooms and I look at how each of the common rooms is when it is occupied.

So far, it has been pretty spot on. There may have been times that things get missed, but they are very rare as far as I can tell.

PS.
I’m also updating the piston in the above post. I found a flaw in the overall system. Thanks for making me go back and take a hard look at it.

I am going to use it that’s why I questioned a few of the items!

I have found that each of my family members had their own poker signs. So I use those to determine several of my automations. It has pretty good so far!

1 Like

Reading this thread reminds me: one of the things I’ve wanted to do since I got my first Dot is to schedule volume control on these things. So that when I go to bed and tell the Dot next to my bed “set an alarm for 5am”, it replies at volume 2 rather than volume 8 or wherever it was.

2 Likes

@BBoy486

Seems that anonymizing a Piston changes some of the values so I’m reposting with a literal copy.

As one of the “FNG’s”, I have a couple of first pistons I"m proud off. I’ve borrowed some code from @bamarayne “Speaker Control”, use @bangali “Rooms Manager” and borrow some other code from whom I can’t remember I got it from but thank you all.

First I use a common code Piston for all Echo notifications. Any Piston needing to speak calls my Notification Piston and passes parameters. It takes advantages of Global Variables for standard Echo volume and mode settings timed via simple routines. I use room occupancy (could be motion detected) to speak announcements only in rooms where there are actually people present which is likely less than four :slight_smile: No need to blast the whole house when motion on a camera if we’re in the loft watching TV. Shout out to @bthrock

  • There are “async if’s” for each room so each branch runs independently and concurrently.
  • This notification Pistion is called (no triggers) from other Pistons like the Announcement Piston below
  • Line 128 is the fourth asynchronous branch for the Living Room after Second Bedroom
  • I use the Occupancy attribute of a “Rooms Manager” room. Occupancy is triggered by a motion sensor in the room and stays “Occupied” for 5 minutes (configurable). Continued motion triggers (Engaged) for 30 minutes (also configurable). So if the room is occupied or engaged then enable that echo.
  • Volume is controlled by, time of day, guests present or critical message.
  • Again this piston is called from other pistons with a message and parameters and depending on room “occupancy”, not motion, determines which echo’s are active.

I use the Notification Piston as a universal message handler. Below is one of my Pistons that call the Notification Piston. “Announcements”

  • It too uses async if statements but adds change triggers to watch doors, locks and cameras
  • If something changes, craft message and pass to Notifications.

1 Like

I dont think this will work (your piston code) since it is unique to you. Import failed on my end. Also, my questions were for @bamarayne’s piston Echo Speaks Examples

But thanks for answering!

So how are you calling @ReceivedMsg and @PistonChange? Are they dynamic global variables?

I can’t seem to get ReceivedMsg to show any text when one of the conditions are active.

You have to create the global variables.

Piston one (events piston)

if door contact opens,
then set variable @receivedMsg to “The door is now open”
then set variable @PistonTrigger to “$now”

Piston two (message control)
if variable @PistonTrigger changes
then speak @receivedMsg

thanks but i meant are they
dynamic @ReceivedMsg Value - Nothing Selected and dynamic @RPistonChange Value - Nothing Selected

If you or anyone wants a copy of mine, let me know and I’ll post an importable version.

1 Like

That is correct. Both are dynamic global variables

Thanks. I am getting a null value so I did something wrong but ill figure it out.

Anyway to get weather alerts (not just a standard one, but a major storm, etc.)?

Actually, yes. What I did was modified the Hourly weather piston example on the webCoRE Wiki and added an hourly report along with a report if $weather.alerts.alerts.type is not empty. I still need to tweak it a bit more to listen for weather events and then alert if one comes through.

3 Likes

That will be great. I probably don’t need it all the time, but just when it serious weather…or upcoming rain, etc…

Try this for your speak Expression statement to also get the current forecast

replace(‘The time is ‘$time’. The current weather is ’ $weather.conditions.current_observation.temp_f ’ degrees and ’ $weather.conditions.current_observation.weather ‘. It feels like ’ $weather.conditions.current_observation.feelslike_f ’ degrees. Current forecast is ’ $weather.forecast.forecast.txt_forecast.forecastday.fcttext[0]’ Followed by ’ $weather.forecast.forecast.txt_forecast.forecastday.fcttext[1] ’ Followed by '$weather.forecast.forecast.txt_forecast.forecastday.fcttext[2],“F “,” degrees “,“F.”,” degrees.”," N “,” north “,” E “,” east “,” S “,” south “,” W “,” west “,” NNE “,” north, north east “,” NE “,” north east “,” SE “,” south east “,” SSE “,” south, south east “,” SW “,” south west ", " SSW “,” south, south west “,” NW “,” north west ", " NNW “,” north, north west ",’ WNW ‘,’ West north west ‘,’%’,’ percent ‘)

1 Like

@bamarayne I had to add an Execute Piston to get my Echos to run the @ReceivedMsg. Works now very odd how your’s works without it.

Curious if it is possible to have the Echo change its volume if it is playing music. I dont see a webcore capability that says music playing so wondering how I would do this.

Use case - If Echo plays music (any streaming service) change the volume to 80%.