lua script broke since domoticz update

Moderator: leecollings

Post Reply
cctl01
Posts: 5
Joined: Wednesday 24 July 2013 12:22
Target OS: Linux
Domoticz version:
Contact:

lua script broke since domoticz update

Post 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?
User avatar
jvdz
Posts: 2485
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: lua script broke since domoticz update

Post by jvdz »

The string has 3 values in it. Does this devices has multiple values to show?
Which one is the correct one?

Jos
cctl01
Posts: 5
Joined: Wednesday 24 July 2013 12:22
Target OS: Linux
Domoticz version:
Contact:

Re: lua script broke since domoticz update

Post 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?
User avatar
jvdz
Posts: 2485
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: lua script broke since domoticz update

Post 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
cctl01
Posts: 5
Joined: Wednesday 24 July 2013 12:22
Target OS: Linux
Domoticz version:
Contact:

Re: lua script broke since domoticz update

Post by cctl01 »

The hardware is dummy and type sensor is custom sensor. The value is displayed correctly in Domoticz and graphs etc seem fine.
Post Reply