@DavidZH That sounds really helpful, could you expand on that a bit further?
-
[solved]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
} -
@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!