Thanks - how do I initiate a Luup reload?
Go to any device, click Advanced, New service, Reload Engine
Hello
So I removed the variable:
local currentCondition= luup.variable_get(TEMP_SID, âTodayConditionsâ, 733)
I dont see how the code knows to go to device 733 nowâŠ
Yes Iâm seeing device 733 has a variable for Current Temperature (see screenshot below)
urn:upnp-rboer-com:serviceId:Weather1 / CurrentTemperature (on Variable page when I click edit)
Below is my current try with quotations checkedâŠ
Iâm still missing the connection to my device 733 in the Multi Weather Station app.
The quoted " Unknown" is being read as the TTS. Without the âUnknownâ the scene still runs succesfully but NO TTS is heard. No CurrentTemperature
url = require(âsocket.urlâ)
local AV_DEV = 298
local LS_SID = âurn:micasaverde-com:serviceId:Sonos1â
local TEMP_SID =âurn:upnp-rboer-com:serviceld:Weather1â
url = require(âsocket.urlâ)
local AV_DEV = 298
luup.call_action(LS_SID, âSayâ, {Text = string.format(âCurrent Temperature is %sâ , CurrentTemperature or âUnknownâ),Volume=60, UseCache=0}, AV_DEV)
Perhaps this:
local TEMP_SID =âurn:upnp-rboer-com:serviceld:Weather1â
Should be this: ?
local CurrentTemperature_SID =âurn:upnp-rboer-com:serviceld:Weather1â
Any advice is greatly appreciatedâŠ
Cheers
Thanks Rene - have you received the email with the files I sent you directly via the Ezlo Community?
Some code the should work assuming the device id 733 is that of the weather plugin on your Vera;
local TodayCondition= luup.variable_get("urn:upnp-rboer-com:serviceld:Weather1", "TodayConditions", 733)
luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text = string.format("Current
conditions are %s" , TodayCondition or "Unknown"),Volume=60, UseCache=0}, 298)
or for the temp
local CurTemp= luup.variable_get("urn:upnp-rboer-com:serviceld:Weather1", "CurrentTemperature ", 733)
luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text = string.format("Current
temperature is %s" , CurTemp or "Unknown"),Volume=60, UseCache=0}, 298)
Cheers Rene
Following your email I have just replied your message with an attached zip file - hope it will be received this time.
Thanks
Hello
Thanks so much for the streamlined code.
It is working but not drawing the info from the Current Temp or Todays Conditions device #733.
The TTS string is saying Current temperature âUnknownâ.
When I list both requests it only responds to 1 request with the âŠâUnknownâ responce.
If I remove the âUnknownâ the scene runs as a success but can not hear the TTS.
Ugh!
AlsoâŠ
Just got an email from Open Weather
They will be adding a TTS option and charging for itâŠ
See below screen shot.
Thanks again for your persistance!
Cheers
Please double check the device number of the weather plugin it self. Do not use any of the child devices if you created them. In my example I put 298, I assume you tried it with 733 as well.
I did a copy and paste of the code to test my self and there was a typo in the word serviceId. It was typed with a lower case l (L) rater than uppercase I (i), so that has probably the root of your issues. I never picked up on that in your examples. Problem is that you do not see that on screen with most font types
local TodayCondition= luup.variable_get("urn:upnp-rboer-com:serviceId:Weather1", "TodayConditions", 733)
luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text = string.format("Current
conditions are %s" , TodayCondition or "Unknown"),Volume=60, UseCache=0}, 733)
Hopefully this solves it for you.
I did read about the 3.0 API. I will have a look at that later. First a few weeks of more fun things to do
Cheers Rene
It seems there is some blocking as I keep replying to your emails - which I do receive (also sent you an email with no attachment / file at all which you apparently have not received).
Would it be possible for you to send me an email with another account that I can respond to directly?
Or shall I sent a file here?
Again, many thanks for your efforts to assist.
Thanks Rene!
Really appreciate your help.
Hope when the app updates it still allows this to work for free!
For the forum:
Here is my May 2023 working lua code for Rigpapaâs Sonos App and Reneâs âMulti Provider Weather Station Appâ using Open Weather as a provider on my Vera Plus.
It annouces the daily forcast at 10:30am.
Use your own Device Numbers.
url = require(âsocket.urlâ)
local AV_DEV = 298
local CurrentConditions= luup.variable_get(âurn:upnp-rboer-com:serviceId:Weather1â, âCurrentConditionsâ, 733)
local CurrentTemperature= luup.variable_get(âurn:upnp-rboer-com:serviceId:Weather1â, âCurrentTemperatureâ, 733)
local TodayPrecipProbability= luup.variable_get(âurn:upnp-rboer-com:serviceId:Weather1â, âTodayPrecipProbabilityâ, 733)
local TodayMaxTemp= luup.variable_get(âurn:upnp-rboer-com:serviceId:Weather1â, âTodayMaxTempâ, 733)
local TodayLowTemp= luup.variable_get(âurn:upnp-rboer-com:serviceId:Weather1â, âTodayLowTempâ, 733)
local TomorrowConditions= luup.variable_get(âurn:upnp-rboer-com:serviceId:Weather1â, âTomorrowConditionsâ, 733)
local TomorrowPrecipProbability= luup.variable_get(âurn:upnp-rboer-com:serviceId:Weather1â, âTomorrowPrecipProbabilityâ, 733)
local TomorrowMaxTemp= luup.variable_get(âurn:upnp-rboer-com:serviceId:Weather1â, âTomorrowMaxTempâ, 733)
local TomorrowLowTemp= luup.variable_get(âurn:upnp-rboer-com:serviceId:Weather1â, âTomorrowLowTempâ, 733)
luup.call_action(âurn:micasaverde-com:serviceId:Sonos1â, âSayâ, {Text = string.format(âCurrent conditions are %sâŠCurrent Temperature is %sâŠTodayPrecipProbability is %sâŠTodaysHighTemperature is %sâŠTodays LowTemperature %sâŠ
Tomorrow conditions are %sâŠTomorrowPrecipProbability is %sâŠTomorrowHighTemperature is %sâŠTomorrow LowTemperature %sâ, CurrentConditions, CurrentTemperature, TodayPrecipProbability, TodayMaxTemp, TodayLowTemp,
TomorrowConditions, TodayPrecipProbability, TomorrowMaxTemp, TomorrowLowTemp),Volume=60, UseCache=0}, 298)
Cheers
Wilbur
Hi RENE, any other options to communicate? or I shall send the files here?
Hi @Bobhaskils ,
Just click on my name above this message and click the envelope to send a PM message. You may need to make a zip file of the log.
Cheers Rene
First Rene, many compliments! You do a tremendous job at developing new tools.
I want to make sure I am understanding where things currently are. When I look at my log file, it shows the openweather call going to
https://api.openweathermap.org/data/2.5/onecall?lat=4-.----&lon=-12-.----&units=standard&lang=en&appid=[my api key]&exclude=hourly,minutely
Am I to assume your tool is now using the onecall API instead of just the free API? When I use https://api.openweathermap.org/data/2.5/weather?lat=4-.----&lon=-12-.----&appid=[my api key], I get very useful data.
Thanks again!
Hi @rotbard,
If you registered with OpenWeather in the last six months or so you have to subscribe for a billing plan even for the free API calls used in this plugin. Have you done this?
thanks,
I was registered to OpenWeather last week for free use.
I didnât know I needed to subscribe to a billing plan as well.
I added subscription and Reload Engine, after 15 minutes and I got the data.