I’m hoping someone can sense check this as I think I’m going crazy……Sorry for placing so much info here but I think I’m going off my head!
My Item is set up as
String wtPayload {exec="<[C:\Openhab\conf\scripts\getTagList.cmd:50000:REGEX((.*?))]" }
The getTagList.cmd content is
curl -s -X POST -H “Content-Type: application/json; charset=utf-8” -H “Authorization: bearer XXXXXX-0fa9-4258-b8d0-98aa6157d21e” -d “” “http://mytaglist.com/ethClient.asmx/GetTagList”
I’ve modified the rule file to allow me to test with:
1- Script working as originally posted - it will transform the data that is sent from the batch file
2- Use a previously exported taglist that I assign to the same payload variable
I comment out each in turn to test
i.e.
rule UnpackWirelesstagPayload
when
Item wtPayload received update
then
logInfo("wt", "Wireless Tag Payload arrived...")
// 1 - The next line to test with the scripted payload
val String payload = wtPayload.state.toString
// 2 - This line to test with the set payload
// var String payload = ‘{“d”:[{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“Back Door”,“uuid”:“395eac08-3a39-4df0-9b32-8007a8d03712”,“comment”:"",“slaveId”:3,“tagType”:13,“lastComm”:131203733220625542,“alive”:true,“signaldBm”:-81,“batteryVolt”:2.8291962707054732,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:5,“eventState”:4,“tempEventState”:0,“OutOfRange”:false,“lux”:0,“temperature”:17.125207901000977,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:63.45037841796875,“capRaw”:0,“az2”:0,“capEventState”:1,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:14,“version1”:2,“freqOffset”:-15481,“freqCalApplied”:18424,“reviveEvery”:24,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:255,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.88},{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“Front Door”,“uuid”:“a73fc3da-89b0-4537-8543-1e4c4eb417b4”,“comment”:"",“slaveId”:2,“tagType”:13,“lastComm”:131090996181611151,“alive”:false,“signaldBm”:-120,“batteryVolt”:2.7126537052616704,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:5,“eventState”:4,“tempEventState”:0,“OutOfRange”:true,“lux”:0,“temperature”:18.304967880249023,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:59.25421142578125,“capRaw”:0,“az2”:0,“capEventState”:2,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:14,“version1”:2,“freqOffset”:-141,“freqCalApplied”:21337,“reviveEvery”:24,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:255,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.24},{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“My Keys”,“uuid”:“a84ea7f9-06fe-4fc7-8f6b-5bb03e37f3e3”,“comment”:"",“slaveId”:6,“tagType”:13,“lastComm”:131106038629255376,“alive”:false,“signaldBm”:-120,“batteryVolt”:2.7408466488344163,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:10,“eventState”:3,“tempEventState”:0,“OutOfRange”:true,“lux”:0,“temperature”:18.1011905670166,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:56.84332275390625,“capRaw”:0,“az2”:0,“capEventState”:0,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:14,“version1”:2,“freqOffset”:-13879,“freqCalApplied”:16122,“reviveEvery”:24,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:111,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.38},{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“Tag 5”,“uuid”:“cb0f78db-e9f0-4cbe-9c84-c0d55774f061”,“comment”:"",“slaveId”:5,“tagType”:13,“lastComm”:130963036652188222,“alive”:false,“signaldBm”:-120,“batteryVolt”:2.47269217344349,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:15,“eventState”:1,“tempEventState”:1,“OutOfRange”:true,“lux”:0,“temperature”:15.8918209075928,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:57.34686279296875,“capRaw”:0,“az2”:0,“capEventState”:0,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:14,“version1”:2,“freqOffset”:-239,“freqCalApplied”:4041,“reviveEvery”:24,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:255,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.12},{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“Front Room PIR”,“uuid”:“40eede82-bbbe-4e2f-961a-42ef27db8b46”,“comment”:"",“slaveId”:8,“tagType”:72,“lastComm”:131203734313750182,“alive”:true,“signaldBm”:-78,“batteryVolt”:2.9226575175410949,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:15,“eventState”:6,“tempEventState”:0,“OutOfRange”:false,“lux”:0,“temperature”:17.875965118408203,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:64.5718994140625,“capRaw”:0,“az2”:0,“capEventState”:0,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:143,“version1”:2,“freqOffset”:-17097,“freqCalApplied”:22141,“reviveEvery”:4,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:66,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.92},{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“Hall PIR”,“uuid”:“c86b7a79-2b4a-4ba9-8811-22748f618c93”,“comment”:"",“slaveId”:7,“tagType”:72,“lastComm”:131203733075000440,“alive”:true,“signaldBm”:-72,“batteryVolt”:2.9884504750112115,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:15,“eventState”:6,“tempEventState”:0,“OutOfRange”:false,“lux”:0,“temperature”:18.455120086669922,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:63.92340087890625,“capRaw”:0,“az2”:0,“capEventState”:0,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:143,“version1”:2,“freqOffset”:215,“freqCalApplied”:3190,“reviveEvery”:4,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:16,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.94},{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“Back Room PIR”,“uuid”:“dd2eb71c-d614-4697-a301-0b15a31ae0c1”,“comment”:"",“slaveId”:9,“tagType”:72,“lastComm”:131203733380313102,“alive”:true,“signaldBm”:-75,“batteryVolt”:2.9714635900454036,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:15,“eventState”:6,“tempEventState”:0,“OutOfRange”:false,“lux”:0,“temperature”:18.905572891235352,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:62.41278076171875,“capRaw”:0,“az2”:0,“capEventState”:0,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:143,“version1”:2,“freqOffset”:369,“freqCalApplied”:-1250,“reviveEvery”:4,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:57,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.93},{"__type":“MyTagList.Tag”,“notificationJS”:null,“name”:“Kitchen Thermostat”,“uuid”:“9c352334-3811-4bab-8295-6047a15407d8”,“comment”:"@Home",“slaveId”:-1,“tagType”:62,“lastComm”:131203734217940000,“alive”:true,“signaldBm”:-60,“batteryVolt”:3,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:15,“eventState”:5,“tempEventState”:1,“OutOfRange”:false,“lux”:0,“temperature”:20.5,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:50,“capRaw”:0,“az2”:0,“capEventState”:0,“lightEventState”:0,“shorted”:false,“thermostat”:{“nest_id”:“YucPu7ZCFhaC9-ezLcJTouwLnnHJaWv9”,“honeywell_device_id”:0,“th_low”:14,“th_high”:24,“threshold_q”:{"__type":“MyTagList.Tag+ThresholdQuantization”,“min”:9,“max”:32,“step”:0.1,“sample1”:14,“sample2”:24},“targetUuid”:“9c352334-3811-4bab-8295-6047a15407d8”,“turnOff”:false,“fanOn”:false,“disableLocal”:false,“issuedState”:0},“playback”:null,“postBackInterval”:600,“rev”:0,“version1”:3,“freqOffset”:-18153,“freqCalApplied”:0,“reviveEvery”:4,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:0,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.94}]}’
logInfo("wt", payload)
var i = -1
//search for no more than 999 tags (this can be modified to whatever, just be sure to adjust the ".length" in the following if statement
while ((i=i+1) <= 999) {
//parsing an item that doesn't exist returns the entire string
//so a length larger than 3 characters has exceeded our max slaveID value of 999
if (transform("JSONPATH", "$.d["+i+"].slaveId", payload).length > 3){
return false //stop processing
}
Etc…
Here is the output when running with the original (1)
2016-10-13 11:08:47.246 [INFO ] [rg.eclipse.smarthome.model.script.wt] - Wireless Tag Payload arrived…
2016-10-13 11:08:47.246 [INFO ] [rg.eclipse.smarthome.model.script.wt] - C:\Openhab\userdata>curl -s -X POST -H “Content-Type: application/json; charset=utf-8” -H “Authorization: bearer XXXXXXX-0fa9-4258-b8d0-98aa6157d21e” -d “” “http://mytaglist.com/ethClient.asmx/GetTagList”
{“d”:[{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“Back Door”,“uuid”:“395eac08-3a39-4df0-9b32-8007a8d03712”,“comment”:"",“slaveId”:3,“tagType”:13,“lastComm”:131207823430274117,“alive”:false,“signaldBm”:-120,“batteryVolt”:2.7843747114367434,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:5,“eventState”:1,“tempEventState”:0,“OutOfRange”:true,“lux”:0,“temperature”:17.489860534667969,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:67.5626220703125,“capRaw”:0,“az2”:0,“capEventState”:1,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:14,“version1”:2,“freqOffset”:107,“freqCalApplied”:2803,“reviveEvery”:24,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:175,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.67},{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“Front Door”,“uuid”:“a73fc3da-89b0-4537-8543-1e4c4eb417b4”,“comment”:"",“slaveId”:2,“tagType”:13,“lastComm”:131090996181611151,“alive”:false,“signaldBm”:-120,“batteryVolt”:2.7126537052616704,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:5,“eventState”:4,“tempEventState”:0,“OutOfRange”:true,“lux”:0,“temperature”:18.304967880249023,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:59.25421142578125,“capRaw”:0,“az2”:0,“capEventState”:2,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:14,“version1”:2,“freqOffset”:-141,“freqCalApplied”:21337,“reviveEvery”:24,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:255,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.24},{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“My Keys”,“uuid”:“a84ea7f9-06fe-4fc7-8f6b-5bb03e37f3e3”,“comment”:"",“slaveId”:6,“tagType”:13,“lastComm”:131106038629255376,“alive”:false,“signaldBm”:-120,“batteryVolt”:2.7408466488344163,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:10,“eventState”:3,“tempEventState”:0,“OutOfRange”:true,“lux”:0,“temperature”:18.1011905670166,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:56.84332275390625,“capRaw”:0,“az2”:0,“capEventState”:0,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:14,“version1”:2,“freqOffset”:-13879,“freqCalApplied”:16122,“reviveEvery”:24,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:111,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.38},{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“Tag 5”,“uuid”:“cb0f78db-e9f0-4cbe-9c84-c0d55774f061”,“comment”:"",“slaveId”:5,“tagType”:13,“lastComm”:130963036652188222,“alive”:false,“signaldBm”:-120,“batteryVolt”:2.47269217344349,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:15,“eventState”:1,“tempEventState”:1,“OutOfRange”:true,“lux”:0,“temperature”:15.8918209075928,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:57.34686279296875,“capRaw”:0,“az2”:0,“capEventState”:0,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:14,“version1”:2,“freqOffset”:-239,“freqCalApplied”:4041,“reviveEvery”:24,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:255,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.12},{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“Front Room PIR”,“uuid”:“40eede82-bbbe-4e2f-961a-42ef27db8b46”,“comment”:"",“slaveId”:8,“tagType”:72,“lastComm”:131204242634375585,“alive”:false,“signaldBm”:-120,“batteryVolt”:2.9227316354915449,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:15,“eventState”:6,“tempEventState”:0,“OutOfRange”:true,“lux”:0,“temperature”:17.704362869262695,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:64.59478759765625,“capRaw”:0,“az2”:0,“capEventState”:0,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:143,“version1”:2,“freqOffset”:-17227,“freqCalApplied”:22141,“reviveEvery”:4,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:66,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.92},{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“Hall PIR”,“uuid”:“c86b7a79-2b4a-4ba9-8811-22748f618c93”,“comment”:"",“slaveId”:7,“tagType”:72,“lastComm”:131208266530312699,“alive”:true,“signaldBm”:-71,“batteryVolt”:2.9721654436629645,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:15,“eventState”:6,“tempEventState”:0,“OutOfRange”:false,“lux”:0,“temperature”:17.307533264160156,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:66.12066650390625,“capRaw”:0,“az2”:0,“capEventState”:0,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:143,“version1”:2,“freqOffset”:-15725,“freqCalApplied”:19173,“reviveEvery”:4,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:49,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.94},{"__type":“MyTagList.Tag”,“notificationJS”:null,“name”:“Hall PIR2”,“uuid”:“e1013cb5-7368-40ae-a013-181247b3d9ac”,“comment”:"",“slaveId”:10,“tagType”:72,“lastComm”:131208267938125849,“alive”:true,“signaldBm”:-71,“batteryVolt”:3.0406115538562908,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:15,“eventState”:0,“tempEventState”:0,“OutOfRange”:false,“lux”:0,“temperature”:17.039405822753906,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:62.18389892578125,“capRaw”:0,“az2”:0,“capEventState”:0,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:143,“version1”:2,“freqOffset”:-15217,“freqCalApplied”:20879,“reviveEvery”:4,“oorGrace”:2,“LBTh”:2.55,“enLBN”:true,“txpwr”:54,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.96},{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“Back Room PIR”,“uuid”:“dd2eb71c-d614-4697-a301-0b15a31ae0c1”,“comment”:"",“slaveId”:9,“tagType”:72,“lastComm”:131208262588594974,“alive”:true,“signaldBm”:-78,“batteryVolt”:2.9719723158651092,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:15,“eventState”:5,“tempEventState”:0,“OutOfRange”:false,“lux”:0,“temperature”:17.747262954711914,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:63.80133056640625,“capRaw”:0,“az2”:0,“capEventState”:0,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:143,“version1”:2,“freqOffset”:-16789,“freqCalApplied”:16081,“reviveEvery”:4,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:72,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.93},{"__type":“MyTagList.Tag”,“notificationJS”:null,“name”:“Kitchen Thermostat”,“uuid”:“9c352334-3811-4bab-8295-6047a15407d8”,“comment”:"@Home",“slaveId”:-1,“tagType”:62,“lastComm”:131208266001540000,“alive”:true,“signaldBm”:-60,“batteryVolt”:3,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:15,“eventState”:5,“tempEventState”:1,“OutOfRange”:false,“lux”:0,“temperature”:19,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:50,“capRaw”:0,“az2”:0,“capEventState”:0,“lightEventState”:0,“shorted”:false,“thermostat”:{“nest_id”:“YucPu7ZCFhaC9-ezLcJTouwLnnHJaWv9”,“honeywell_device_id”:0,“th_low”:13,“th_high”:24,“threshold_q”:{"__type":“MyTagList.Tag+ThresholdQuantization”,“min”:9,“max”:32,“step”:0.1,“sample1”:13,“sample2”:24},“targetUuid”:“9c352334-3811-4bab-8295-6047a15407d8”,“turnOff”:false,“fanOn”:false,“disableLocal”:false,“issuedState”:0},“playback”:null,“postBackInterval”:600,“rev”:0,“version1”:3,“freqOffset”:-18153,“freqCalApplied”:0,“reviveEvery”:4,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:0,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.94}]}
2016-10-13 11:08:47.246 [ERROR] [.script.engine.ScriptExecutionThread] - Rule ‘UnpackWirelesstagPayload’: cannot invoke method public int java.lang.String.length() on null
And here is the output from (2) when using the hard set variable
2016-10-13 11:18:06.713 [INFO ] [rg.eclipse.smarthome.model.script.wt] - Wireless Tag Payload arrived…
2016-10-13 11:18:06.713 [INFO ] [rg.eclipse.smarthome.model.script.wt] - {“d”:[{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“Back Door”,“uuid”:“395eac08-3a39-4df0-9b32-8007a8d03712”,“comment”:"",“slaveId”:3,“tagType”:13,“lastComm”:131203733220625542,“alive”:true,“signaldBm”:-81,“batteryVolt”:2.8291962707054732,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:5,“eventState”:4,“tempEventState”:0,“OutOfRange”:false,“lux”:0,“temperature”:17.125207901000977,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:63.45037841796875,“capRaw”:0,“az2”:0,“capEventState”:1,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:14,“version1”:2,“freqOffset”:-15481,“freqCalApplied”:18424,“reviveEvery”:24,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:255,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.88},{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“Front Door”,“uuid”:“a73fc3da-89b0-4537-8543-1e4c4eb417b4”,“comment”:"",“slaveId”:2,“tagType”:13,“lastComm”:131090996181611151,“alive”:false,“signaldBm”:-120,“batteryVolt”:2.7126537052616704,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:5,“eventState”:4,“tempEventState”:0,“OutOfRange”:true,“lux”:0,“temperature”:18.304967880249023,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:59.25421142578125,“capRaw”:0,“az2”:0,“capEventState”:2,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:14,“version1”:2,“freqOffset”:-141,“freqCalApplied”:21337,“reviveEvery”:24,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:255,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.24},{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“My Keys”,“uuid”:“a84ea7f9-06fe-4fc7-8f6b-5bb03e37f3e3”,“comment”:"",“slaveId”:6,“tagType”:13,“lastComm”:131106038629255376,“alive”:false,“signaldBm”:-120,“batteryVolt”:2.7408466488344163,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:10,“eventState”:3,“tempEventState”:0,“OutOfRange”:true,“lux”:0,“temperature”:18.1011905670166,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:56.84332275390625,“capRaw”:0,“az2”:0,“capEventState”:0,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:14,“version1”:2,“freqOffset”:-13879,“freqCalApplied”:16122,“reviveEvery”:24,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:111,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.38},{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“Tag 5”,“uuid”:“cb0f78db-e9f0-4cbe-9c84-c0d55774f061”,“comment”:"",“slaveId”:5,“tagType”:13,“lastComm”:130963036652188222,“alive”:false,“signaldBm”:-120,“batteryVolt”:2.47269217344349,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:15,“eventState”:1,“tempEventState”:1,“OutOfRange”:true,“lux”:0,“temperature”:15.8918209075928,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:57.34686279296875,“capRaw”:0,“az2”:0,“capEventState”:0,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:14,“version1”:2,“freqOffset”:-239,“freqCalApplied”:4041,“reviveEvery”:24,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:255,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.12},{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“Front Room PIR”,“uuid”:“40eede82-bbbe-4e2f-961a-42ef27db8b46”,“comment”:"",“slaveId”:8,“tagType”:72,“lastComm”:131203734313750182,“alive”:true,“signaldBm”:-78,“batteryVolt”:2.9226575175410949,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:15,“eventState”:6,“tempEventState”:0,“OutOfRange”:false,“lux”:0,“temperature”:17.875965118408203,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:64.5718994140625,“capRaw”:0,“az2”:0,“capEventState”:0,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:143,“version1”:2,“freqOffset”:-17097,“freqCalApplied”:22141,“reviveEvery”:4,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:66,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.92},{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“Hall PIR”,“uuid”:“c86b7a79-2b4a-4ba9-8811-22748f618c93”,“comment”:"",“slaveId”:7,“tagType”:72,“lastComm”:131203733075000440,“alive”:true,“signaldBm”:-72,“batteryVolt”:2.9884504750112115,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:15,“eventState”:6,“tempEventState”:0,“OutOfRange”:false,“lux”:0,“temperature”:18.455120086669922,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:63.92340087890625,“capRaw”:0,“az2”:0,“capEventState”:0,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:143,“version1”:2,“freqOffset”:215,“freqCalApplied”:3190,“reviveEvery”:4,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:16,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.94},{"__type":“MyTagList.Tag”,“notificationJS”:"",“name”:“Back Room PIR”,“uuid”:“dd2eb71c-d614-4697-a301-0b15a31ae0c1”,“comment”:"",“slaveId”:9,“tagType”:72,“lastComm”:131203733380313102,“alive”:true,“signaldBm”:-75,“batteryVolt”:2.9714635900454036,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:15,“eventState”:6,“tempEventState”:0,“OutOfRange”:false,“lux”:0,“temperature”:18.905572891235352,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:62.41278076171875,“capRaw”:0,“az2”:0,“capEventState”:0,“lightEventState”:0,“shorted”:false,“thermostat”:null,“playback”:null,“postBackInterval”:900,“rev”:143,“version1”:2,“freqOffset”:369,“freqCalApplied”:-1250,“reviveEvery”:4,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:57,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.93},{"__type":“MyTagList.Tag”,“notificationJS”:null,“name”:“Kitchen Thermostat”,“uuid”:“9c352334-3811-4bab-8295-6047a15407d8”,“comment”:"@Home",“slaveId”:-1,“tagType”:62,“lastComm”:131203734217940000,“alive”:true,“signaldBm”:-60,“batteryVolt”:3,“beeping”:false,“lit”:false,“migrationPending”:false,“beepDurationDefault”:15,“eventState”:5,“tempEventState”:1,“OutOfRange”:false,“lux”:0,“temperature”:20.5,“tempCalOffset”:0,“capCalOffset”:0,“image_md5”:null,“cap”:50,“capRaw”:0,“az2”:0,“capEventState”:0,“lightEventState”:0,“shorted”:false,“thermostat”:{“nest_id”:“YucPu7ZCFhaC9-ezLcJTouwLnnHJaWv9”,“honeywell_device_id”:0,“th_low”:14,“th_high”:24,“threshold_q”:{"__type":“MyTagList.Tag+ThresholdQuantization”,“min”:9,“max”:32,“step”:0.1,“sample1”:14,“sample2”:24},“targetUuid”:“9c352334-3811-4bab-8295-6047a15407d8”,“turnOff”:false,“fanOn”:false,“disableLocal”:false,“issuedState”:0},“playback”:null,“postBackInterval”:600,“rev”:0,“version1”:3,“freqOffset”:-18153,“freqCalApplied”:0,“reviveEvery”:4,“oorGrace”:2,“LBTh”:2.5,“enLBN”:true,“txpwr”:0,“rssiMode”:false,“ds18”:false,“batteryRemaining”:0.94}]}
2016-10-13 11:18:06.713 [INFO ] [rg.eclipse.smarthome.model.script.wt] - Wireless Tag Payload (name: Back Door, slaveId: 3, temp: 17.125207901000977, cap: 63.45037841796875, batt: 0.88, state: 4)
2016-10-13 11:18:06.729 [INFO ] [rg.eclipse.smarthome.model.script.wt] - Wireless Tag Payload (name: Front Door, slaveId: 2, temp: 18.304967880249023, cap: 59.25421142578125, batt: 0.24, state: 4)
2016-10-13 11:18:06.729 [INFO ] [rg.eclipse.smarthome.model.script.wt] - Wireless Tag Payload (name: My Keys, slaveId: 6, temp: 18.1011905670166, cap: 56.84332275390625, batt: 0.38, state: 3)
2016-10-13 11:18:06.744 [INFO ] [rg.eclipse.smarthome.model.script.wt] - Wireless Tag Payload (name: Tag 5, slaveId: 5, temp: 15.8918209075928, cap: 57.34686279296875, batt: 0.12, state: 1)
2016-10-13 11:18:06.791 [INFO ] [rg.eclipse.smarthome.model.script.wt] - Wireless Tag Payload (name: Front Room PIR, slaveId: 8, temp: 17.875965118408203, cap: 64.5718994140625, batt: 0.92, state: 6)
2016-10-13 11:18:06.791 [INFO ] [rg.eclipse.smarthome.model.script.wt] - Wireless Tag Payload (name: Hall PIR, slaveId: 7, temp: 18.455120086669922, cap: 63.92340087890625, batt: 0.94, state: 6)
2016-10-13 11:18:06.791 [INFO ] [rg.eclipse.smarthome.model.script.wt] - Wireless Tag Payload (name: Back Room PIR, slaveId: 9, temp: 18.90557289123535, cap: 62.41278076171875, batt: 0.93, state: 6)
2016-10-13 11:18:06.807 [INFO ] [rg.eclipse.smarthome.model.script.wt] - Wireless Tag Payload (name: Kitchen Thermostat, slaveId: -1, temp: 20.5, cap: 50, batt: 0.94, state: 5)
2016-10-13 11:18:06.807 [ERROR] [.script.engine.ScriptExecutionThread] - Rule ‘UnpackWirelesstagPayload’: cannot invoke method public int java.lang.String.length() on null
There’s some things that I have noted:
- When using the variable, I’ve had to put the string in single quote '
- Even with using the variable, I get the cannot invoke method public on null error at the end.
Anyone know whats going on???