I have several scripts where I use HS.Speak, what would the best way be to use my chromecast group announcements?
I have 6 speakers and currently I get something like 3 of the connect sounds before it speaks.
And since this script speaks several times, each speak gives the connect sound 3 times, speak, connect sound 3 times, speaks, connect sound 3 times, speaks.
And as if that is not bad enough, all of the speakers do it at different times, so the house is completely out of sync! ;-)
Any help would be appreciated
Sub Main(parm as object)
hs.Speak("Good evening")
'*************** query if tomorrow is thursday for garbage day ******
Dim tomorrow As Integer = DateTime.Now.DayOfWeek +1
if tomorrow = 4 then
hs.Speak("Tomorrow is garbage day. Please do not forget to put the garbage can out tonight")
end if
' ************** query if this week is a recycling week **********
Dim WeekNumber As Integer = DatePart(DateInterval.WeekOfYear, Date.Today)
if WeekNumber Mod 2 <> 0 then 'take the week number and divide it by mod (2) if it is even the remainder will be 0. <> is not equal
if tomorrow = 5 then
hs.Speak("Tomorrow is recycling day. Please do not forget to put the recyclables out tonight")
end if
end if
'************** Weather **************
' ************** prepare for tomorrow **********
if hs.deviceValueEx(713) > 75
hs.Speak("it is going to rain tomorrow. Do not forget your umbrella.")
else if hs.deviceValueEx(713) > 30
hs.Speak("it may rain tomorrow. Bring your umbrella.")
end if
if hs.deviceValueEx(726) > 80
hs.Speak("its going to be hot tomorrow!")
else if hs.deviceValueEx(726) > 70
hs.Speak("it is going to be nice tomorrow! No jacket required")
else if hs.deviceValueEx(726) > 60
hs.Speak("it is going to be cool tomorrow! You may want a jacket")
else if hs.deviceValueEx(726) > 32
hs.Speak("it is going to be cold tomorrow! Do not forget your jacket!")
else if hs.deviceValueEx(726) > 0
hs.Speak("it is going to be wicked cold tomorrow!")
end if
'************** Tonights weather forecast **********
hs.Speak("Tonights forecast ")
hs.Speak(hs.deviceString(720))
'************** Tomorrows weather forecast **********
hs.Speak("Tomorrows forecast ")
hs.Speak("Tomorrows high is " & hs.deviceValueEx(726) & " degrees")
hs.Speak("with a low of " & hs.deviceValueEx(727) & " degrees")
hs.Speak("Chance of rain is " & hs.deviceValueEx(713) & " percent")
hs.Speak("I hope that you have a good nights sleep")
hs.Speak("Good night")
End Sub
I have 6 speakers and currently I get something like 3 of the connect sounds before it speaks.
And since this script speaks several times, each speak gives the connect sound 3 times, speak, connect sound 3 times, speaks, connect sound 3 times, speaks.
And as if that is not bad enough, all of the speakers do it at different times, so the house is completely out of sync! ;-)
Any help would be appreciated
Sub Main(parm as object)
hs.Speak("Good evening")
'*************** query if tomorrow is thursday for garbage day ******
Dim tomorrow As Integer = DateTime.Now.DayOfWeek +1
if tomorrow = 4 then
hs.Speak("Tomorrow is garbage day. Please do not forget to put the garbage can out tonight")
end if
' ************** query if this week is a recycling week **********
Dim WeekNumber As Integer = DatePart(DateInterval.WeekOfYear, Date.Today)
if WeekNumber Mod 2 <> 0 then 'take the week number and divide it by mod (2) if it is even the remainder will be 0. <> is not equal
if tomorrow = 5 then
hs.Speak("Tomorrow is recycling day. Please do not forget to put the recyclables out tonight")
end if
end if
'************** Weather **************
' ************** prepare for tomorrow **********
if hs.deviceValueEx(713) > 75
hs.Speak("it is going to rain tomorrow. Do not forget your umbrella.")
else if hs.deviceValueEx(713) > 30
hs.Speak("it may rain tomorrow. Bring your umbrella.")
end if
if hs.deviceValueEx(726) > 80
hs.Speak("its going to be hot tomorrow!")
else if hs.deviceValueEx(726) > 70
hs.Speak("it is going to be nice tomorrow! No jacket required")
else if hs.deviceValueEx(726) > 60
hs.Speak("it is going to be cool tomorrow! You may want a jacket")
else if hs.deviceValueEx(726) > 32
hs.Speak("it is going to be cold tomorrow! Do not forget your jacket!")
else if hs.deviceValueEx(726) > 0
hs.Speak("it is going to be wicked cold tomorrow!")
end if
'************** Tonights weather forecast **********
hs.Speak("Tonights forecast ")
hs.Speak(hs.deviceString(720))
'************** Tomorrows weather forecast **********
hs.Speak("Tomorrows forecast ")
hs.Speak("Tomorrows high is " & hs.deviceValueEx(726) & " degrees")
hs.Speak("with a low of " & hs.deviceValueEx(727) & " degrees")
hs.Speak("Chance of rain is " & hs.deviceValueEx(713) & " percent")
hs.Speak("I hope that you have a good nights sleep")
hs.Speak("Good night")
End Sub
Comment