I’m trying to integrate a Homematic IP garage door operator in IP-Symcon. I’ve added and configured the Homematic Configurator with succces. The Homematic IP garage door operator has been added in IP-symcon. However, I don’t see any commands to operate the garage door operator, I only see variables. The following commands are available in Homematic IP:
Hello DennisM,
you have to create some boolean variables and bind an action script on it.
For example:
Variable:
NOP - Command 0
Stopp - Command 2
Close - Command 3
Open - Command 1
Ventilation - Command 4
(values from the documentation from eQ-3)
Thanks. I couldn’t find the documentation. Do you know the difference between „NOP - Command 0“ and „Close - Command 3“?
The action script I use (with help from @ubittner)
<?php
//Documentation: https://www.symcon.de/en/service/documentation/concepts/scripts/action-scripts/
SetValue($_IPS['VARIABLE'], $_IPS['VALUE']);
$id = 12345; // This is the instance id of channel :1 of the homematic device
switch ($_IPS['VALUE']) {
case 0: # NOP
$action = 0;
break;
case 1: # Open
$action = 1;
break;
case 2: # Stop
$action = 2;
break;
case 3: # Close
$action = 3;
break;
case 4: # Ventilation
$action = 4;
break;
}
HM_WriteValueInteger($id,"DOOR_COMMAND", $action);
?>
I want to add a physical button (EnOcean PTM200) to open and close the garage door on change of the boolean variable.
boolean false = command open
boolean true = command close
I’m having a hard time creating an action script that triggers these simple commands. I hope someone can help me out. I tried the following action script, which obviously doesn’t work:
<?php
//Documentation: https://www.symcon.de/en/service/documentation/concepts/scripts/action-scripts/
SetValue($_IPS['VARIABLE'], $_IPS['VALUE']);
$id = 12345; // This is the instance id of channel :1 of the homematic device
switch ($_IPS['VALUE']) {
case ($_IPS['VALUE'] == false): # Open
$action = 1;
break;
case ($_IPS['VALUE'] == true): # Close
$action = 3;
break;
}
HM_WriteValueInteger($id, "DOOR_COMMAND", $action);
?>
So does the state of your EnOcean PTM200 changes in IP-Symcon by pressing the button?
If so, add an event that triggers the change of the variable value and the execute in this event a script code like this:
<?php
$id = 12345; // This is the instance id of channel :1 of the homematic device
if ($_IPS['VALUE']) {
$action = 1; # Open
} else {
$action = 3; # Close
}
HM_WriteValueInteger($id, "DOOR_COMMAND", $action);
Your code works. Could you explain why the script triggered by an event works, but the action script doesn’t? I’m probably missing something really fundamental.
(I swapped the open/close actions. I believe in Germany switches are positioned the other way round than in The Netherlands. In The Netherlands normally the „Top/Upside“ = I / ON / Up, "Bottom/Downside "= 0 / OFF / Down )