Author Topic: Variable set via scene (luup) reverts back after a while.  (Read 371 times)

Offline kwieto

  • Hero Member
  • *****
  • Posts: 612
  • Karma: +27/-15
Variable set via scene (luup) reverts back after a while.
« on: February 15, 2018, 08:21:42 am »
I want to set thermostat (Qubino ON/OFF, ZMNHID1) mode to Heat ("HeatOn") from the scene.

Unfortuntaely, after sending variable set command:
Code: [Select]
luup.variable_set ("urn:upnp-org:serviceId:HVAC_UserOperatingMode1", "ModeStatus", "HeatOn", 77)
The mode is set for a while, then thermostat reverts back to "Off".

This thermostat has some improper configuration in the system (it shows only "Off" and "Auto" modes in Vera interface, however it works only if set to "Heat" which is possible via party apps like Imperihome). If I set "Auto" via Vera interface, it also gets back to "Off" after couple of minutes.

But if I use 3-rd party app to set mode as "Heat", everything works properly and setting is kept.

I was hoping that I can steer it via the scene, but seems that it behaves similar as Vera interface. I can't track the issue - I've compared all variables for the device and when I set mode via Imperihome, only "ModeStatus" and "ModeTarget" are changing, every other variable stays as before).

I've tried to use "variable set" for both, ModeStatus and ModeTarget, with same result.

I tried to set it via "call action" command (see below) with same result.
Code: [Select]
luup.call_action( "urn:upnp-org:serviceId:HVAC_UserOperatingMode1", "SetModeStatus", {newModeStatus = "HeatOn"}, 77)
Any ideas why it is not working from the scene and works via 3-rd party app?
« Last Edit: February 15, 2018, 08:23:37 am by kwieto »

Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6201
  • Karma: +276/-70
  • "Less is more"
Re: Variable set via scene (luup) reverts back after a while.
« Reply #1 on: February 15, 2018, 08:53:55 am »
Do you not need to use an action call to change mode, rather than just setting the variable?
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline cybrmage

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1104
  • Karma: +113/-41
Re: Variable set via scene (luup) reverts back after a while.
« Reply #2 on: February 15, 2018, 09:10:16 am »
I want to set thermostat (Qubino ON/OFF, ZMNHID1) mode to Heat ("HeatOn") from the scene.

Akbooer is correct, you need to use call_action to set the thermostat mode...

And you were close with your attempt, but "SetModeStatus" is not a valid action.... You want to use "SetModeTarget"... (Quick rule of thumb... a "Target" action set a state, a "Status" action retrieves status)

Code: [Select]
luup.call_action( "urn:upnp-org:serviceId:HVAC_UserOperatingMode1", "SetModeTarget", {NewModeTarget = "HeatOn"}, 77)

Offline kwieto

  • Hero Member
  • *****
  • Posts: 612
  • Karma: +27/-15
Re: Variable set via scene (luup) reverts back after a while.
« Reply #3 on: February 15, 2018, 09:42:26 am »
I was really sure that I've tried that option, but it seems that not really :(
It works (device keep its setting), later I'll check if the heater is turning on/off according to the temperature set.

As for "Status" and "Target" - you're right, but after it didn't work at first (but I've tried "variable set" at the beginning) I decided to try every other option.

Thanks!
« Last Edit: February 15, 2018, 09:44:15 am by kwieto »