Problem with devicechanged

Moderator: leecollings

Post Reply
jmleglise
Posts: 192
Joined: Monday 12 January 2015 23:27
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: FRANCE
Contact:

Problem with devicechanged

Post 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 ?
My script : https://github.com/jmleglise
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
User avatar
jvdz
Posts: 2334
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Problem with devicechanged

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
jmleglise
Posts: 192
Joined: Monday 12 January 2015 23:27
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: FRANCE
Contact:

Re: Problem with devicechanged

Post 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 ?!?
My script : https://github.com/jmleglise
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest