Page 1 of 1

lua script broke since domoticz update

Posted: Monday 24 September 2018 21:32
by cctl01
My script used to be able to perfrom calculations on the value of my CO2 sensor that i would get using the line

Code: Select all

sCO2 = tonumber(otherdevices_svalues['CO2 woonkamer'])
A few weeks ago i updated Domoticz to the latest stable (4.9788) and since the script results in:

Code: Select all

Error: EventSystem: in CO2 aansturing: [string "commandArray = {}..."]:3: attempt to call field 'CO2 woonkamer' (a string value)
This is the value of CO2 woonkamer according domoticz

Code: Select all

0/667;25.00;0.00
Would anyone know how to fix this?

Re: lua script broke since domoticz update

Posted: Monday 24 September 2018 22:05
by jvdz
The string has 3 values in it. Does this devices has multiple values to show?
Which one is the correct one?

Jos

Re: lua script broke since domoticz update

Posted: Wednesday 26 September 2018 12:29
by cctl01
The device shows only one value, the first. (667)
Do you think LUA does no longer accept anything other than a number when using tonumber?

Re: lua script broke since domoticz update

Posted: Wednesday 26 September 2018 13:10
by jvdz
Well the tonumber function does expect a string containing a valid number.
By the way: 667 is not the first value in the string but rather: 0/667. So what exact type of device is this in domoticz?
Jos

Re: lua script broke since domoticz update

Posted: Wednesday 26 September 2018 21:52
by cctl01
The hardware is dummy and type sensor is custom sensor. The value is displayed correctly in Domoticz and graphs etc seem fine.