Arilux / Magic Home LED Strip help Topic is solved

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
holybob
Posts: 6
Joined: Tuesday 19 December 2017 23:17
Target OS: Windows
Domoticz version:
Contact:

Arilux / Magic Home LED Strip help

Post by holybob »

Hi,
I'm a tinkerer with scripting (dzvents) but no pro compared to many on here. Most of my Domoticz setup is based around RFXCOM / HomeEasy typie kit. I'm sure what I'm trying to do here is simple and I'm just missing something obvious. I've never used Tasmota / ESPEasy etc - I don't think I need to in this scenario (it's a rabbit hole I'd prefer to not go down) but I will if necessary.

I purchased an AriLux LED Strip Wifi controller. I set it up using the Magic Home app and made a note of the IP
In Domoticz I added the new h/w type of 'Arilux AL-LC0x;
I clicked 'add light' and added the IP of my controller.
When I click 'setup' and 'devices' in Domoticz, I see the device and can click to turn it on and off - this works fine

I want to do more though. Ideally I want a dzvents script to control it but no matter what commands I use I get errors. If I take a perfectly working (super simple) script from one of my other devices, and try and make it control the LED controller I get a 'attempt to call a nil value' in the log.

For instance:

Code: Select all

return {
   on = { devices = { 441 }},
   execute = function(dz)
       dz.devices(29).SwitchOff()
      end
}
when i hit the (virtual) switch ID 441, my (homeeasy) light is ID 29 turns off.

Code: Select all

return {
   on = { devices = { 441 }},
   execute = function(dz)
       dz.devices(C0A80079).SwitchOff()
      end
}
Above, I've altered the scrip to control my LED strip. But no matter what command I try to use, I get errors. I've tried SwitchOff, LEDOff, setRGB all with the effect - it doesn't work and I see these errors in the log:

attempt to call a nil value (field 'switchOff')
attempt to call a nil value (field 'setRGB')
attempt to call a nil value (field 'LedOff')

Am I just using the wrong commands? If so what should I use? The fact I can turn it on and off in 'setup' -> 'devices' implies to me this MUST be simple....

HELP PLEASE!

Thanks,

Bob
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Arilux / Magic Home LED Strip help

Post by waaren »

holybob wrote: Thursday 17 September 2020 6:48 For instance:

Code: Select all

[code]return {
   on = { devices = { 441 }},
   execute = function(dz)
       dz.devices(C0A80079).SwitchOff()
      end
}
You forgot some quotes.

Code: Select all

return {
   on = { devices = { 441 }},
   execute = function(dz)
       dz.devices("device name").SwitchOff()
      end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
holybob
Posts: 6
Joined: Tuesday 19 December 2017 23:17
Target OS: Windows
Domoticz version:
Contact:

Re: Arilux / Magic Home LED Strip help

Post by holybob »

waaren wrote: Thursday 17 September 2020 9:08
You forgot some quotes.

Code: Select all

return {
   on = { devices = { 441 }},
   execute = function(dz)
       dz.devices("device name").SwitchOff()
      end
}
No, I didn't, but maybe this could help someone pinpoint the problem? (My script is called LED test BTW):

The LCD controller has IDX of 440, ID C0A80079, Name "LED1"

dz.devices(440).SwitchOff() gives the following 3 errors:

2020-09-16 10:52:16.461 Error: dzVents: Error: (3.0.2) There is no device with that name or id: 440
2020-09-16 10:52:16.461 Error: dzVents: Error: (3.0.2) An error occurred when calling event handler LED Test
2020-09-16 10:52:16.462 Error: dzVents: Error: (3.0.2) ...\Domoticz\scripts\dzVents\generated_scripts/LED Test.lua:6: attempt to index a nil value


dz.devices("LED1").SwitchOff() gives the following 3 errors:

2020-09-16 11:07:33.540 Error: dzVents: Error: (3.0.2) There is no device with that name or id: LED1
2020-09-16 11:07:33.540 Error: dzVents: Error: (3.0.2) An error occurred when calling event handler LED Test
2020-09-16 11:07:33.540 Error: dzVents: Error: (3.0.2) ...\Domoticz\scripts\dzVents\generated_scripts/LED Test.lua:6: attempt to index a nil value

dz.devices("C0A80079").SwitchOff() gives the following 3 errors:
2020-09-17 08:48:38.239 Error: dzVents: Error: (3.0.2) There is no device with that name or id: C0A80079
2020-09-17 08:48:38.239 Error: dzVents: Error: (3.0.2) An error occurred when calling event handler LED Test
2020-09-17 08:48:38.239 Error: dzVents: Error: (3.0.2) ...\Domoticz\scripts\dzVents\generated_scripts/LED Test.lua:6: attempt to index a nil value


dz.devices(C0A80079).SwitchOff() give the following *2* errors:
2020-09-17 08:49:50.044 Error: dzVents: Error: (3.0.2) An error occurred when calling event handler LED Test
2020-09-17 08:49:50.044 Error: dzVents: Error: (3.0.2) ...\Domoticz\scripts\dzVents\generated_scripts/LED Test.lua:6: attempt to call a nil value (field 'SwitchOff')

Any thoughts please?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Arilux / Magic Home LED Strip help

Post by waaren »

holybob wrote: Thursday 17 September 2020 9:51 Any thoughts please?
No quotes here ?
dz.devices(C0A80079).SwitchOff()

If you are sure device 440 exists, you might want to check if you set it to active on the devices tab. (blue arrow is active, green arrow is in active)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
holybob
Posts: 6
Joined: Tuesday 19 December 2017 23:17
Target OS: Windows
Domoticz version:
Contact:

Re: Arilux / Magic Home LED Strip help

Post by holybob »

No quotes here ?
I tried both with and without and posted the similar (but not identical) errors in my post above.
If you are sure device 440 exists, you might want to check if you set it to active on the devices tab. (blue arrow is active, green arrow is in active)
You mean the green arrow near the right hand side here? It seems to have all the same settings as my other kit:
dz.JPG
dz.JPG (16.27 KiB) Viewed 926 times
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Arilux / Magic Home LED Strip help

Post by EdwinK »

Click on it so it turns blue, should work then.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
holybob
Posts: 6
Joined: Tuesday 19 December 2017 23:17
Target OS: Windows
Domoticz version:
Contact:

Re: Arilux / Magic Home LED Strip help

Post by holybob »

EdwinK wrote: Thursday 17 September 2020 12:38 Click on it so it turns blue, should work then.
AWESOME!!!!!! Thanks - as you can guess, it's working now :D
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest