Problem updating a device.
Posted: Wednesday 13 April 2016 11:36
Hello,
This is doing my nut in.
I am reading from a string a value and I want to update that into my temperature dummy sensor.
I have a string "temperature" which reads in a value from a position in the string at j to i-1
local temperature=string.sub(XML_string,j,i-1)
I then update my variable at idx 108
commandArray = {}
This works:
commandArray['UpdateDevice'] = "108|0|25.20"
but this doesn't which is what I want:
commandArray['UpdateDevice'] = "108|0|..temperature
When I test it with
print ("temp= "..temperature.." length= "..z)
I get the right number (i.e. 25.20) with the correct length printed in the log.
What am I doing wrong or how can I debug further?
Thanks!
This is doing my nut in.
I am reading from a string a value and I want to update that into my temperature dummy sensor.
I have a string "temperature" which reads in a value from a position in the string at j to i-1
local temperature=string.sub(XML_string,j,i-1)
I then update my variable at idx 108
commandArray = {}
This works:
commandArray['UpdateDevice'] = "108|0|25.20"
but this doesn't which is what I want:
commandArray['UpdateDevice'] = "108|0|..temperature
When I test it with
print ("temp= "..temperature.." length= "..z)
I get the right number (i.e. 25.20) with the correct length printed in the log.
What am I doing wrong or how can I debug further?
Thanks!