Skip to content

Commit

Permalink
Added PAN11 power switch with energy meter.
Browse files Browse the repository at this point in the history
Changed Binarypowerswitch to support reading meter values.
  • Loading branch information
Brimstedt committed Sep 20, 2016
1 parent 956e518 commit 901ade6
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ proguard/
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

#exlipse
#eclipse
.classpath
.project
.settings
target

5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mapdb</groupId>
<artifactId>mapdb</artifactId>
<version>1.0.9</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
*******************************************************************************/
package com.whizzosoftware.wzwave.node.specific;

import com.whizzosoftware.wzwave.commandclass.MeterCommandClass;
import com.whizzosoftware.wzwave.commandclass.MultilevelSensorCommandClass;
import com.whizzosoftware.wzwave.node.NodeInfo;
import com.whizzosoftware.wzwave.node.NodeListener;
import com.whizzosoftware.wzwave.node.ZWaveEndpoint;
import com.whizzosoftware.wzwave.node.generic.BinarySwitch;
import com.whizzosoftware.wzwave.persist.PersistenceContext;

Expand All @@ -22,9 +25,20 @@ public class BinaryPowerSwitch extends BinarySwitch {

public BinaryPowerSwitch(NodeInfo info, boolean listening, NodeListener listener) {
super(info, listening, listener);
addCommandClass(MeterCommandClass.ID, new MeterCommandClass());
addCommandClass(MultilevelSensorCommandClass.ID, new MultilevelSensorCommandClass());
}

public BinaryPowerSwitch(PersistenceContext pctx, Byte nodeId, NodeListener listener) {
super(pctx, nodeId, listener);
}
}

static public Double getCurrentValue(ZWaveEndpoint endpoint) {
MeterCommandClass cc = (MeterCommandClass) endpoint.getCommandClass(MeterCommandClass.ID);
if (cc != null) {
return cc.getCurrentValue();
} else {
return null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@
public class ProductRegistry {
private static final Logger logger = LoggerFactory.getLogger(ProductRegistry.class);

// Find info here: http://www.cd-jackson.com/index.php/zwave/zwave-device-database/zwave-device-list
public final static String M_PHILIO = "Philio Technology Corporation ";
public final static String M_AEON_LABS = "Aeon Labs";
public final static String M_EVERSPRING = "Everspring";
public final static String M_GE_JASCO = "GE/Jasco";

public final static String P_PAN11 = "Smart Energy Plug In Switch (PAN11)";
public final static String P_45604_OUTDOOR_MODULE = "45604 Outdoor Module";
public final static String P_45609_RELAY_SWITCH = "45609 On/Off Relay Switch";
public final static String P_45612_DIMMER_SWITCH = "45612 Dimmer Switch";
Expand Down Expand Up @@ -114,14 +117,27 @@ static public ProductInfo lookupProduct(Integer manufacturerId, Integer productT
}
break;

// Philio
case 316:
info.setManufacturer(M_PHILIO);
switch (ptid) {
case 1:
switch (pid) {
case 17:
info.setName(P_PAN11);
break;
}
break;
}

default:
break;
}

if (!info.isComplete() && manufacturerId != null && productTypeId != null && productId != null) {
logger.error("You are using a product that is not in WZWave's product registry. If the product is " +
"working properly with WZWave, please submit the following to the project so it can be " +
"added to the registry: {},{},{}", manufacturerId, productTypeId, productId);
"added to the registry: Resolved {} from Manufacturer: {}, Product Type: {}, Product Id:{}", info, manufacturerId, productTypeId, productId);
}

return info;
Expand Down

0 comments on commit 901ade6

Please sign in to comment.