Plugin: Multi Provider Weather Station

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?

Hi @lakewoodjazz

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

Hi @Bobhaskils
I have not received any message from you.

Cheers Rene

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

Hi @lakewoodjazz

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 :blush:

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 :smile:

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, can’t get any data, what am I doing wrong?




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?

1 Like

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.

1 Like