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

More Osram smart+ switch support #366

Merged
merged 4 commits into from
Feb 6, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
106 changes: 106 additions & 0 deletions org.openhab.binding.zigbee/ESH-INF/thing/osram/osram-switch-4x-eu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" bindingId="zigbee"
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd">
<thing-type id="osram-switch-4x-eu">
<label>Osram Smart+ Switch</label>
<channels>
<channel id="buttonBottomRight" typeId="system.button">
<label>Button bottom right</label>
<description>The button in the bottom right corner (LED pointing down wards).</description>
<properties>
<property name="zigbee_endpoint">1</property>
<property name="zigbee_shortpress_cluster_id">0x0006</property>
<property name="zigbee_shortpress_command_id">0x01</property>
<property name="zigbee_longpress_cluster_id">0x0008</property>
<property name="zigbee_longpress_command_id">0x05</property>
</properties>
</channel>
<channel id="buttonBottomRightLongpressRelease" typeId="system.button">
<label>Button bottom right long press release</label>
<description>This channel gets an event when a long press on the bottom right button is released.</description>
<properties>
<property name="zigbee_endpoint">1</property>
<property name="zigbee_shortpress_cluster_id">0x0008</property>
<property name="zigbee_shortpress_command_id">0x03</property>
</properties>
</channel>
<channel id="buttonBottomLeft" typeId="system.button">
<label>Button bottom left</label>
<description>The button in the bottom left corner (LED pointing down wards).</description>
<properties>
<property name="zigbee_endpoint">2</property>
<!-- short press is not working yet -->
<!-- <property name="zigbee_shortpress_cluster_id">0x0300</property> -->
<!-- <property name="zigbee_shortpress_command_id">0x4C</property> -->
<property name="zigbee_longpress_cluster_id">0x0300</property>
<property name="zigbee_longpress_command_id">0x03</property>
</properties>
</channel>
<channel id="buttonBottomLeftLongpressRelease" typeId="system.button">
<label>Button bottom left long press release</label>
<description>This channel gets an event when a long press on the bottom left button is released.</description>
<properties>
<property name="zigbee_endpoint">2</property>
<property name="zigbee_shortpress_cluster_id">0x0300</property>
<property name="zigbee_shortpress_command_id">0x01</property>
<property name="zigbee_shortpress_parameter_name">moveMode</property>
<property name="zigbee_shortpress_parameter_value">0</property>
</properties>
</channel>
<channel id="buttonTopRight" typeId="system.button">
<label>Button top right</label>
<description>The button in the top right corner (LED pointing down wards).</description>
<properties>
<property name="zigbee_endpoint">3</property>
<property name="zigbee_shortpress_cluster_id">0x0006</property>
<property name="zigbee_shortpress_command_id">0x00</property>
<property name="zigbee_longpress_cluster_id">0x0008</property>
<property name="zigbee_longpress_command_id">0x01</property>
</properties>
</channel>
<channel id="buttonTopRightLongpressRelease" typeId="system.button">
<label>Button top right long press release</label>
<description>This channel gets an event when a long press on the top right button is released.</description>
<properties>
<property name="zigbee_endpoint">3</property>
<property name="zigbee_shortpress_cluster_id">0x0008</property>
<property name="zigbee_shortpress_command_id">0x03</property>
</properties>
</channel>
<channel id="buttonTopLeft" typeId="system.button">
<label>Button top left</label>
<description>The button in the top left corner (LED pointing down wards).</description>
<properties>
<property name="zigbee_endpoint">4</property>
<!-- short press is not working yet -->
<!-- <property name="zigbee_shortpress_cluster_id">0x0300</property> -->
<!-- <property name="zigbee_shortpress_command_id">0x4C</property> -->
<property name="zigbee_longpress_cluster_id">0x0300</property>
<property name="zigbee_longpress_command_id">0x03</property>
</properties>
</channel>
<channel id="buttonTopLeftLongpressRelease" typeId="system.button">
<label>Button top left long press release</label>
<description>This channel gets an event when a long press on the top left button is released.</description>
<properties>
<property name="zigbee_endpoint">4</property>
<property name="zigbee_shortpress_cluster_id">0x0300</property>
<property name="zigbee_shortpress_command_id">0x01</property>
<property name="zigbee_shortpress_parameter_name">moveMode</property>
<property name="zigbee_shortpress_parameter_value">0</property>
</properties>
</channel>
<channel id="batteryVoltage" typeId="battery_voltage">
<properties>
<property name="zigbee_endpoint">2</property>
</properties>
</channel>
</channels>
<config-description>
<parameter name="zigbee_macaddress" type="text" readOnly="true" required="true">
<label>MAC Address</label>
</parameter>
</config-description>
</thing-type>
</thing:thing-descriptions>
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,8 @@ public CommandSpec(int clusterId, int commandId, String commandParameterName, St

public boolean matchesCommand(ZclCommand command) {
boolean commandIdMatches = command.getCommandId().intValue() == commandId;
boolean commandParameterMatches = commandParameterName == null || commandParameterValue == null
|| matchesParameter(command);

return commandIdMatches && commandParameterMatches;
return commandIdMatches
&& (commandParameterName == null || commandParameterValue == null || matchesParameter(command));
}

private boolean matchesParameter(ZclCommand command) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ bitron-video-902010-23,vendor=Bitron Home,modelId=902010/23
bitron-video-av2010-34,vendor=Bitron Video,modelId=AV2010/34
xiaomi_lumisensorht,modelId=lumi.sensor_ht
innr-rc-110,vendor=innr,modelId=RC 110
osram-switch-4x-eu,vendor=OSRAM,modelId=Switch 4x EU-LIGHTIFY