luup.call_action(“urn:richardgreen:serviceId:VeraAlert1”, “SendAlert”,
{Message = “{tone:1} Good Morning. The current temperature is " … currentTemp … " degrees with a high today of 60 and a low of 42.”, Recipients = “”}, 46)[/code]
Is this the correct way to call variables and insert them into the speak string?
You need the Device ID for the Temperature Child device.
The service is: urn:upnp-org:serviceId:TemperatureSensor1
You can determine this by letting your mouse hover over the variable name in the Advanced tab for the device variable you want to access.
Yeah, I’m a dummy. Not sure why I goofed up on the serviceID. I have it working now. I’m actually just generating the speak string now in a variable and passing that to Vera Alert. It’s much cleaner when setting all of the alerts up.
[code]local currentTemp = luup.variable_get(“urn:upnp-org:serviceId:TemperatureSensor1”, “CurrentTemperature”, 48)
local lowTemp = luup.variable_get(“urn:upnp-org:serviceId:TemperatureSensor1”, “CurrentTemperature”, 49)
local highTemp = luup.variable_get(“urn:upnp-org:serviceId:TemperatureSensor1”, “CurrentTemperature”, 50)
local speakMessage = "{tone:1} Good Morning. The current temperature is " … currentTemp … " degrees with a high today of " … highTemp … " and a low of " … lowTemp
Yep. The code above pulls it from the Wunderground data if you have the wunderground plugin installed. Just make sure you get your device ID’s correct.
Here’s my current code I’m using:
[code]local currentTemp = luup.variable_get(“urn:upnp-org:serviceId:TemperatureSensor1”, “CurrentTemperature”, 48)
local lowTemp = luup.variable_get(“urn:upnp-org:serviceId:TemperatureSensor1”, “CurrentTemperature”, 49)
local highTemp = luup.variable_get(“urn:upnp-org:serviceId:TemperatureSensor1”, “CurrentTemperature”, 50)
local currentCondition = luup.variable_get(“urn:upnp-micasaverde-com:serviceId:Weather1”, “Condition”, 47)
local currentWind = luup.variable_get(“urn:upnp-micasaverde-com:serviceId:Weather1”, “WindCondition”, 47)
local speakMessage = "{tone:1} Good Morning. Current conditions are " … currentCondition … ". The temperature is " … currentTemp … " degrees with a high today of " … highTemp … " and a low of " … lowTemp
Note that I’m not using the wind in the speak string right now because Vera Alerts would sometimes stop speaking during that part of it for some reason.