APPLamp control tool (for V3)

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

User avatar
elythomaslumber
Posts: 56
Joined: Friday 12 July 2013 13:29
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Solingen; Germany
Contact:

APPLamp control tool (for V3)

Post by elythomaslumber »

Found a really nice SW tool on this WebPage: http://iqjar.com/jar/home-automation-us ... ver-wi-fi/
It allows to control APPLamp (WiFi Lamp) with only one command and simple parameters.

Here's the download link: http://iqjar.com/download/jar/milight/m ... naries.zip

Just make a download, unzip it and place it e.g. /home/pi/domoticz/scripts
Make it executable and change the IP adress in the config file to that of your wifi-bridge.
Than from CLI (Putty) start it with ./milight and you'll see all possible parameters.
It's very fast in a bash script.

It inspired me for that simple script calling a very slow brightness and coloure change instead of the build in DISCO-mode which is a little bit too fast for me.

By the way, check the other web-pages of this guy; made very well!

Regards

Hardy


Code: Select all

#!/bin/bash

# prepare show for dimming white

./milight 1 B 1					# dimm to minimum
./milight 1 ON					# switch ON
./milight 1 w					# switch to white
./milight 1 B 1					# dimm to minimum

for i in {0..19}					# change brightness from 0 to 8
do

./milight 1 B $i

		for x in $(seq 200); do	# do it slow
		echo $i $x				# show value and slow down
		done

done
#---------------------------------------------------------------------------------------
# show smooth coloure change

./milight 1 B 1 					# dimm to minimum
./milight 1 C 0					# change coloure to 0 value (dark blue)
./milight 1 B 19					# set brightness to maximum

for i in {0..255}					# do a loop for all values
do

./milight 1 C $i					# change coloure through all values

	for x in $(seq 300); do		# do it slowly
	echo $i $x					# show value and slow down
	done

done
./milight 1 B 1 					# change to brightness minimum
./milight 1 OFF					# switch OFF
Last edited by elythomaslumber on Monday 27 January 2014 17:25, edited 1 time in total.
alfred_j_kwak
Posts: 110
Joined: Friday 20 September 2013 18:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Location: Finland
Contact:

Re: APPLamp control tool (for V3)

Post by alfred_j_kwak »

Nice. Maybe I now can implement my 'rising sun' alarm clock...

-Jussi-
User avatar
elythomaslumber
Posts: 56
Joined: Friday 12 July 2013 13:29
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Solingen; Germany
Contact:

Re: APPLamp control tool (for V3)

Post by elythomaslumber »

I'm working on a weather "forecast lamp" with rough indication of temperature, rain and wind in the next 6 hours...

A little bit crazy I know... :mrgreen:

Regards

Hardy
safi78
Posts: 204
Joined: Thursday 05 September 2013 15:39
Target OS: Linux
Domoticz version: LastBeta
Contact:

Re: APPLamp control tool (for V3)

Post by safi78 »

elythomaslumber wrote:A little bit crazy I know... Hardy
Wow, just what I was looking for.

While the support for this is still in development this is awesome ...

thanks a bundle!
homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
User avatar
howcome
Posts: 2
Joined: Sunday 26 January 2014 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: APPLamp control tool (for V3)

Post by howcome »

I am using this to control the inside- and outside lighting based on the sunset time. Backgarden light turns off earlier than the frontporge light. Internal lighting is based on sunset, added with a random time within half an hour. Works great.
alfred_j_kwak
Posts: 110
Joined: Friday 20 September 2013 18:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Location: Finland
Contact:

Re: APPLamp control tool (for V3)

Post by alfred_j_kwak »

Hmm. The binary file is for Raspberry? It doesn't run in my Mint server.

-Jussi-

And yes. I have to compile it from source. Now it works.
alfred_j_kwak
Posts: 110
Joined: Friday 20 September 2013 18:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Location: Finland
Contact:

Re: APPLamp control tool (for V3)

Post by alfred_j_kwak »

I need to code something like this to get it run:

Code: Select all

#!/bin/sh


for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
do
	./milight b $i
	sleep 2
done

That {1..19} don't work in my bash. Also it's not ok to use ./milight b 0 - values start from 1.

-Jussi.
User avatar
howcome
Posts: 2
Joined: Sunday 26 January 2014 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: APPLamp control tool (for V3)

Post by howcome »

I would try it using tcl:

for {set X 1} {$X < 20} {incr X} {
exec ./milight B $X
after 2000
}

I used a similar script for a 'scanner' app to determine the code for the new selflearning 'klik-aan-klik-uit' devices, but the device did not recognize the codes.
User avatar
elythomaslumber
Posts: 56
Joined: Friday 12 July 2013 13:29
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Solingen; Germany
Contact:

Re: APPLamp control tool (for V3)

Post by elythomaslumber »

alfred_j_kwak wrote:I need to code something like this to get it run:

Code: Select all

#!/bin/sh


for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
do
	./milight b $i
	sleep 2
done

That {1..19} don't work in my bash. Also it's not ok to use ./milight b 0 - values start from 1.

-Jussi.
Don't know if it helps. Sometimes there is really a difference in behaviour of using #!/bin/sh oder #!/bin/bash .
Did you make your "milight" executable?

Setting brightness from 0 works for me for "white" but values between 8 and 19 do not show any change.
I'm using the 9W RGBW bulbs.

Hope you will get it running.

Hardy

EDIT: There is aslo a change between 8 and 19... was to late yesterday evening 8-)
Last edited by elythomaslumber on Monday 27 January 2014 17:09, edited 1 time in total.
alfred_j_kwak
Posts: 110
Joined: Friday 20 September 2013 18:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Location: Finland
Contact:

Re: APPLamp control tool (for V3)

Post by alfred_j_kwak »

Yes I get it going.

I just realize that if I make an silent alarm with name in my Samsung phone alarm clock it gives notify.
Tasker can see this notify and run task. So now I can have easily adjustable timer based triggers for my Domoticz.
Domoticz can then run the script to control AppLamp.

-Jussi-
User avatar
gizmocuz
Posts: 2352
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: APPLamp control tool (for V3)

Post by gizmocuz »

Okey, maybe someone can summarize what is working and not working by using the standard applamp hardware in domoticz?
I am able to control my RGBW leds perfectly
Quality outlives Quantity!
safi78
Posts: 204
Joined: Thursday 05 September 2013 15:39
Target OS: Linux
Domoticz version: LastBeta
Contact:

Re: APPLamp control tool (for V3)

Post by safi78 »

gizmocuz wrote:Okey, maybe someone can summarize what is working and not working by using the standard applamp hardware in domoticz?
I am able to control my RGBW leds perfectly
Same here, but the command line tool is very nice for scripting ;)

I made a wake up light with it for instance.

Anyway, what I think is annoying is that when you click the button for a zone it doesn't do the default colour setting behind it, like it does with scenes. But I can imagine other peepz would like the current setting (last used setting).

And earlier I thought it was buggy / still under development because I had made a mistake in the configuration, so I was wrong.

Scenes work perfectly by the way :)

Very nice work!
homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
nood
Posts: 22
Joined: Sunday 26 July 2015 13:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: APPLamp control tool (for V3)

Post by nood »

Sorry to dig out this old post, but I have a (noob) question.

I made a script (based on TS's code) wich goes thru all the colors very slow. The script takes 30mins or so.
Now I would like to know how to stop this script before it ends and go to white, maximum brightness.
I use a COCO switch to trigger the script.

Thx
benotje
Posts: 30
Joined: Saturday 27 December 2014 15:50
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.20078
Location: Menterwolde,The Netherlands
Contact:

Re: APPLamp control tool (for V3)

Post by benotje »

i have copy de scripts for test

Code: Select all

#!/bin/bash

# prepare show for dimming white

./milight 1 b 1               # dimm to minimum
./milight 1 ON               # switch ON
./milight 1 w               # switch to white
./milight 1 b 1               # dimm to minimum

for i in {0..19}               # change brightness from 0 to 8
do

./milight 1 b $i

      for x in $(seq 200); do   # do it slow
      echo $i $x            # show value and slow down
      done

done
#---------------------------------------------------------------------------------------
# show smooth coloure change

./milight 1 b 1                # dimm to minimum
./milight 1 c 0               # change coloure to 0 value (dark blue)
./milight 1 b 19               # set brightness to maximum

for i in {0..255}               # do a loop for all values
do

./milight 1 c $i               # change coloure through all values

   for x in $(seq 300); do      # do it slowly
   echo $i $x               # show value and slow down
   done

done
./milight 1 b 1                # change to brightness minimum
./milight 1 OFF               # switch OFF
i call it "naar_bed_test2.sh"
when i do ssh. connect from putty "pi@domoticzpi ~/domoticz/scripts $ bash naar_bed_test2.sh" it worked

but when i do
Knipsel.JPG
Knipsel.JPG (37.59 KiB) Viewed 5583 times
it dont work hou can i make it work ???
raspberry pi
nas synology
homey
safi78
Posts: 204
Joined: Thursday 05 September 2013 15:39
Target OS: Linux
Domoticz version: LastBeta
Contact:

Re: APPLamp control tool (for V3)

Post by safi78 »

maybe change

Code: Select all

///

to

Code: Select all

//

where it says

Code: Select all

script:///

;) ?
homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
benotje
Posts: 30
Joined: Saturday 27 December 2014 15:50
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.20078
Location: Menterwolde,The Netherlands
Contact:

Re: APPLamp control tool (for V3)

Post by benotje »

no also i do script:// or script:/// not working
raspberry pi
nas synology
homey
safi78
Posts: 204
Joined: Thursday 05 September 2013 15:39
Target OS: Linux
Domoticz version: LastBeta
Contact:

Re: APPLamp control tool (for V3)

Post by safi78 »

Put your milight executable in a place your script can find ;)

I think I put mine in /usr/local/bin or /usr/bin (don't remember)

Your script calls './milight' (needs to be in the current dir) but I don't think that's the right dir if you try to run the script from where you try it.
homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
safi78
Posts: 204
Joined: Thursday 05 September 2013 15:39
Target OS: Linux
Domoticz version: LastBeta
Contact:

Re: APPLamp control tool (for V3)

Post by safi78 »

Then, your next problem will be where the milight executable expects the milight.conf ...

I don't like linking outside of the community, but this is what you need: https://www.safiweb.nl/?p=954
homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
Heisenberg
Posts: 135
Joined: Monday 27 January 2014 14:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: APPLamp control tool (for V3)

Post by Heisenberg »

Only for v3? how do I find out which version MyLight controller box I have?
Raspberry Pi Type B
Raspberry Pi Type B2
RFXCOMtrx433e
safi78
Posts: 204
Joined: Thursday 05 September 2013 15:39
Target OS: Linux
Domoticz version: LastBeta
Contact:

Re: APPLamp control tool (for V3)

Post by safi78 »

Heisenberg wrote:Only for v3? how do I find out which version MyLight controller box I have?
like so:

http://bfy.tw/52me
homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest