We have moved at community.getvera.com

Author Topic: Watched Variables  (Read 10169 times)

Offline RichardTSchaefer

  • Community Beta
  • Master Member
  • ******
  • Posts: 10091
  • Karma: +764/-143
Re: Watched Variables
« Reply #15 on: December 06, 2015, 08:55:16 pm »
I did mean to correct you on an earlier statement when you said all of the data from luup.variable_get was a string ...
That's not true. The Z-Wave devices send their numbers as strings ... But there is nothing stopping you from putting other datatypes in device variables.

It only has to be a datatype that can be saved/restored naturally from JSON for persistence ...  Numbers and Strings fit into that category.
 




Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: Watched Variables
« Reply #16 on: December 07, 2015, 03:31:27 am »
Interesting, thanks for that.  All numeric values I've ever seen have been stored as strings in device variables.  Attributes are sometimes numeric or boolean.
« Last Edit: December 07, 2015, 03:49:16 am by akbooer »
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 akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: Watched Variables
« Reply #17 on: December 07, 2015, 06:30:36 am »
I did mean to correct you on an earlier statement when you said all of the data from luup.variable_get was a string ...
That's not true. The Z-Wave devices send their numbers as strings ... But there is nothing stopping you from putting other datatypes in device variables.

Taking a closer look, I find this not to be the case.  Ran this bit of code...

Code: [Select]
local sid = "urn:akb:serviceId:akb1"
local print = luup.log

local function set (n,x)
  luup.variable_set (sid, n,x, 97)
end

local function get (n)
  return luup.variable_get (sid, n, 97)
end

set ("number", 42)
set ("string", "abc")

local n = get "number"
print (type(n))

local s = get "string"
print (type(s))

And got this from the log...

Code: [Select]
06 12/07/15 11:22:02.443 Device_Variable::m_szValue_set device: 97 service: urn:akb:serviceId:akb1 variable: number was: 42 now: 42 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:1 <0x734e4520>
06 12/07/15 11:22:02.444 Device_Variable::m_szValue_set device: 97 service: urn:akb:serviceId:akb1 variable: string was: abc now: abc #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:1 <0x734e4520>
50 12/07/15 11:22:02.444 luup_log:0: string <0x734e4520>
50 12/07/15 11:22:02.445 luup_log:0: string <0x734e4520>
« Last Edit: December 07, 2015, 09:11:09 am by akbooer »
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 CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: Watched Variables
« Reply #18 on: December 07, 2015, 09:20:50 am »
When I have more time (tonight) I'll see if I can turn on verbose logging (w/in AltUI) and see what I can capture. I loaded the latest UI [v0.101.994] this morning and the problem persists.
Do you think it's OK to load the latest openLuup before this issue is understood ?

Something is trying to send a number, instead of a string, as the response to an HTTP request.  From the information given, I can't tell what.  It could be AltUI, but equally well may not be. I have not seen this before.
openLuup, AltUI, Zway and HomeWave, enough said...

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: Watched Variables
« Reply #19 on: December 07, 2015, 09:40:54 am »
Do you think it's OK to load the latest openLuup before this issue is understood ?

Yes.  In fact, there's a fix for it... that means it won't produce that error, but something else might still be wrong (it doesn't seem right that something should try to return a number as an HTTP response.)
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 CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: Watched Variables
« Reply #20 on: December 07, 2015, 09:52:01 am »
Sounds good, I'll get everything up and running tonight and report back...

Do you think it's OK to load the latest openLuup before this issue is understood ?

Yes.  In fact, there's a fix for it... that means it won't produce that error, but something else might still be wrong (it doesn't seem right that something should try to return a number as an HTTP response.)
openLuup, AltUI, Zway and HomeWave, enough said...

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: Watched Variables
« Reply #21 on: December 08, 2015, 09:31:53 am »
@Akbooer,

Upgrade went very well, no issues so far. I do however still have issues with the Watched Variables.. So I enabled the AltUI debug mode, and stepped through the process of removing the WV's.

[1] Edit scene 12.
[2] Deleted the 3 watched variables.
[3] Hit submit
[4] Grabbed the logs.

Code: [Select]
2015-12-08 08:15:13.489   openLuup.server:: new client connection: tcp{client}: 0x1afca68
2015-12-08 08:15:13.489   openLuup.server:: /data_request?id=lr_ALTUI_Handler&command=delWatch&service=urn:micasaverde-com:serviceId:DoorLock1&variable=sl_UserCode&device=0-10237&scene=12&expression=(UserName%20~%3D%20nil)&xml=&provider=undefined&channelid=undefined&readkey=undefined&data=undefined&graphicurl=undefined&_=1449583794416 tcp{client}: 0x1afa9b8
2015-12-08 08:15:13.489   luup_log:0: ALTUI: ALTUI_Handler: request is: lr_ALTUI_Handler
2015-12-08 08:15:13.490   luup_log:0: ALTUI: ALTUI_Handler: parameters is: {"scene":"12","service":"urn:micasaverde-com:serviceId:DoorLock1","data":"undefined","expression":"(UserName ~= nil)","channelid":"undefined","provider":"undefined","graphicurl":"undefined","readkey":"undefined","command":"delWatch","variable":"sl_UserCode","_":"1449583794416","device":"0-10237"}
2015-12-08 08:15:13.490   luup_log:0: ALTUI: ALTUI_Handler: outputformat is: null
2015-12-08 08:15:13.490   luup_log:0: ALTUI: debug: hostname=10.0.4.10
2015-12-08 08:15:13.490   luup_log:0: ALTUI: debug: delWatch(3,urn:micasaverde-com:serviceId:DoorLock1,sl_UserCode,0-10237,12,(UserName ~= nil),,undefined,undefined,undefined,undefined,undefined)
2015-12-08 08:15:13.490   luup_log:0: ALTUI: debug: _delWatch(urn:micasaverde-com:serviceId:DoorLock1,sl_UserCode,0-10237,12,(UserName ~= nil),,undefined,undefined,undefined,undefined,undefined)
2015-12-08 08:15:13.491   luup.variable_set:0: 3.urn:upnp-org:serviceId:altui1.VariablesToWatch was: urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-10301#7#new == "1";urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-39#10#(new == '1')#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="289" y="16"><value name="Condition"><block type="logic_compare"><field name="OP">EQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="text"><field name="TEXT">1</field></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10509#9#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="263" y="18"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10508#8#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="227" y="25"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-10505#6#(new=="1");urn:micasaverde-com:serviceId:DoorLock1#sl_UserCode#0-10237#12#(UserName == UserName);urn:micasaverde-com:serviceId:DoorLock1#sl_UserCode#0-10237#12#(UserName ~= UserName);urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-10511#13#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="279" y="25"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10512#10110#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="233" y="3"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10512#14#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="236" y="14"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:micasaverde-com:serviceId:DoorLock1#sl_UserCode#0-10237#12#(UserName ~= nil) now: urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-10301#7#new == "1";urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-39#10#(new == '1')#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="289" y="16"><value name="Condition"><block type="logic_compare"><field name="OP">EQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="text"><field name="TEXT">1</field></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10509#9#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="263" y="18"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10508#8#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="227" y="25"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-10505#6#(new=="1");urn:micasaverde-com:serviceId:DoorLock1#sl_UserCode#0-10237#12#(UserName == UserName);urn:micasaverde-com:serviceId:DoorLock1#sl_UserCode#0-10237#12#(UserName ~= UserName);urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-10511#13#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="279" y="25"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10512#10110#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="233" y="3"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10512#14#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="236" y="14"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:micasaverde-com:serviceId:DoorLock1#sl_UserCode#0-10237#12#(UserName ~= nil) #hooks:0
2015-12-08 08:15:13.492   luup_log:0: ALTUI: debug: registeredWatches: {"0-10512":{"urn:upnp-org:serviceId:SwitchPower1":{"Status":{"Expressions":{"(new ~= old)":[{"SceneID":10110},{"SceneID":14}],"true":[{"SceneID":-1}]}}}},"0-10508":{"urn:upnp-org:serviceId:SwitchPower1":{"Status":{"Expressions":{"(new ~= old)":[{"SceneID":8}]}}}},"0-36":{"urn:upnp-org:serviceId:VContainer1":{"Variable1":{"Expressions":{"true":[{"SceneID":-1}]}}}},"0-10505":{"urn:micasaverde-com:serviceId:SecuritySensor1":{"Tripped":{"Expressions":{"true":[{"SceneID":-1}],"(new==\"1\")":[{"SceneID":6}]}}}},"0-10237":{"urn:micasaverde-com:serviceId:DoorLock1":{"sl_UserCode":{"Expressions":{"(UserName ~= UserName)":[{"SceneID":12}]}}}},"0-39":{"urn:micasaverde-com:serviceId:SecuritySensor1":{"Tripped":{"Expressions":{"(new == '1')":[{"SceneID":10}]}}}},"0-10511":{"urn:micasaverde-com:serviceId:SecuritySensor1":{"Tripped":{"Expressions":{"(new ~= old)":[{"SceneID":13}],"true":[{"SceneID":-1}]}}}},"0-10509":{"urn:upnp-org:serviceId:SwitchPower1":{"Status":{"Expressions":{"(new ~= old)":[{"SceneID":9}],"true":[{"SceneID":-1}]}}}},"0-10248":{"urn:micasaverde-com:serviceId:EnergyMetering1":{"Watts":{"DataProviders":{"thingspeak":[{"Data":"key=5QBTW7D2VMYJS38F&field1=%s"}]},"Expressions":{"true":[{"SceneID":-1}]}}}},"0-10301":{"urn:micasaverde-com:serviceId:SecuritySensor1":{"Tripped":{"Expressions":{"true":[{"SceneID":-1}],"new == \"1\"":[{"SceneID":7}]}}}}}
2015-12-08 08:15:13.492   luup_log:0: ALTUI: debug: lul_html:1
2015-12-08 08:15:13.494   openLuup.context_switch::  ERROR: ./openLuup/server.lua:226: attempt to get length of a number value
2015-12-08 08:15:13.494   openLuup.scheduler:: job aborted : ./openLuup/server.lua:226: attempt to get length of a number value
2015-12-08 08:15:13.494   openLuup.server:: /data_request?id=scene&action=create&json=%7B%22timers%22%3A%5B%5D%2C%22triggers%22%3A%5B%5D%2C%22groups%22%3A%5B%7B%22actions%22%3A%5B%5D%2C%22delay%22%3A0%7D%5D%2C%22Timestamp%22%3A1448979204%2C%22favorite%22%3Afalse%2C%22id%22%3A12%2C%22lua%22%3A%22luup.log(%5C%22Front%20Door%5C%22)%22%2C%22modeStatus%22%3A%220%22%2C%22name%22%3A%22Front%20Door%22%2C%22room%22%3A0%2C%22paused%22%3A0%7D tcp{client}: 0x1afca68
2015-12-08 08:15:13.497   openLuup.server:: request completed (2 bytes, 1 chunks, 2 ms) tcp{client}: 0x1afca68
2015-12-08 08:15:14.010   openLuup.server:: request completed (26168 bytes, 2 chunks, 10591 ms) tcp{client}: 0x1d67068
2015-12-08 08:15:14.014   openLuup.server:: /data_request?id=user_data&output_format=json&DataVersion=584032115&_=1449583794417 tcp{client}: 0x1d67068
2015-12-08 08:15:14.345   openLuup.server:: request completed (668112 bytes, 42 chunks, 330 ms) tcp{client}: 0x1d67068
2015-12-08 08:15:16.363   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=584036527&Timeout=60&MinimumDelay=1500&_=1449583794418 tcp{client}: 0x1d67068
2015-12-08 08:15:19.025   luup.variable_set:43: 10027.urn:micasaverde-com:serviceId:ZWaveNetwork1.LastPollSuccess was: 1449583479 now: 1449584179 #hooks:0
2015-12-08 08:15:19.501   openLuup.server:: /data_request?id=lr_ALTUI_Handler&command=oscommand&oscommand=tail%20-n%20500%20%2Fetc%2Fcmh-ludl%2FLuaUPnP.log&_=1449583794419 tcp{client}: 0x1afca68
2015-12-08 08:15:19.502   luup_log:0: ALTUI: ALTUI_Handler: request is: lr_ALTUI_Handler
2015-12-08 08:15:19.502   luup_log:0: ALTUI: ALTUI_Handler: parameters is: {"command":"oscommand","oscommand":"tail -n 500 /etc/cmh-ludl/LuaUPnP.log","_":"1449583794419"}
2015-12-08 08:15:19.502   luup_log:0: ALTUI: ALTUI_Handler: outputformat is: null
2015-12-08 08:15:19.502   luup_log:0: ALTUI: debug: hostname=10.0.4.10

[5] Reloaded engine. See attached for those logs.

I hope this helps. Last resort I'll simply have to either try to delete the scene all together OR remove it from the user_data.json file...

openLuup, AltUI, Zway and HomeWave, enough said...

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: Watched Variables
« Reply #22 on: December 08, 2015, 11:12:58 am »
Quote
Upgrade went very well, no issues so far.

That's good.  Can you confirm that the latest AltUI shows your Vera username at the bottom?  This will be key for the v1.0 upgrade.

I'll take a look at the WV problem, and I see there's definitely another error in the log.
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 CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: Watched Variables
« Reply #23 on: December 08, 2015, 11:26:17 am »
Yes, I can confirm that my username is displaying properly.
Let me know what else I can provide regarding the WV, I'm home today trying to catch up on some things so I'll check back when I get a chance.

Quote
Upgrade went very well, no issues so far.

That's good.  Can you confirm that the latest AltUI shows your Vera username at the bottom?  This will be key for the v1.0 upgrade.

I'll take a look at the WV problem, and I see there's definitely another error in the log.
openLuup, AltUI, Zway and HomeWave, enough said...

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: Watched Variables
« Reply #24 on: December 08, 2015, 11:42:50 am »
Let me know what else I can provide regarding the WV, I'm home today trying to catch up on some things so I'll check back when I get a chance.

OK, well try this more carefully instrumented server.lua file.  Thanks
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 CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: Watched Variables
« Reply #25 on: December 08, 2015, 12:00:25 pm »
Same process except for the reload...

Code: [Select]
2015-12-08 10:54:14.879   openLuup.server:: request completed (17378 bytes, 2 chunks, 5510 ms) tcp{client}: 0x25d50f8
2015-12-08 10:54:14.984   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=593609536&Timeout=60&MinimumDelay=1500&_=1449593683100 tcp{client}: 0x25d50f8
2015-12-08 10:54:15.816   openLuup.server:: /data_request?id=lr_ALTUI_Handler&command=delWatch&service=urn:micasaverde-com:serviceId:DoorLock1&variable=sl_UserCode&device=0-10237&scene=12&expression=(UserName%20%3D%3D%20UserName)&xml=&provider=undefined&channelid=undefined&readkey=undefined&data=undefined&graphicurl=undefined&_=1449593683101 tcp{client}: 0x2a31458
2015-12-08 10:54:15.817   luup_log:0: ALTUI: ALTUI_Handler: request is: lr_ALTUI_Handler
2015-12-08 10:54:15.817   luup_log:0: ALTUI: ALTUI_Handler: parameters is: {"scene":"12","service":"urn:micasaverde-com:serviceId:DoorLock1","data":"undefined","expression":"(UserName == UserName)","channelid":"undefined","provider":"undefined","graphicurl":"undefined","readkey":"undefined","command":"delWatch","variable":"sl_UserCode","_":"1449593683101","device":"0-10237"}
2015-12-08 10:54:15.817   luup_log:0: ALTUI: ALTUI_Handler: outputformat is: null
2015-12-08 10:54:15.818   luup_log:0: ALTUI: debug: hostname=10.0.4.10
2015-12-08 10:54:15.818   luup_log:0: ALTUI: debug: delWatch(3,urn:micasaverde-com:serviceId:DoorLock1,sl_UserCode,0-10237,12,(UserName == UserName),,undefined,undefined,undefined,undefined,undefined)
2015-12-08 10:54:15.818   luup_log:0: ALTUI: debug: _delWatch(urn:micasaverde-com:serviceId:DoorLock1,sl_UserCode,0-10237,12,(UserName == UserName),,undefined,undefined,undefined,undefined,undefined)
2015-12-08 10:54:15.818   luup.variable_set:0: 3.urn:upnp-org:serviceId:altui1.VariablesToWatch was: urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-10301#7#new == "1";urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-39#10#(new == '1')#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="289" y="16"><value name="Condition"><block type="logic_compare"><field name="OP">EQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="text"><field name="TEXT">1</field></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10509#9#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="263" y="18"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10508#8#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="227" y="25"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-10505#6#(new=="1");urn:micasaverde-com:serviceId:DoorLock1#sl_UserCode#0-10237#12#(UserName == UserName);urn:micasaverde-com:serviceId:DoorLock1#sl_UserCode#0-10237#12#(UserName ~= UserName);urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-10511#13#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="279" y="25"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10512#10110#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="233" y="3"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10512#14#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="236" y="14"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:micasaverde-com:serviceId:DoorLock1#sl_UserCode#0-10237#12#(UserName ~= nil) now: urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-10301#7#new == "1";urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-39#10#(new == '1')#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="289" y="16"><value name="Condition"><block type="logic_compare"><field name="OP">EQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="text"><field name="TEXT">1</field></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10509#9#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="263" y="18"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10508#8#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="227" y="25"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-10505#6#(new=="1");urn:micasaverde-com:serviceId:DoorLock1#sl_UserCode#0-10237#12#(UserName == UserName);urn:micasaverde-com:serviceId:DoorLock1#sl_UserCode#0-10237#12#(UserName ~= UserName);urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-10511#13#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="279" y="25"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10512#10110#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="233" y="3"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10512#14#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="236" y="14"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:micasaverde-com:serviceId:DoorLock1#sl_UserCode#0-10237#12#(UserName ~= nil) #hooks:0
2015-12-08 10:54:15.820   luup_log:0: ALTUI: debug: registeredWatches: {"0-10512":{"urn:upnp-org:serviceId:SwitchPower1":{"Status":{"Expressions":{"(new ~= old)":[{"SceneID":10110},{"SceneID":14}],"true":[{"SceneID":-1}]}}}},"0-10508":{"urn:upnp-org:serviceId:SwitchPower1":{"Status":{"Expressions":{"(new ~= old)":[{"SceneID":8}]}}}},"0-36":{"urn:upnp-org:serviceId:VContainer1":{"Variable1":{"Expressions":{"true":[{"SceneID":-1}]}}}},"0-10505":{"urn:micasaverde-com:serviceId:SecuritySensor1":{"Tripped":{"Expressions":{"true":[{"SceneID":-1}],"(new==\"1\")":[{"SceneID":6}]}}}},"0-10237":{"urn:micasaverde-com:serviceId:DoorLock1":{"sl_UserCode":{"Expressions":{"(UserName ~= UserName)":[{"SceneID":12}],"(UserName ~= nil)":[{"SceneID":12}]}}}},"0-39":{"urn:micasaverde-com:serviceId:SecuritySensor1":{"Tripped":{"Expressions":{"(new == '1')":[{"SceneID":10}]}}}},"0-10511":{"urn:micasaverde-com:serviceId:SecuritySensor1":{"Tripped":{"Expressions":{"(new ~= old)":[{"SceneID":13}],"true":[{"SceneID":-1}]}}}},"0-10509":{"urn:upnp-org:serviceId:SwitchPower1":{"Status":{"Expressions":{"(new ~= old)":[{"SceneID":9}],"true":[{"SceneID":-1}]}}}},"0-10248":{"urn:micasaverde-com:serviceId:EnergyMetering1":{"Watts":{"DataProviders":{"thingspeak":[{"Data":"key={Removed by Cuda}&field1=%s"}]},"Expressions":{"true":[{"SceneID":-1}]}}}},"0-10301":{"urn:micasaverde-com:serviceId:SecuritySensor1":{"Tripped":{"Expressions":{"true":[{"SceneID":-1}],"new == \"1\"":[{"SceneID":7}]}}}}}
2015-12-08 10:54:15.820   luup_log:0: ALTUI: debug: lul_html:1
2015-12-08 10:54:15.820   openLuup.server:: WARNING - HTTP response is of type number
2015-12-08 10:54:15.821   openLuup.server:: HTTP response: 1
2015-12-08 10:54:15.822   openLuup.server:: request completed (1 bytes, 1 chunks, 6 ms) tcp{client}: 0x2a31458
2015-12-08 10:54:15.823   openLuup.server:: /data_request?id=scene&action=create&json=%7B%22timers%22%3A%5B%5D%2C%22triggers%22%3A%5B%5D%2C%22groups%22%3A%5B%7B%22actions%22%3A%5B%5D%2C%22delay%22%3A0%7D%5D%2C%22Timestamp%22%3A1448979204%2C%22favorite%22%3Afalse%2C%22id%22%3A12%2C%22lua%22%3A%22luup.log(%5C%22Front%20Door%5C%22)%22%2C%22modeStatus%22%3A%220%22%2C%22name%22%3A%22Front%20Door%22%2C%22room%22%3A0%2C%22paused%22%3A0%7D tcp{client}: 0x2829178
2015-12-08 10:54:15.823   openLuup.server:: /data_request?id=lr_ALTUI_Handler&command=delWatch&service=urn:micasaverde-com:serviceId:DoorLock1&variable=sl_UserCode&device=0-10237&scene=12&expression=(UserName%20~%3D%20nil)&xml=&provider=undefined&channelid=undefined&readkey=undefined&data=undefined&graphicurl=undefined&_=1449593683102 tcp{client}: 0x20ba778
2015-12-08 10:54:15.826   openLuup.server:: request completed (2 bytes, 1 chunks, 3 ms) tcp{client}: 0x2829178
2015-12-08 10:54:15.826   luup_log:0: ALTUI: ALTUI_Handler: request is: lr_ALTUI_Handler
2015-12-08 10:54:15.827   luup_log:0: ALTUI: ALTUI_Handler: parameters is: {"scene":"12","service":"urn:micasaverde-com:serviceId:DoorLock1","data":"undefined","expression":"(UserName ~= nil)","channelid":"undefined","provider":"undefined","graphicurl":"undefined","readkey":"undefined","command":"delWatch","variable":"sl_UserCode","_":"1449593683102","device":"0-10237"}
2015-12-08 10:54:15.827   luup_log:0: ALTUI: ALTUI_Handler: outputformat is: null
2015-12-08 10:54:15.827   luup_log:0: ALTUI: debug: hostname=10.0.4.10
2015-12-08 10:54:15.827   luup_log:0: ALTUI: debug: delWatch(3,urn:micasaverde-com:serviceId:DoorLock1,sl_UserCode,0-10237,12,(UserName ~= nil),,undefined,undefined,undefined,undefined,undefined)
2015-12-08 10:54:15.827   luup_log:0: ALTUI: debug: _delWatch(urn:micasaverde-com:serviceId:DoorLock1,sl_UserCode,0-10237,12,(UserName ~= nil),,undefined,undefined,undefined,undefined,undefined)
2015-12-08 10:54:15.828   luup.variable_set:0: 3.urn:upnp-org:serviceId:altui1.VariablesToWatch was: urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-10301#7#new == "1";urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-39#10#(new == '1')#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="289" y="16"><value name="Condition"><block type="logic_compare"><field name="OP">EQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="text"><field name="TEXT">1</field></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10509#9#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="263" y="18"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10508#8#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="227" y="25"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-10505#6#(new=="1");urn:micasaverde-com:serviceId:DoorLock1#sl_UserCode#0-10237#12#(UserName == UserName);urn:micasaverde-com:serviceId:DoorLock1#sl_UserCode#0-10237#12#(UserName ~= UserName);urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-10511#13#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="279" y="25"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10512#10110#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="233" y="3"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10512#14#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="236" y="14"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:micasaverde-com:serviceId:DoorLock1#sl_UserCode#0-10237#12#(UserName ~= nil) now: urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-10301#7#new == "1";urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-39#10#(new == '1')#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="289" y="16"><value name="Condition"><block type="logic_compare"><field name="OP">EQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="text"><field name="TEXT">1</field></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10509#9#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="263" y="18"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10508#8#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="227" y="25"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-10505#6#(new=="1");urn:micasaverde-com:serviceId:DoorLock1#sl_UserCode#0-10237#12#(UserName == UserName);urn:micasaverde-com:serviceId:DoorLock1#sl_UserCode#0-10237#12#(UserName ~= UserName);urn:micasaverde-com:serviceId:SecuritySensor1#Tripped#0-10511#13#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="279" y="25"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10512#10110#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="233" y="3"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:upnp-org:serviceId:SwitchPower1#Status#0-10512#14#(new ~= old)#<xml xmlns="http://www.w3.org/1999/xhtml"><block type="when" x="236" y="14"><value name="Condition"><block type="logic_compare"><field name="OP">NEQ</field><value name="A"><block type="new_value"></block></value><value name="B"><block type="old_value"></block></value></block></value></block></xml>;urn:micasaverde-com:serviceId:DoorLock1#sl_UserCode#0-10237#12#(UserName ~= nil) #hooks:0
2015-12-08 10:54:15.829   luup_log:0: ALTUI: debug: registeredWatches: {"0-10512":{"urn:upnp-org:serviceId:SwitchPower1":{"Status":{"Expressions":{"(new ~= old)":[{"SceneID":10110},{"SceneID":14}],"true":[{"SceneID":-1}]}}}},"0-10508":{"urn:upnp-org:serviceId:SwitchPower1":{"Status":{"Expressions":{"(new ~= old)":[{"SceneID":8}]}}}},"0-36":{"urn:upnp-org:serviceId:VContainer1":{"Variable1":{"Expressions":{"true":[{"SceneID":-1}]}}}},"0-10505":{"urn:micasaverde-com:serviceId:SecuritySensor1":{"Tripped":{"Expressions":{"true":[{"SceneID":-1}],"(new==\"1\")":[{"SceneID":6}]}}}},"0-10237":{"urn:micasaverde-com:serviceId:DoorLock1":{"sl_UserCode":{"Expressions":{"(UserName ~= UserName)":[{"SceneID":12}]}}}},"0-39":{"urn:micasaverde-com:serviceId:SecuritySensor1":{"Tripped":{"Expressions":{"(new == '1')":[{"SceneID":10}]}}}},"0-10511":{"urn:micasaverde-com:serviceId:SecuritySensor1":{"Tripped":{"Expressions":{"(new ~= old)":[{"SceneID":13}],"true":[{"SceneID":-1}]}}}},"0-10509":{"urn:upnp-org:serviceId:SwitchPower1":{"Status":{"Expressions":{"(new ~= old)":[{"SceneID":9}],"true":[{"SceneID":-1}]}}}},"0-10248":{"urn:micasaverde-com:serviceId:EnergyMetering1":{"Watts":{"DataProviders":{"thingspeak":[{"Data":"key={Removed by Cuda}&field1=%s"}]},"Expressions":{"true":[{"SceneID":-1}]}}}},"0-10301":{"urn:micasaverde-com:serviceId:SecuritySensor1":{"Tripped":{"Expressions":{"true":[{"SceneID":-1}],"new == \"1\"":[{"SceneID":7}]}}}}}
2015-12-08 10:54:15.829   luup_log:0: ALTUI: debug: lul_html:1
2015-12-08 10:54:15.830   openLuup.server:: WARNING - HTTP response is of type number
2015-12-08 10:54:15.830   openLuup.server:: HTTP response: 1
2015-12-08 10:54:15.832   openLuup.server:: request completed (1 bytes, 1 chunks, 8 ms) tcp{client}: 0x20ba778
2015-12-08 10:54:16.843   openLuup.server:: request completed (16096 bytes, 2 chunks, 1859 ms) tcp{client}: 0x25d50f8
2015-12-08 10:54:16.848   openLuup.server:: /data_request?id=user_data&output_format=json&DataVersion=593605118&_=1449593683103 tcp{client}: 0x25d50f8
2015-12-08 10:54:17.170   openLuup.server:: request completed (668528 bytes, 42 chunks, 322 ms) tcp{client}: 0x25d50f8
2015-12-08 10:54:19.189   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=593609539&Timeout=60&MinimumDelay=1500&_=1449593683104 tcp{client}: 0x25d50f8

Let me know what else I can provide regarding the WV, I'm home today trying to catch up on some things so I'll check back when I get a chance.

OK, well try this more carefully instrumented server.lua file.  Thanks
openLuup, AltUI, Zway and HomeWave, enough said...

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: Watched Variables
« Reply #26 on: December 08, 2015, 12:04:14 pm »
And the reload...
openLuup, AltUI, Zway and HomeWave, enough said...

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: Watched Variables
« Reply #27 on: December 08, 2015, 12:36:05 pm »
OK, I have no real idea what is going on here.  This is all AltUI stuff.

What I do know is that the message:
Code: [Select]
luup_log:0: ALTUI: debug: lul_html:1

comes from line 1261 of L_ALTUI.lua, and shows that the call to whatever function 'switch' dispatches returns a number '1'.  In my book, this is just plain wrong.  Suggest that you confer with @amg0.

Have you simply deleted the scene and tried this again?  All the 'undefined' entries in the log look unwelcoming.
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 CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: Watched Variables
« Reply #28 on: December 08, 2015, 12:57:00 pm »
I'll point amg0 to this thread. I'm not confident I can recreate the problem so I'll just let the scene sit untouched until amg0 has a look. Thanks for looking at this though. I'll rename the server.lua file and revert to the latest release.

OK, I have no real idea what is going on here.  This is all AltUI stuff.

What I do know is that the message:
Code: [Select]
luup_log:0: ALTUI: debug: lul_html:1

comes from line 1261 of L_ALTUI.lua, and shows that the call to whatever function 'switch' dispatches returns a number '1'.  In my book, this is just plain wrong.  Suggest that you confer with @amg0.

Have you simply deleted the scene and tried this again?  All the 'undefined' entries in the log look unwelcoming.
openLuup, AltUI, Zway and HomeWave, enough said...

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: Watched Variables
« Reply #29 on: December 08, 2015, 01:16:00 pm »
I'm not confident I can recreate the problem so I'll just let the scene sit untouched until amg0 has a look.

Well, that's the point, really.  Who knows what iterations of openLuup / VeraBridge / AltUI you've gone through to generate this situation?  It might not be a real problem at all.

You can always save the user_data.json and restart a system from there.
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.