Is it possible to get the name of the device that has changed?
I've one IF statement in which I check multiple door sensors. If one of them is triggered I want to print/use the name of which door sensor was triggered. Something like print ("Door sensor: " .. devicechanged[]) has been opened).
Any idea?
Get device name in LUA script of the device changed
Moderator: leecollings
-
- Posts: 347
- Joined: Friday 03 April 2015 17:09
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
-
- Posts: 1
- Joined: Monday 13 April 2015 22:15
- Target OS: Linux
- Domoticz version:
- Contact:
Re: Get device name in LUA script of the device changed
If devicechanged['name of device'] then print(....) end
Jarecki
Jarecki
-
- Posts: 347
- Joined: Friday 03 April 2015 17:09
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Get device name in LUA script of the device changed
I know that trick indeed. But that means I get 3 or more if statements. It would be nice and good if there is one print statement with the device name as a variable. That is more efficient coding wise. And I want to use this trick at other places as well.JareckiB12 wrote:If devicechanged['name of device'] then print(....) end
Jarecki
Who is online
Users browsing this forum: No registered users and 1 guest