Hello,
I’m new in home automation and have some “stupid” questions relating to Homematic.
First my current setup to describe my intention.
default.items:
Group All
Group gGF (All)
Group Shutters (All)
Group GF_Workroom “Arbeitszimmer” (gGF)
/* Shutters */
Switch Actuator_01_Input_01 “Rolladen Auf” (GF_Workroom, Shutters) {homematic=“address=MEQ0279318, channel=1, parameter=PRESS_SHORT”}
Switch Actuator_01_Input_02 “Rolladen Ab” (GF_Workroom, Shutters) {homematic=“address=MEQ0279318, channel=2, parameter=PRESS_SHORT”}
Switch Actuator_01_Output_13 “Rolladenaktor Auf” (GF_Utility, Shutters) {homematic=“address=MEQ0279318, channel=13, parameter=STATE”}
Switch Actuator_01_Output_14 “Rolladenaktor Ab” (GF_Utility, Shutters) {homematic=“address=MEQ0279318, channel=14, parameter=STATE”}
Rollershutter Shutter_GF_Workroom “Rolladen Arbeitszimmer” (GF_Workroom, Shutters)
default.sitemap:
sitemap demo label=“Haus”
{
Frame {
Group item=gGF label=“Erdgeschoss” icon=“groundfloor”
}
}
The following default.rules rudimentary does what I need:
rule “Rollershutter”
when
Item Shutter_GF_Workroom received command
then
switch(receivedCommand) {
case UP: {
sendCommand(Actuator_01_Output_13, ON)
createTimer(now.plusSeconds(18)) [|
sendCommand(Actuator_01_Output_13, OFF)
]
}
case DOWN: {
sendCommand(Actuator_01_Output_14, ON)
createTimer(now.plusSeconds(18)) [|
sendCommand(Actuator_01_Output_14, OFF)
]
}
}
end
However, all logical shortcuts between Switch Actuator_01_Input_01 and Actuator_01_Output_13, their timing (18 seconds on time) and interlocking is already configured by Homematic channel peering. The better solution would be to “trigger” or “simulate” an PUSH_SHORT event on the Actuator_01_Input_XX items.
I.e. like this:
rule “Rollershutter”
when
Item Shutter_GF_Workroom received command
then
switch(receivedCommand) {
case UP: {
sendCommand(Actuator_01_Input_01, ON)
createTimer(now.plusMillis(300)) [|
sendCommand(Actuator_01_Input_01, OFF)
]
}
case DOWN: {
sendCommand(Actuator_01_Input_02, ON)
createTimer(now.plusMillis(300)) [|
sendCommand(Actuator_01_Input_02, OFF)
]
}
}
end
But this code dosn’t work. How should it look like in order to work?