Switch on LED strip with KAKU switch Topic is solved

Moderator: leecollings

Post Reply
henk99
Posts: 28
Joined: Thursday 02 March 2017 11:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Switch on LED strip with KAKU switch

Post by henk99 »

I have a LED strip in my kitchen, which is controled by a Mi-Light (Ibox2). From the domoticz page i can switch this on/off normally. However, I had the idea to add a physical wall switch (KAKU AWST-8802) to switch the strip on/off, so I don't have to go into my phone everytime I want to switch.

I Installed the wall swith into domoticz as well and I can see it responding in the log when I press on/off. In the swtch menu I added the LED strip as a sub/slave. It was my view that this would switch the LED on when the switch was switched on. But it doesn't work. All the elements are working fine on their own, but I can't get them to work together.

Can anyone help me out? When I search for switching I see a lot of scripts and perhaps it is like cursing in here, but I know very little about programming. I thought that it would be very simple to control this action with a KAKU switch :roll:
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Switch on LED strip with KAKU switch

Post by waaren »

henk99 wrote: Thursday 10 December 2020 23:17 I have a LED strip in my kitchen, which is controled by a Mi-Light (Ibox2). From the domoticz page i can switch this on/off normally. However, I had the idea to add a physical wall switch (KAKU AWST-8802) to switch the strip on/off, so I don't have to go into my phone everytime I want to switch.

Can anyone help me out?
Probably the easiest way to do this is to define an on and off task for the "master" like below

On action: http://127.0.0.1:<domoticz port>/json.htm?type=command&param=switchlight&idx=<led id>&switchcmd=On
Off action: http://127.0.0.1:<domoticz port>/json.htm?type=command&param=switchlight&idx=<led id>&switchcmd=Off
master.png
master.png (81.72 KiB) Viewed 641 times
You will have to allow access to IP 127.0.0.1 or 127.0.0.* (local) without password for this to work
allow.png
allow.png (75.16 KiB) Viewed 640 times
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
henk99
Posts: 28
Joined: Thursday 02 March 2017 11:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Switch on LED strip with KAKU switch

Post by henk99 »

Thanks for your help waaren!

Some questions:
In the pictures where you have 127.0.0.1 written, do I have to change for the IP of my domoticz?
With 'master' you mean the actual switch right?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Switch on LED strip with KAKU switch

Post by waaren »

henk99 wrote: Friday 11 December 2020 1:06 In the pictures where you have 127.0.0.1 written, do I have to change for the IP of my domoticz?
You can but not likely needed.

"127.0. 0.1 is the loopback Internet protocol (IP) address also referred to as the localhost. The address is used to establish an IP connection to the same machine or computer being used by the end-user."

Also see this wiki for a full explanation.

btw. I use

Code: Select all

127.0.0.*;192.168.192.*;::1 

127.0.0.*           : to allow password less access when it originates from local host (on my system that can be 127.0.0.1 and 127.0.0.10) 
192.168.192.*       : to allow password less access when it originates from any device on my local area network
::1                 : same as 127.0.0.1 but from IPv6 type of access
With 'master' you mean the actual switch right?
Yes
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
henk99
Posts: 28
Joined: Thursday 02 March 2017 11:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Switch on LED strip with KAKU switch

Post by henk99 »

Ha! It works now. I filled in the localhost (127.0.0.1) in settings and also put in the rule you supplied earlier. Thank you, waaren!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest