Here’s the basics :
- You’d want to remember you getting out, your GF getting out (or both out) which you could do so by something like this
Set a Variable to remember that you’re out (this should be in your RFID lua code when the RFID gets tripped), You could set this Variable for the Thermostat device - where 10 below is the device # - So presumably for the Thermostat
a. RFID 1 lua code (in the scene where your rfid is tripped for out)
luup.variable_set(“urn:upnp-org:serviceId:TemperatureSetpoint1_Heat”,“ExHempKnight_RFID”, “OUT”, 10)
b. RFID 2 lua code ( in the scene where your gf rfid is tripped for out) - Again change 10 below to your Thermostate Device #
luup.variable_set(“urn:upnp-org:serviceId:TemperatureSetpoint1_Heat”,“ExHempKnight_GF_RFID”, “OUT”, 10)
- Follow this with checking both variables (on both your scene and gf scene)
local ExHempKnight_OUT = luup.variable_get(“urn:upnp-org:serviceId:TemperatureSetpoint1_Heat”,“ExHempKnight_RFID”, 10)
local ExHempKnight_GF_OUT = luup.variable_get(“urn:upnp-org:serviceId:TemperatureSetpoint1_Heat”,“ExHempKnight_GF_RFID”, 10)
- Set the Thermosate for AND condition
if ExHempKnight_OUT==“OUT” and ExHempKnight_GF_OUT==“OUT” then
–Set thermostat to desired heat set point, below 10 is your thermo device id, I’m assuming if you give value
–63 is the temp you want to set when both or out
luup.call_action(“urn:upnp-org:serviceId:TemperatureSetpoint1_Heat”,“SetCurrentSetpoint”,{ NewCurrentSetpoint=“63” },10)
end
- Fill in for the other conditions
Hope this gets you started… Here are the steps and this should work for when both of you are out and temp set for 63 - let me know if that works as I thought it would…
- Create a scene with Event for your RFID is OUT, Add the following code in Lua Tab
local serviceVar=“urn:upnp-org:serviceId:TemperatureSetpoint1_Heat”
local thermoID=10
–SET Variable that you’re out
luup.variable_set(serviceVar,“ExHempKnight_RFID”, “OUT”, thermoID)
–GET variabels et
local ExHempKnight_OUT = luup.variable_get(serviceVar,“ExHempKnight_RFID”, 10)
local ExHempKnight_GF_OUT = luup.variable_get(serviceVar,“ExHempKnight_GF_RFID”, 10)
–Do Both are out condition
if ExHempKnight_OUT==“OUT” and ExHempKnight_GF_OUT==“OUT” then
–63 is the temp you want to set when both or out
luup.call_action(serviceVar,“SetCurrentSetpoint”,{ NewCurrentSetpoint=“63” },10)
end
- Create a scene with Event for your GF RFID is OUT, Add the following code in Lua Tab
local serviceVar=“urn:upnp-org:serviceId:TemperatureSetpoint1_Heat”
local thermoID=10
–SET Variable that you’re out
luup.variable_set(serviceVar,“ExHempKnight_GF_RFID”, “OUT”, thermoID)
–GET variabels et
local ExHempKnight_OUT = luup.variable_get(serviceVar,“ExHempKnight_RFID”, 10)
local ExHempKnight_GF_OUT = luup.variable_get(serviceVar,“ExHempKnight_GF_RFID”, 10)
–Do Both are out condition
if ExHempKnight_OUT==“OUT” and ExHempKnight_GF_OUT==“OUT” then
–63 is the temp you want to set when both or out
luup.call_action(serviceVar,“SetCurrentSetpoint”,{ NewCurrentSetpoint=“63” },10)
end