perfect. Thanks
Announcement
Collapse
No announcement yet.
Environment Canada Weather plugin - HS3
Collapse
X
-
speaking a few items
Hi Chris,
Thank you for this plug in !
version is 3.0.0.4 on win8.1 laptop
Just a question regarding speaking of device status ?
I am trying to include a few items in my "good morning" announcements from your weather plugin.
Action is speak something:
$$dsa:nwkt_Current_summary:
The speech says for example "dash 2 deg C"
instead of "minus two degrees celcius"
Any idea of how to fix this ?
Thanks in advance,Neil
Newmarket Ontario
Comment
-
You could alter what is being sent to the TTS engine with a script:
Public Sub Main(ByVal param As Object)
Dim ref As Integer = hs.GetDeviceRef("nwkt_Current_summary")
Dim currentConditions As String = hs.DeviceString(ref)
Dim whatToSay As String = currentConditions.Replace("-", "minus")
hs.Speak(whatToSay)
End Sub
This will replace "-" with "minus".
The script above would need to be placed in the scripts folder with a file extension '.vb'. You could then call it from your event.
Comment
-
A script like this? Replace with your device addresses in the "hs.GetDeviceRef" lines.
Public Sub Main(ByVal param As Object)
Dim currTempRef As Integer = hs.GetDeviceRef("yyc-Current_summary_temperature")
Dim currTemp As String = hs.DeviceString(currTempRef)
currTemp = currTemp.Replace("°C", " degrees C")
Dim todayForecastRef As Integer = hs.GetDeviceRef("yyc-Forecast1_summary")
Dim todayForcast As String = hs.DeviceString(todayForecastRef)
Dim whatToSay As String
whatToSay = "Current temperature, " + currTemp + ", " + "Today's forecast, " + todayForcast
hs.Speak(whatToSay)
End Sub
Comment
-
Originally posted by nsisman View PostI use this (dta commands) under the "speak something option" and just select the devices you want spoken.
Don't forget last colon or it won't work !
good morning folks. $date. next waste day is regular waste. $$dta:nwkt-Current_title: $$dta:nwkt-Forecast1_summary:
Comment
-
Chrisgo,
Looks like the rss feed supplier (govt Canada) is changing their device names periodically by inserting a dash - one time and then an underscore _ next time.
When they change it (like this morning) then it creates a "device not found" error when using dsa:nwkt-Current_summary or dta:nwkt-Current_summary in event actions.
My report comes from https://meteo.gc.ca/rss/city/on-25_e.xml
using your verson .11
Could you take a look to see if there might be a fix ?
Other than this little glitch the script works great and has been busy with weather warnings all week !Neil
Newmarket Ontario
Comment
-
The device names are hard coded in the plugin.
The device address is set to the prefix you configure in the config page. The device code describes the device (eg Current_summary).
HS3 combines the address and code with a "-" so if your prefix is nwkt then your current summary would be "nwkt-Current_summary".
Is your HS3 device address/code changing? Would it be possible to send me a screenshot showing the differences? Easiest place to screenshot would be the configuration tab of the device.
Comment
-
Chrisgo,
I don't have the devices for last week any more but they all came in formatted like this
nwkt-Current-summary instead of nwkt-Current_summary
They show up just fine in the device management page but just mess up the speaking when speaking by device codes.
I only use current weather, forecast1, and weather warnings in my "good morning" event.
If it happens again I will check them all.Neil
Newmarket Ontario
Comment
-
Looks like EC changed something in the XML file. I've been seeing this error in the logs and there are no updates:
error in feed: http://weather.gc.ca/rss/city/on-143_e.xml - Reference to undeclared entity 'eacute'. http://weather.gc.ca/rss/city/on-143_e.xml Line 4, position 64.
Comment
Comment