understanding devicechanged vs. otherdevices Topic is solved

Moderator: leecollings

Post Reply
User avatar
RonkA
Posts: 115
Joined: Tuesday 14 June 2022 12:57
Target OS: NAS (Synology & others)
Domoticz version: 2025.1
Location: Harlingen
Contact:

understanding devicechanged vs. otherdevices

Post by RonkA »

hello,
I have a problem understanding Devicechanged command,

Code: Select all

commandArray = {}
   if (otherdevices['Switch on display2004'] == 'On') then
   print('switch is on')
 end
return commandArray
This works ok, giving= LUA: switch is on

Code: Select all

commandArray = {}
   if (devicechanged['Switch on display2004'] == 'On') then
   print('switch is on')
 end
return commandArray
gives [string "commandArray = {}..."]:7: attempt to index a nil value (global 'devicechanged')

As far as i understand devicechanged can be a status or a value, a status is stated either 'On' or 'Off" and a value can be a number..
Please help :?:
Last edited by RonkA on Thursday 12 January 2023 20:37, edited 1 time in total.
SolarEdge ModbusTCP - Kaku - Synology NAS - Watermeter - ESPEasy - DS18b20
Work in progress = Life in general..
User avatar
jvdz
Posts: 2332
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: understanding

Post by jvdz »

That array is not there for time events... So ensure you set the event type to device when using the internal editor!
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
RonkA
Posts: 115
Joined: Tuesday 14 June 2022 12:57
Target OS: NAS (Synology & others)
Domoticz version: 2025.1
Location: Harlingen
Contact:

Re: understanding devicechanged vs. otherdevices

Post by RonkA »

Whoa Fast....

Lua is set on all, should i try device?
SolarEdge ModbusTCP - Kaku - Synology NAS - Watermeter - ESPEasy - DS18b20
Work in progress = Life in general..
User avatar
jvdz
Posts: 2332
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: understanding devicechanged vs. otherdevices

Post by jvdz »

Yeap... But i already said that. ;)
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest