Page 1 of 1

Problem with devicechanged

Posted: Wednesday 06 July 2016 20:10
by jmleglise
Hi,

I've got a strange behavior.

I have a Virtual Hardware named "Lux" of type Lux / sub type Lux.

I update it without problem with

Code: Select all

        commandArray[1] = {['UpdateDevice'] = myidx..'|0|'..'xxx'}
But in a script_device_cc.lua I can't detect the change of it.
This line has no effect :

Code: Select all

 if devicechanged['Lux'] 
any clue ?

Re: Problem with devicechanged

Posted: Wednesday 06 July 2016 20:27
by jvdz
Try adding this to a script_device_xx.lua script to list the devices that are update and then run the logic that updates your LUX device:

Code: Select all

commandArray = {}
------------------------------------
-- List devices that changed
------------------------------------
for i, v in pairs(devicechanged) do
	print("Device =>"..i.."   status:"..v)
end

return commandArray
This should tell you what is triggered if any.
Jos

Re: Problem with devicechanged

Posted: Wednesday 06 July 2016 22:28
by jmleglise
Thanks, that confirmes :

Custom sensor, and virtual Lux sensor don't rise a "devicechanged".
However , temperature, and other, percentage dummy work fine.

I've tested on 3.51xx and 3.52xx

How is it possible ?!?