I have a problem with multiple Klik aan klik switches pimatic.
My problem is that I have rules in place to automatically switch on my lights in the living room but I also have a Klik aan klik uit switch for my wife to turn on the lights manually if she needs more light outside the automatic schedule.
If she turns on the switch this turns on the lights using a rule the state of the switch is on. Then hours later my automatic rule switches the light off. (remember: pimatic still has the switch in the ‘on’ state.
If she wants to turn the lights on manually the next day or so she needs to first turn off the switch so pimatic marks it as ‘off’ followed by a switch on and then finally pimatic turns on the lights because now it processes my rule.
By using debug mode in the homeduino plugin I found that the switch itself sends out the signal but it is pimatic not processing it because the state is not changed.
Is this something I am doing wrong / is there a solution for this?
-
[solved]State of klik aan klik uit switches
-
@Patrick-Langendoen said in State of klik aan klik uit switches:
I have a problem with multiple Klik aan klik switches pimatic.
My problem is that I have rules in place to automatically switch on my lights in the living room but I also have a Klik aan klik uit switch for my wife to turn on the lights manually if she needs more light outside the automatic schedule.
If she turns on the switch this turns on the lights using a rule the state of the switch is on. Then hours later my automatic rule switches the light off. (remember: pimatic still has the switch in the ‘on’ state.
If she wants to turn the lights on manually the next day or so she needs to first turn off the switch so pimatic marks it as ‘off’ followed by a switch on and then finally pimatic turns on the lights because now it processes my rule.
By using debug mode in the homeduino plugin I found that the switch itself sends out the signal but it is pimatic not processing it because the state is not changed.
Is this something I am doing wrong / is there a solution for this?Which KaKu do you have cause i didnt know they also send their off state?
I also have several KaKu devices but they dont send their off state
Non the less, if your rule to turn it off is running i assume you have something like “WHEN its 02:00 THEN turn KaKu off” then it should just go to off.
Please post your device type and rules you use for it.
Another option would be to read out the state of the device:
“WHEN state of YourKaKu is off THEN turn YourKaKu off” but i think you currently have that. -
Presuming your wifes switch is also a device in pimatic.
The problem is the state of this device when your rules switched off the lights? Why don’t you add switching this device off to your rule? -
Can you post your rule?
When you switch off a KaKu device from pimatic, pimatic should change the state to off.I think your problem is that you have a KaKu mini-wall-switch connected to your physical wall-switch. When you flip the switch the KaKu device sends a ON command, flip again and it sends OFF.
The position of the switch (connected to the KaKu switch) is ‘hard’. It will allways send the ON command on the same position. It does not send a “toggle the device” command.
The only option you have - other than training your wife- is as follow:
KaKu lamp : ID 1
KaKu switch : ID 2Do not learn switch (ID 2) on the lamp (ID 1).
Let Pimatic receive all the ID 2 commands, but create rules to TOGGLE ID 1 on receiving ON and OFF:
ID2 receives off or when ID2 receives on THEN toggle ID1
When you do a TOGGLE in pimatic, it simply changes from ON to OFF or from OFF to ON (depending on current state).
This trick should work, but with a delay (first receiving in pimatic and after that sending from pimatic to the lamp).Like my projects and help? Consider donating electroneum etnjwAKGPqF6omQWRmpp9u2BPyVDG9VuyRQjNJ1S8yfBdfR9qeUQ46kRy8KS2CNqbpNLRrsgmNW6F2TMzxmZgPrh6KctrkrYbm
-
I can make that even easier: use
when ID-KaKu-switch.state changes
in your rule.And just like that you can also use
increases
for positive edges anddecreases
for negative edges on the switch.
This works on all types of switches asreceives
is a Homeduino only attribute. -
@DavidZH That sounds really helpful, could you expand on that a bit further?
-
I think this config extract should clarify my setup. And I am not sending any signal directly to the Kaku power outlets.
Also, I incorrectly stated it is a KaKu switch, but it is a Smartwares switch from Hornbach. So I have the Smartwares switch and a few KaKu inline power outlets to which my lights are connected.device:
{
“protocols”: [
{
“name”: “switch1”,
“options”: {
“id”: 1234567,
“unit”: 2
}
}
],
“id”: “wk-knop”,
“name”: “wk knop”,
“class”: “HomeduinoRFContactSensor”
}rules:
First the time-based rules:
{
“id”: “wk-licht-aan”,
“name”: “wk licht aan”,
“rule”: “when its 30 minutes before sunset starts then switch Verlichting on”,
“active”: true,
“logging”: true
},
{
“id”: “wk-licht-uit”,
“name”: “wk licht uit”,
“rule”: “when its after 21:57 then switch Verlichting off”,
“active”: true,
“logging”: true
},
and this is for the manual override button:
{
“id”: “wk-knop-aan”,
“name”: “wk-knop aan”,
“rule”: “when wk-knop is opened then after 0.5 second switch Verlichting on”,
“active”: true,
“logging”: true
},
{
“id”: “wk-knop-uit”,
“name”: “wk-knop uit”,
“rule”: “when wk-knop is closed then after 0.5 second switch Verlichting off”,
“active”: true,
“logging”: true
} -
@Patrick-Langendoen said in State of klik aan klik uit switches:
I think this config extract should clarify my setup. And I am not sending any signal directly to the Kaku power outlets.
Also, I incorrectly stated it is a KaKu switch, but it is a Smartwares switch from Hornbach. So I have the Smartwares switch and a few KaKu inline power outlets to which my lights are connected.device:
{
“protocols”: [
{
“name”: “switch1”,
“options”: {
“id”: 1234567,
“unit”: 2
}
}
],
“id”: “wk-knop”,
“name”: “wk knop”,
“class”: “HomeduinoRFContactSensor”
}rules:
First the time-based rules:
{
“id”: “wk-licht-aan”,
“name”: “wk licht aan”,
“rule”: “when its 30 minutes before sunset starts then switch Verlichting on”,
“active”: true,
“logging”: true
},
{
“id”: “wk-licht-uit”,
“name”: “wk licht uit”,
“rule”: “when its after 21:57 then switch Verlichting off”,
“active”: true,
“logging”: true
},
and this is for the manual override button:
{
“id”: “wk-knop-aan”,
“name”: “wk-knop aan”,
“rule”: “when wk-knop is opened then after 0.5 second switch Verlichting on”,
“active”: true,
“logging”: true
},
{
“id”: “wk-knop-uit”,
“name”: “wk-knop uit”,
“rule”: “when wk-knop is closed then after 0.5 second switch Verlichting off”,
“active”: true,
“logging”: true
}I would think the following.
If your lights are on, the contact is on true(open-present), if you cut the power by hand, it has no power to send the off-state, if it even does that. However, you are using a contact sensor, how about enabling the reset function?If it has power, it should stay PRESENT after a reset. If it doesnt have power, it should go to ABSENT.
Try enabling autoReset in your wk-knop with value 3600
-
What if you change the rule
“rule”: “when its 30 minutes before sunset starts then switch Verlichting on”,
to
“rule”: “when its 30 minutes before sunset starts then switch Verlichting on and switch wk-knop on”,
and the same for the other rules?
-
@rikki78
Tried that. But then I get :
Oops…
Could not find an provider that provides the next action of “switch wk-knop on”. -
@Gleno0h
I tried the autoreset button but when using the autoreset function it’ll switch back to the previous state after the specified time. I’ve had it set to 10 seconds autoreset, and then the lights went off after 10 seconds when pressing ‘on’ or when pressing ‘off’ the lights went on again after 10 seconds -
@Patrick-Langendoen said in State of klik aan klik uit switches:
@Gleno0h
I tried the autoreset button but when using the autoreset function it’ll switch back to the previous state after the specified time. I’ve had it set to 10 seconds autoreset, and then the lights went off after 10 seconds when pressing ‘on’ or when pressing ‘off’ the lights went on again after 10 secondsYeah i tought so after i wrote it hehe sorry.
Could you try this:
Create a variable called $handbediening with value 0 or 1, doesnt matterAdjust the rule for manual off:
when wk-knop is closed then after 0.5 second switch Verlichting off and set $handbediening to 0
Then, add “and set $handbediening to 1” to your manual on switch rule.
Does the variable update itself when you switch the wall contact?
So off is 0, on is 1? If not, your contact simply does not send a “off state”If it does, you can create a new rule as following:
WHEN $handbediening = "1" THEN turn Verlichting on
And for off
WHEN $handbediening = "0" THEN turn Verlichting off
So, short summary:
Manual on -> turn lights on -> set variable to 1 -> set Verlichting to on
Manual off -> turn lights off -> set variable to 0 -> set Verlichting to off
But yeah, if it doesnt send an off state whe should think of a work around. Which is hard if there are random actions by people
If you cut the power then ofcourse it would stay on as it doesnt reset it self.
Too bad we cant change the state of an HomeduinoRFContact. Otherwise we could use WHEN 22:00 THEN set wk-knop to closed.
You could also try a DummyContactSensor i think.
On:
WHEN timeaction? THEN turn verlichting on and open DummyContactSensorOff:
WHEN its 22:00 THEN turn verlichting off and close DummyContactSensorManual on:
WHEN wk-knop is opened THEN open DummyContactSensorSo, when it is 22:00, it closes the dummy.
-
@Patrick-Langendoen said in State of klik aan klik uit switches:
@rikki78
Tried that. But then I get :
Oops…
Could not find an provider that provides the next action of “switch wk-knop on”.And if you change the wk-knop to HomeduinoRFSwitch? These must be able to be switched.
-
@rikki78 I just tried that. Then the lights get switched off immediately because my ‘when switch switches to off then switch light off’-rule.
-
I solved it.
I first changed my device to HomeduinoRFSwitch as @rikki78 said, because I’d figured it was more appropriate since I am using a switch, not a contact sensor. I’m not sure why I configured the switch as a contactsensor in the beginning.
Now my switch is switchable through a rule so I changed the time based schedule to switch off the switch instead of the lights directly and tadaaa.So whenever it is time to switch off the lights it toggles the state off the switch to off (instead off directly the light). The initial ‘manual’ rule now sends a signal to the light to switch off. So, that way both the light and the switch are back to off.
Thanks for the help, guys!