Author Topic: Problem with scene that sets temperature  (Read 1456 times)

Offline signal15

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +1/-0
Problem with scene that sets temperature
« on: September 30, 2011, 05:58:13 pm »
I created a scene that has an event that fires if the ambient temp goes above 70F, and it runs every minute.  The LuuP code for the event reads:
Code: [Select]
local TS_DEVICE_NUM = 5 -- Thermostat Device Number
local MAX_TEMP = 70 -- Degrees Fahrenheit
local TSH_SID = "urn:upnp-org:serviceId:TemperatureSetpoint1_Heat"

luup.call_action (TSH_SID, "SetCurrentSetpoint", {NewCurrentSetpoint = tostring (MAX_TEMP)}, TS_DEVICE_NUM)

This works.  The point of it is to make it so renters cannot set the temp above 70F, or if they do, it will set it back down.  My CA8900 does not report setpoints, so the Temperature Min/Max plugin will not work.  This is the only way to do it unless I want to spend more money and buy more expensive thermostats.

However, this only works when the ambient temperature changes between pollings.  I'm getting this in the logs:

Code: [Select]
06 09/30/11 16:42:22.192 Device_Variable::m_szValue_set device: 5 service: urn:upnp-org:serviceId:TemperatureSensor1 variable: CurrentTemperature was: 80 now: 80 #hooks: 1 upnp: 0 v:0x79f7e0/NONE duplicate:1 <0x803>

It appears it is marking it as a duplicate, and then not firing the event.  If the ambient temp changes by one degree and it's picked up on the next scene run, then it fires.  Is there any way to make this fire every time the scene runs?  I don't want the renters sitting there and turning it back up everytime it gets set down to 70.  They will do it, I know they will.  They will also replace the thermostats with cheap ones to get around it, so I'm going to have to set up notifications if communication is lost.

This is to get around renters setting the thermostats to 85 and leaving all of the windows open on -20F days and running my heat bills up to $1k+ a month.

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: Problem with scene that sets temperature
« Reply #1 on: September 30, 2011, 06:58:58 pm »
Code: [Select]
"eventList": {
        "event_1": {
            "label": "Temperature goes above",
            "serviceId": "urn:upnp-org:serviceId:TemperatureSensor1",
"norepeat": "1",
            "argumentList" : {
                "argument_1" : {
                    "dataType": "i4",
                    "name": "CurrentTemperature",
                    "comparisson": ">",
                    "prefix": "temperature: ",
                    "suffix": " degrees"
                }
            }
        },

Unfortunately, the event is (hard-)coded as "norepeat": "1". You could try setting it to 0 (will apply to all temperature sensors ...) - or use an interval timer and check the temperature yourself ...

Offline signal15

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +1/-0
Re: Problem with scene that sets temperature
« Reply #2 on: October 01, 2011, 08:23:00 pm »
Yeah, thinking about it, it really doesn't matter.  Because the heat in the building is going to take a long time to raise the temp one degree.  And whenever the temp changes by a degree above 70, it's going to set it back down to 70.  If anything, it's going to confuse them if they try to figure it out, which is what I want.