Page 4 of 4

Re: Ikea "TRÅDFRI" Gateway and smart lights series for ZigBee Light Link (ZLL) lighting

Posted: Saturday 23 September 2017 7:45
by dobber
mcduarte2000 wrote: Sunday 30 July 2017 19:59 Just as an info, in case useful for someone else, I have been using with success this python script:

https://github.com/sandyjmacdonald/ikea-smartlight

Using this tutorial:

https://learn.pimoroni.com/tutorial/san ... om-your-pi

I have four lights in my corridor and created a simple bash script:

Code: Select all

#!/bin/bash
cd /home/pi/domoticz/scripts/python/ikea-smartlight/
python tradfri-groups.py -a power -g 174716 -v $1
python tradfri-groups.py -a brightness -g 174716 -v $2
python tradfri-lights.py -a color -l 65537 -v $3
python tradfri-lights.py -a color -l 65538 -v $3
python tradfri-lights.py -a color -l 65539 -v $3
python tradfri-lights.py -a color -l 65540 -v $3
Which I am calling using a virtual switch (and with some simple timers depending on the hour of the day):

Image

Image
Great guide!
I'm using it in a pi2 that is controlled by json from a Synology DS916+ Docker Domoticz installation.
Good enough until Ikea releases an API that can be integrated into Domoticz.

Re: Ikea "TRÅDFRI" Gateway and smart lights series for ZigBee Light Link (ZLL) lighting

Posted: Tuesday 10 October 2017 5:41
by iamthemitch
Awesome :D

Just figure out that virtual Dimmer were available.

Working like a charm.

But I still have a little " issue " with my setup... I still use the Ikea remote, and of course, such changes are not reported to Domoticz.

Did someone already created a timer script to refresh data from the gateway ?

Re: Ikea "TRÅDFRI" Gateway and smart lights series for ZigBee Light Link (ZLL) lighting

Posted: Saturday 02 December 2017 11:50
by jackisidore
edit: wrong thread...

Re: Ikea "TRÅDFRI" Gateway and smart lights series for ZigBee Light Link (ZLL) lighting

Posted: Saturday 02 December 2017 13:49
by MatsL
Hi!

I created a Lua script for triggering the bash script that mcduarte posted
And this is using a virtual dimmer switch instead of the selector switch, as iamthemitch suggested

This way you get way more control over the dimming of the bulb and I guess it will be easier to trigger the light from other lua scripts
Unfortunatly you lose the ability to change the color temp of the bulb
But I guess you could have a separate selector switch also if needed
A combined selector/dimmer switch, does that exist? :)

The lua could propably be cleaned up, but at least its working...

Code: Select all

-- TestDimmer = Virtual Switch, set as switch type Dimmer

Dimmer = tonumber(otherdevices_svalues['TestDimmer'])

commandArray = {}

if
 devicechanged['TestDimmer'] then
    Dimmer = tonumber(otherdevices_svalues['TestDimmer'])
    print(Dimmer)
    
    if
        otherdevices['TestDimmer'] == 'Off' then
        Dimmer = 0
        os.execute('"/home/pi/domoticz/scripts/bash/65566.sh" off')
    end 
    
    if
        otherdevices['TestDimmer'] == 'On' then
        os.execute('"/home/pi/domoticz/scripts/bash/65566.sh" on')
    end 
    
    if (Dimmer >= 1 and Dimmer <= 100) then
        os.execute('"/home/pi/domoticz/scripts/bash/65566.sh" on '..Dimmer..' warm')
    end
    
    if (Dimmer == 0) then
        os.execute('"/home/pi/domoticz/scripts/bash/65566.sh" off')
    end

end

return commandArray