Page 1 of 1

Arilux / Magic Home LED Strip (timer does not work).

Posted: Tuesday 06 October 2020 18:52
by Hanss
Dear Domoticz users,

I have a short question...
I use the Magic Home Led controller. When I manually switch on/off the lights (i.e. devices panel) everything works fine :-)
But when I use the timer option, nothing happens.
Can someone tell me what I am doing wrong (please see the enclosed files)?

Device: Synology DS214 play

- Version: 2020.2 (build 12394)
- Build Hash: d837b5c4e-modified
- Compile Date: 2020-09-23 22:32:29
- dzVents Version: 3.0.13
- Python Version: None

Arilux / Magic Home LED Strip help

Re: Arilux / Magic Home LED Strip (timer does not work).

Posted: Monday 23 November 2020 19:41
by Ernstp
Same problem here

Do you already have a solution or a work around?

Re: Arilux / Magic Home LED Strip (timer does not work).

Posted: Wednesday 16 December 2020 22:39
by mojso
I solve my problem.
i put the flux_led.py script in ON Action, and now it works timers option and On command from slider
Put script flux_led.py in domoticz/scripts folder

In On action

Code: Select all

script://flux_led.py 192.168.1.115 -1   



if it still does not work run this command in terminal
pip install flux_led

Re: Arilux / Magic Home LED Strip (timer does not work).

Posted: Thursday 17 December 2020 15:17
by Ernstp
I solved it in DZVents

This works for turning it on. :D

Code: Select all

return {
	on = {
		timer = {
		
			'10 minutes after sunset',
			}
	},
	execute = function(domoticz, timer)
		domoticz.log('Timer event was triggered by ' .. timer.trigger, domoticz.LOG_INFO)
		domoticz.devices('wifiledstrip2').switchOn()
		domoticz.devices('Kast').switchOn()
	end
}

Re: Arilux / Magic Home LED Strip (timer does not work).

Posted: Thursday 29 April 2021 20:23
by mschaar
Hi,
I added the arilux hardware and light, but needed a dummy switch to be able to have a switch in the app I could use to dim, setcolor etc.. Not sure if that is only an issue in my setup?
I now use the dummy switch with dzvents to relay the commands sent to the dumm onto the arilux light. Now for me on, off, dimming (set level) and setcolor works.
So basically the commands are sent to dummy device idx 32 (LED muurcirkel) and I relay them to idx 33.
Only thing I could not solve was the fact that I cannot find the arilux device light, the one with idx 33. Not by name or idx. However, targeting that idx with the api commands works fine. Maybe because the device shows up in the unused section of devices?
Another thing is that when the script starts running, the device.color is the color from the previous command. I did not find a very pretty solution, but by fetching via http response I could make it work .


Code: Select all

return
{
    on =
    {
        devices =
        {
            'LED muurcirkel', -- idx or 'name' of  your RGBW device
        },
        httpResponses = {
            'httpLightInfo'
        },
    },

    logging =
    {
        level = domoticz.LOG_DEBUG,
        marker = 'sendColor',
    },

    execute = function(domoticz, item)

        if (item.isDevice) then
           if item.sValue == 'On' then
                domoticz.openURL({
                url = "https://url_to_my_pi/json.htm?type=command&param=switchlight&idx=33&switchcmd=On",
                method = "GET"})

           elseif item.sValue == 'Off' then
                domoticz.openURL({
                url = "https://url_to_my_pi/json.htm?type=command&param=switchlight&idx=33&switchcmd=Off",
                method = "GET"})
          
           elseif string.find(item.sValue,"Set Level") then
                domoticz.openURL({
                url = "https://url_to_my_pi/json.htm?type=command&param=switchlight&idx=33&switchcmd=Set%20Level&level=" .. item.levelVal .. "",
                method = "GET"})

           else
                domoticz.openURL({
                url = "https://url_to_my_pi/json.htm?type=devices&rid=32",
                method = "GET",
                callback = 'httpLightInfo'})
           end
        end

         if (item.isJSON) then
               json = domoticz.utils.fromJSON(item.data)
               color_string = json.result[1].Color

               domoticz.openURL({
               url = "https://url_to_my_pi/json.htm?type=command&param=setcolbrightnessvalue&idx=33&color=" .. color_string .. "",
               method =  "GET"})

          end


    end
}
Maybe this is useful for you as well.


Maureen