Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[openwebnet] Add support for sending Auxiliary (AUX) commands/messages to the bus (WHO=9) #12468

Merged
merged 19 commits into from
May 8, 2022
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
c932d3d
[openwebnet] Add BusAux thing and channel (#11515)
fabgio Mar 8, 2022
df31c6e
[openwebnet] Update Java constants to support aux (#11515)
fabgio Mar 8, 2022
c367b64
[openwebnet] OpenWebNetAuxiliaryHandler implementation(#11515)
fabgio Mar 8, 2022
9e31abb
[openwebnet] Allows Auxiliary Handler creation(#11515)
fabgio Mar 8, 2022
81dfde9
[openwebnet] Add unit tests for aux (#11515)
fabgio Mar 8, 2022
337fd68
[openwebnet] Update README for aux(#11515)
fabgio Mar 8, 2022
46b38c9
[openwebnet] Update pom to allow .kar artifact generation(#11515)
fabgio Mar 8, 2022
b595e58
[openwebnet] Minor updates (#11515)
fabgio Mar 8, 2022
d7fda02
squash! [openwebnet] Minor updates (#11515)
fabgio Mar 10, 2022
8f6420e
[openwebnet] Various fixes as per review (#11515)
fabgio Mar 20, 2022
b3d06cd
[openwebnet] Add break statement in newDiscoveryResult() (#11515)
fabgio Mar 31, 2022
427adce
[openwebnet] Aux thing stopped working. Override initialize() to …
fabgio Apr 6, 2022
5f51a93
[openwebnet] Aux thing stopped working. Override initialize() to …
fabgio Apr 6, 2022
8a4b022
[openwebnet] OpenWebNetAuxiliaryHandler final adjustments' for Open…
fabgio Apr 11, 2022
2b8197a
[openwebnet] Fixes after first community testing (#11515)
fabgio Apr 22, 2022
d0194ef
[openwebnet] Fixes after final review (#11515)
fabgio Apr 24, 2022
306c6ff
[openwebnet] Fixes after second final review (#11515)
fabgio Apr 28, 2022
0347851
[openwebnet] Fixes after third final review (#11515)
fabgio May 8, 2022
46204e0
[openwebnet] Fixes after fourth final review (#11515)
fabgio May 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 45 additions & 18 deletions bundles/org.openhab.binding.openwebnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@ The following Things and OpenWebNet `WHOs` are supported:

### For BUS/SCS

| Category | WHO | Thing Type IDs | Description | Status |
| ----------------------------- | :----------: | :--------------------------------------------------------: | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Gateway Management | `13` | `bus_gateway` | Any IP gateway supporting OpenWebNet protocol should work | Successfully tested: F452, F453, F453AV,F454, F455, MyHOMEServer1, MyHOME_Screen10, MyHOME_Screen3,5, MH201, MH202, MH200N. Some connection stability issues/gateway resets reported with MH202  |
| Lighting | `1` | `bus_on_off_switch`, `bus_dimmer` | BUS switches and dimmers | Successfully tested: F411/2, F411/4, F411U2, F422, F429. Some discovery issues reported with F429 (DALI Dimmers) |
| Automation | `2` | `bus_automation` | BUS roller shutters, with position feedback and auto-calibration | Successfully tested: LN4672M2 |
| Temperature Control | `4` | `bus_thermo_zone`, `bus_thermo_sensor`, `bus_thermo_cu` | Thermo zones management and temperature sensors (probes). | Successfully tested: H/LN4691, HS4692, KG4691; thermo sensors: L/N/NT4577 + 3455; Central Units (4 or 99 zones) are not fully supported yet. See [Channels - Thermo](#configuring-thermo) for more details |
| CEN & CEN+ Scenarios | `15` & `25` | `bus_cen_scenario_control`, `bus_cenplus_scenario_control` | CEN/CEN+ scenarios events and virtual activation | Successfully tested: scenario buttons: HC/HD/HS/L/N/NT4680 |
| Dry Contact and IR Interfaces | `25` | `bus_dry_contact_ir` | Dry Contacts and IR Interfaces | Successfully tested: contact interfaces F428 and 3477; IR sensors: HC/HD/HS/L/N/NT4610 |
| Energy Management | `18` | `bus_energy_meter` | Energy Management | Successfully tested: F520, F521 |
| Category | WHO | Thing Type IDs | Description | Status |
|-------------------------------|:-----------:|:----------------------------------------------------------:|------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Gateway Management | `13` | `bus_gateway` | Any IP gateway supporting OpenWebNet protocol should work | Successfully tested: F452, F453, F453AV,F454, F455, MyHOMEServer1, MyHOME_Screen10, MyHOME_Screen3,5, MH201, MH202, MH200N. Some connection stability issues/gateway resets reported with MH202  |
| Lighting | `1` | `bus_on_off_switch`, `bus_dimmer` | BUS switches and dimmers | Successfully tested: F411/2, F411/4, F411U2, F422, F429. Some discovery issues reported with F429 (DALI Dimmers) |
| Automation | `2` | `bus_automation` | BUS roller shutters, with position feedback and auto-calibration | Successfully tested: LN4672M2 |
| Temperature Control | `4` | `bus_thermo_zone`, `bus_thermo_sensor`, `bus_thermo_cu` | Thermo zones management and temperature sensors (probes). | Successfully tested: H/LN4691, HS4692, KG4691; thermo sensors: L/N/NT4577 + 3455; Central Units (4 or 99 zones) are not fully supported yet. See [Channels - Thermo](#configuring-thermo) for more details |
| Auxiliary (AUX) | `9` | `bus_aux` | AUX commands | Successfully tested: AUX configured for bulgrar-alarm unit 3486. Only sending AUX commands is supported |
| CEN & CEN+ Scenarios | `15` & `25` | `bus_cen_scenario_control`, `bus_cenplus_scenario_control` | CEN/CEN+ scenarios events and virtual activation | Successfully tested: scenario buttons: HC/HD/HS/L/N/NT4680 |
| Dry Contact and IR Interfaces | `25` | `bus_dry_contact_ir` | Dry Contacts and IR Interfaces | Successfully tested: contact interfaces F428 and 3477; IR sensors: HC/HD/HS/L/N/NT4610 |
| Energy Management | `18` | `bus_energy_meter` | Energy Management | Successfully tested: F520, F521 |

### For ZigBee (Radio)

Expand Down Expand Up @@ -152,6 +153,21 @@ Temperature sensors can be configured defining a `bus_thermo_sensor` Thing with

The (optional) Central Unit can be configured defining a `bus_themo_cu` Thing.

#### Configuring Auxiliary (AUX)

BUS Auxiliary commands (WHO=9) can be used to send on the BUS commands to control, for example, external devices or a BTcino Alarm system.

To control a BTicino alarm system the alarm unit should be configured for example as follows:

Antitheft -> Automations -> then toggle the Event option -> then select OPEN code

- Type in the AUX command you want to set, e.g.\*9\*1\*4\## (where=4)
- Type in the associated Open Web Net code you want to execute, e.g.\*5\*8*#1234## (engage alarm on zones 1,2,3,4).

Please note that receiving AUX messages originating from the bus is not supported yet, only sending messages to the bus is supported.



### Central Unit integration missing points

- Read setPoint temperature and current mode
Expand All @@ -162,14 +178,15 @@ The (optional) Central Unit can be configured defining a `bus_themo_cu` Thing.

### Lighting, Automation, Power meter, CEN/CEN+ Scenario Events and Dry Contact / IR Interfaces channels

| Channel Type ID (channel ID) | Applies to Thing Type IDs | Item Type | Description | Read/Write |
| ---------------------------------------- | ------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------- | :---------: |
| `switch` or `switch_01`/`02` for ZigBee | `bus_on_off_switch`, `zb_on_off_switch`, `zb_on_off_switch2u` | Switch | To switch the device `ON` and `OFF` | R/W |
| `brightness` | `bus_dimmer`, `zb_dimmer` | Dimmer | To adjust the brightness value (Percent, `ON`, `OFF`) | R/W |
| `shutter` | `bus_automation` | Rollershutter | To activate roller shutters (`UP`, `DOWN`, `STOP`, Percent - [see Shutter position](#shutter-position)) | R/W |
| `button#X`   | `bus_cen_scenario_control`, `bus_cenplus_scenario_control` | String | Trigger channel for CEN/CEN+ scenario events [see possible values](#cen-cen-channels) | R (TRIGGER) |
| `sensor` | `bus_dry_contact_ir` | Switch | Indicates if a Dry Contact Interface is `ON`/`OFF`, or if a IR Sensor is detecting movement (`ON`), or not (`OFF`) | R |
| `power` | `bus_energy_meter` | Number:Power | The current active power usage from Energy Meter | R |
| Channel Type ID (channel ID) | Applies to Thing Type IDs | Item Type | Description | Read/Write |
|-----------------------------------------|---------------------------------------------------------------|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------|:-----------:|
| `switch` or `switch_01`/`02` for ZigBee | `bus_on_off_switch`, `zb_on_off_switch`, `zb_on_off_switch2u` | Switch | To switch the device `ON` and `OFF` | R/W |
| `brightness` | `bus_dimmer`, `zb_dimmer` | Dimmer | To adjust the brightness value (Percent, `ON`, `OFF`) | R/W |
| `shutter` | `bus_automation` | Rollershutter | To activate roller shutters (`UP`, `DOWN`, `STOP`, Percent - [see Shutter position](#shutter-position)) | R/W |
| `button#X`   | `bus_cen_scenario_control`, `bus_cenplus_scenario_control` | String | Trigger channel for CEN/CEN+ scenario events [see possible values](#cen-cen-channels) | R (TRIGGER) |
| `sensor` | `bus_dry_contact_ir` | Switch | Indicates if a Dry Contact Interface is `ON`/`OFF`, or if a IR Sensor is detecting movement (`ON`), or not (`OFF`) | R |
| `power` | `bus_energy_meter` | Number:Power | The current active power usage from Energy Meter | R |
| `aux` | `bus_aux` | String | Possible commands: ON,OFF,TOGGLE, STOP, UP,DOWN,ENABLED, DISABLED, RESET_GEN, RESET_BI, RESET_TRI. Only 'ON' and `OFF' are supported for now | R/W |

### Thermo channels

Expand Down Expand Up @@ -263,6 +280,7 @@ Bridge openwebnet:bus_gateway:mybridge "MyHOMEServer1" [ host="192.168.1.35", pa
bus_cen_scenario_control LR_CEN_scenario "Living Room CEN" [ where="51", buttons="4,3,8"]
bus_cenplus_scenario_control LR_CENplus_scenario "Living Room CEN+" [ where="212", buttons="1,5,18" ]
bus_dry_contact_ir LR_IR_sensor "Living Room IR Sensor" [ where="399" ]
bus_aux Alarm_activation "Alarm activation" [ where="4" ]
}
```

Expand Down Expand Up @@ -320,7 +338,10 @@ Number:Temperature iEXT_temp "Temperature [%.1f %unit%]" (g

String iCENPlusProxyItem "CEN+ Proxy Item"

Switch iLR_IR_sensor "Sensor" { channel="openwebnet:bus_dry_contact_ir:mybridge:LR_IR_sensor:sensor" }
String iAlarm_activation "Alarm Activation" { channel="openwebnet:bus_aux:mybridge:Alarm_activation:aux"}
mvalla marked this conversation as resolved.
Show resolved Hide resolved

Switch iLR_IR_sensor "Sensor" { channel="openwebnet:bus_dry_contact_ir:mybridge:LR_IR_sensor:sensor" }


```

Expand Down Expand Up @@ -368,6 +389,12 @@ sitemap openwebnet label="OpenWebNet Binding Example Sitemap"
{
Switch item=iCENPlusProxyItem label="My CEN+ scenario" icon="movecontrol" mappings=[ON="Activate"]
}

Frame label="Alarm activation via AUX command"
{
Switch item=iAlarm_activation icon="siren"
lolodomo marked this conversation as resolved.
Show resolved Hide resolved

}
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* @author Massimo Valla - Initial contribution
* @author Gilberto Cocchi - Thermoregulation
* @author Andrea Conte - Energy management, Thermoregulation
* @author Giovanni Fabiani - Aux support
*/

@NonNullByDefault
Expand Down Expand Up @@ -70,6 +71,8 @@ public class OpenWebNetBindingConstants {
"bus_cenplus_scenario_control");
public static final String THING_LABEL_BUS_CENPLUS_SCENARIO_CONTROL = "CEN+ Control";

public static final ThingTypeUID THING_TYPE_BUS_AUX = new ThingTypeUID(BINDING_ID, "bus_aux");
public static final String THING_LABEL_BUS_AUX = "Auxiliary";
// ZIGBEE
public static final ThingTypeUID THING_TYPE_ZB_ON_OFF_SWITCH = new ThingTypeUID(BINDING_ID, "zb_on_off_switch");
public static final String THING_LABEL_ZB_ON_OFF_SWITCH = "ZigBee Switch";
Expand Down Expand Up @@ -99,11 +102,14 @@ public class OpenWebNetBindingConstants {
// ## CEN/CEN+ Scenario
public static final Set<ThingTypeUID> SCENARIO_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_BUS_CEN_SCENARIO_CONTROL,
THING_TYPE_BUS_CENPLUS_SCENARIO_CONTROL, THING_TYPE_BUS_DRY_CONTACT_IR);

// ## Aux
public static final Set<ThingTypeUID> AUX_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_BUS_AUX);
// ## Groups
public static final Set<ThingTypeUID> DEVICE_SUPPORTED_THING_TYPES = Stream
.of(LIGHTING_SUPPORTED_THING_TYPES, AUTOMATION_SUPPORTED_THING_TYPES,
THERMOREGULATION_SUPPORTED_THING_TYPES, ENERGY_MANAGEMENT_SUPPORTED_THING_TYPES,
SCENARIO_SUPPORTED_THING_TYPES, GENERIC_SUPPORTED_THING_TYPES)
SCENARIO_SUPPORTED_THING_TYPES, GENERIC_SUPPORTED_THING_TYPES, AUX_SUPPORTED_THING_TYPES)
.flatMap(Collection::stream).collect(Collectors.toCollection(HashSet::new));
public static final Set<ThingTypeUID> BRIDGE_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_ZB_GATEWAY,
THING_TYPE_BUS_GATEWAY);
Expand Down Expand Up @@ -146,6 +152,9 @@ public class OpenWebNetBindingConstants {
public static final String CHANNEL_TYPE_CEN_PLUS_BUTTON_EVENT = "cenPlusButtonEvent";
public static final String CHANNEL_DRY_CONTACT_IR = "sensor";

// Aux
public static final String CHANNEL_AUX = "aux";

// devices config properties
public static final String CONFIG_PROPERTY_WHERE = "where";
public static final String CONFIG_PROPERTY_SHUTTER_RUN = "shutterRun";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.binding.openwebnet.internal.handler.OpenWebNetAutomationHandler;
import org.openhab.binding.openwebnet.internal.handler.OpenWebNetAuxiliaryHandler;
import org.openhab.binding.openwebnet.internal.handler.OpenWebNetBridgeHandler;
import org.openhab.binding.openwebnet.internal.handler.OpenWebNetEnergyHandler;
import org.openhab.binding.openwebnet.internal.handler.OpenWebNetGenericHandler;
Expand All @@ -39,6 +40,7 @@
* @author Massimo Valla - Initial contribution
* @author Andrea Conte - Energy management, Thermoregulation
* @author Gilberto Cocchi - Thermoregulation
* @author Giovanni Fabiani - Auxiliary support
*/
@NonNullByDefault
@Component(configurationPid = "binding.openwebnet", service = ThingHandlerFactory.class)
Expand Down Expand Up @@ -74,6 +76,9 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) {
} else if (OpenWebNetScenarioHandler.SUPPORTED_THING_TYPES.contains(thing.getThingTypeUID())) {
logger.debug("creating NEW SCENARIO Handler --- {}", thing.getUID());
return new OpenWebNetScenarioHandler(thing);
} else if (OpenWebNetAuxiliaryHandler.SUPPORTED_THING_TYPES.contains(thing.getThingTypeUID())) {
logger.debug("Creating NEW AUXILIARY Handler");
return new OpenWebNetAuxiliaryHandler(thing);
}
logger.warn("ThingType {} is not supported by this binding", thing.getThingTypeUID());
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
* @author Massimo Valla - Initial contribution
* @author Andrea Conte - Energy management, Thermoregulation
* @author Gilberto Cocchi - Thermoregulation
* @author Giovanni Fabiani - Aux support
*/
@NonNullByDefault
public class OpenWebNetDeviceDiscoveryService extends AbstractDiscoveryService
Expand Down Expand Up @@ -173,6 +174,12 @@ public void newDiscoveryResult(Where where, OpenDeviceType deviceType, @Nullable
deviceWho = Who.CEN_PLUS_SCENARIO_SCHEDULER;
break;
}
case SCS_AUXILIARY_TOGGLE_CONTROL: {
thingTypeUID = OpenWebNetBindingConstants.THING_TYPE_BUS_AUX;
thingLabel = OpenWebNetBindingConstants.THING_LABEL_BUS_AUX;
deviceWho = Who.AUX;
mvalla marked this conversation as resolved.
Show resolved Hide resolved
break;
}
default:
logger.warn("Device type {} is not supported, default to GENERIC device (WHERE={})", deviceType, where);
if (where instanceof WhereZigBee) {
Expand Down
Loading