Author Topic: reading temperature from Virtual Outdoor Temperature Plugin  (Read 662 times)

Offline jchin

  • Sr. Newbie
  • *
  • Posts: 43
  • Karma: +0/-0
reading temperature from Virtual Outdoor Temperature Plugin
« on: December 30, 2017, 01:19:30 pm »
I got 2 scenes working for my basement thermostat.
One to turn up the heat when someone turned on the light (after a delay).
One to turn down the heat when the lights are turned off (after a delay).
In both cases, I delay the LUUP code for 90 seconds before checking if the lights are still on or off.

What I'd like to do is change the temperature based on the outside temperature.
On colder days (sub-freezing), I'd like to set the temperature higher and on warmer days.
I have the Virtual Outdoor Temperature plugin installed but cannot seem to read the CurrentTemperature from it.
Can anyone help?

Offline jchin

  • Sr. Newbie
  • *
  • Posts: 43
  • Karma: +0/-0
Re: reading temperature from Virtual Outdoor Temperature Plugin
« Reply #1 on: January 19, 2018, 11:11:10 pm »
Anyone?  Am I the only one using the "Virtual Outdoor Temperature" plugin from the Vera plugin library?

Offline jbonzey

  • Jr. Member
  • **
  • Posts: 52
  • Karma: +0/-1
Re: reading temperature from Virtual Outdoor Temperature Plugin
« Reply #2 on: January 20, 2018, 09:34:34 am »
I don?t know about the virtual outdoor temp plugin but I recommend you look at the weather underground plugin.   I use it to trigger scenes utilizing weather conditions and it?s very stable

Offline Don Phillips

  • Hero Member
  • *****
  • Posts: 1382
  • Karma: +36/-35
Re: reading temperature from Virtual Outdoor Temperature Plugin
« Reply #3 on: January 20, 2018, 07:56:21 pm »
 I second Weatherunderground. I use a weather station about 1 mile from my house to get better weather information, including cloud cover and precipitation. I use this to offset the sunrise/sunset time by 15 minutes for cloudy and 30 minutes for rain when turning on or off the exterior lights.
Vera 3, 1.7.1030, CT101, Everspring motion sensor, GE/Jasco switch, Leviton outlet, AeonLabs sensor, NuTone garage door, Blue Iris, Sricam SP011, iPhone locator, APCUPSD, VeraMate, VeraAlerts, PLEG, House Modes, Countdown Timer, DVR, Virtual/Multi Switch, Weatherunderground, LB60Z-1 bulb, Hue, Alexa

Offline jchin

  • Sr. Newbie
  • *
  • Posts: 43
  • Karma: +0/-0
Re: reading temperature from Virtual Outdoor Temperature Plugin
« Reply #4 on: April 20, 2018, 12:31:04 pm »
Got it working ... here is the code I used:

Code: [Select]
local THERMOSTAT = 16 -- deviceID for Thermostat
local TEMP = 72 -- temperature to set
local HEATOFF = 65 -- temperature to set when outside is warm
local VOTD = 23 -- deviceID of Virtual Outdoor Temp
local TEMPwarm = 55 -- temperature outside considered warm

local OutdoorTemp = tonumber((luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1", "CurrentTemperature", VOTD)))
-- note the number of parentheses

if (OutdoorTemp < TEMPwarm) then
luup.call_action("urn:upnp-org:serviceId:TemperatureSetpoint1_Heat", "SetCurrentSetpoint", {NewCurrentSetpoint = TEMP}, THERMOSTAT)
else
luup.call_action("urn:upnp-org:serviceId:TemperatureSetpoint1_Heat", "SetCurrentSetpoint", {NewCurrentSetpoint = HEATOFF}, THERMOSTAT)
end