Philio PAN04 Dual Relay Device Type

EDIT: I have modified my original device type to add full functionality with the Philio. This means the device type isn’t the best choice for use with the Monoprice/Enerwave/ or Fibaro (because it has a lot of extra functionality). If you have one of those devices though search for my Generic Dual Relay Adapter that should work great.

I have added error reporting for each individual switch, preferences on reporting, and a “master” switch that turns on/off both lights. I have also posted a better physical / virtual sync app.

I have created a custom device type for the Philio PAN04 Dual Relay. It supports the energy monitoring of the switch as well as both relays. I used the enerwave and monoprice dual relay device types as reference, but this one is much better for the Philio as it will update status when the wall switch is physically used. When the wall switch is flipped, the Philio sends a “SwitchBinaryReport” zwave event with either 0 or 255 representing off or on. The problem is that it does not say which relay changed state. When my device type receives a “SwitchBinaryReport” it queries the relays for their current state and updates them accordingly. I believe this is how the HAIL function of Zwave works.

Anyway, give it a try and let me know how it goes. I haven’t had a chance to check the fingerprinting on it, but it should work.

Also, since this device type supports a kind of “Instant Update” I have made some modifications to a SmartApp provided by @myfly325 that lets you create two individual virtual switches that tie back to the Philio PAN04. This allows you to use the two Philio relays in SmartApps, routines, etc. His SmartApp polls the associated switch every minute or so, but that is not necessary with my device type. His instructions are here:

And here is my SmartApp:

4 Likes

Nice! I wish the Enerwave (and some of the even the bigger names in Zwave switches) would provide more immediate feedback. I’ve seen the explanations about patents, etc, but the enerwave is already doing it for switch one, why not the second?? Sounds like the Philio is the one to look at going forward. Glad you could get some use out of the Enerwave code.

My device type might actually work with the Enerwave and provide the updated switch status. The devices seem very similar. If you have one to try out let me know.

I have a friend with a Monoprice dual relay that I will be testing with this device type in the near future. The Monoprice switches go on sale sometimes and I’ve seen them for about $25.

Edit: So I just looked at the documentation for the Enerwave Switch and noticed that it is shipped with configuration parameter 3 set to 0. Looks like it should be set to the Zwave Node ID of your Gateway (probably 1 unless you have multiple gateways) in order for status updates to work. I quickly looked at some of the device types out there for this switch and none of them configure the parameter to what it should be. Changing that config parameter might enable instant status updates.

Hi @erocm1231

I am trying to get instant update on a Fibaro 2x1.5kw unit. when I install your code and look at the logs.
I get Parsed BasicSet(value: 255) to [[‘descriptionText’:R Study: BasicSet(value: 255), ‘isStateChange’:false, ‘displayed’:false, ‘linkText’:‘R Study’]] for switch 1 but the status is not updated. also when switch 2 is pressed nothing is reported in the logs. if I turn the lights on manually and then click refresh in the app both switches report correctly. Wondering if you have any pointers?

Thanks

Paul

What is the model number of the device? Looking at the manual for the FGS-222 I’m pretty sure the device type can easily be modified to work with the switch. It seems there are 2 configurations that need to be set and SmartThings needs a group 1 & group 2 association. The switch is sending a BasicSet to everything in group 1 when you flip the first switch (which is what you are seeing in the logs), and group 2 for switch 2. My guess is that the SmartThings hub isn’t associated to group 2 which is why you aren’t getting anything.

Parameter 6 & 7 need to both be set to 0 for this functionality to work. This is the default value so we should be OK there.

Can you try the updated device type? I think I have modified it to work with the Fibaro. You do need to go into the preferences (edit device from the SmartThings app) of the device after its type is updated, and put “2” into the “Associate SmartThings with this group” section and hit “done”.

Watch the logs as you do this and make sure it returns:

7072ad80-4108-4f77-9893-60e4b225ce19 1:59:30 PM: debug Parsed AssociationReport(groupingIdentifier: 2, maxNodesSupported: 1, nodeId: [1], reportsToFollow: 0)

Hi @erocm1231

I can add the device type, but when I try to assign it to the device I get:

Oh No! Something Went Wrong!
Error:500: Internal Server ErrorURI:/device/updateReference Id:3a9ac178-0d21-4e23-85a3-9e763f51e808Date:Wed Nov 18 08:18:17 UTC 2015

if I look in the logs

d13faffb-c933-4c29-9c5f-a6f6e2312a93 ‎08‎:‎20‎:‎24: error java.lang.NullPointerException: Cannot get property ‘value’ on null object @ line 204

Alright, I updated the device type to hopefully not get that error. Can you try with the new one?

in the log I still received

d13faffb-c933-4c29-9c5f-a6f6e2312a93 ‎18‎:‎20‎:‎14: error java.lang.NullPointerException: Cannot get property ‘value’ on null object @ line 204

Sorry about that. I added even more error handling. Please try the new code. It is hard troubleshooting without the actual device. :wink:

By the way, I have been waiting for probably over a year for Fibaro to release their relays in the US. They keep saying “coming soon”, but they have been saying that for over a year.

that looks like it is working :smile:

The Log files look like:

d13faffb-c933-4c29-9c5f-a6f6e2312a93 ‎14‎:‎45‎:‎27: debug Parsed MultiChannelCmdEncap(bitAddress: false, command: 3, commandClass: 37, destinationEndPoint: 1, parameter: [0], sourceEndPoint: 1) to [[‘name’:switch1, ‘value’:‘off’, ‘isStateChange’:true, ‘displayed’:true, ‘linkText’:‘R Outside Light’, ‘descriptionText’:R Outside Light switch1 is off]]

d13faffb-c933-4c29-9c5f-a6f6e2312a93 ‎14‎:‎45‎:‎26: debug Parsed BasicSet(value: 255) to [physicalgraph.device.HubMultiAction@640182eb]

d13faffb-c933-4c29-9c5f-a6f6e2312a93 ‎14‎:‎45‎:‎25: debug Parsed MultiChannelCmdEncap(bitAddress: false, command: 3, commandClass: 37, destinationEndPoint: 2, parameter: [255], sourceEndPoint: 2) to [[‘name’:switch2, ‘value’:‘on’, ‘isStateChange’:false, ‘displayed’:false, ‘linkText’:‘R Outside Light’, ‘descriptionText’:R Outside Light switch2 is on]]

d13faffb-c933-4c29-9c5f-a6f6e2312a93 ‎14‎:‎45‎:‎22: debug Parsed BasicSet(value: 0) to [physicalgraph.device.HubMultiAction@28d87c9a]

d13faffb-c933-4c29-9c5f-a6f6e2312a93 ‎14‎:‎45‎:‎20: debug Parsed MultiChannelCmdEncap(bitAddress: false, command: 3, commandClass: 37, destinationEndPoint: 1, parameter: [255], sourceEndPoint: 2) to [[‘name’:switch2, ‘value’:‘on’, ‘isStateChange’:true, ‘displayed’:true, ‘linkText’:‘R Outside Light’, ‘descriptionText’:R Outside Light switch2 is on]]

d13faffb-c933-4c29-9c5f-a6f6e2312a93 ‎14‎:‎45‎:‎19: debug Parsed MultiChannelCmdEncap(bitAddress: false, command: 3, commandClass: 37, destinationEndPoint: 1, parameter: [255], sourceEndPoint: 1) to [[‘name’:switch1, ‘value’:‘on’, ‘isStateChange’:false, ‘displayed’:false, ‘linkText’:‘R Outside Light’, ‘descriptionText’:R Outside Light switch1 is on]]

d13faffb-c933-4c29-9c5f-a6f6e2312a93 ‎14‎:‎45‎:‎18: debug Parsed BasicSet(value: 255) to [physicalgraph.device.HubMultiAction@a0584d5]

d13faffb-c933-4c29-9c5f-a6f6e2312a93 ‎14‎:‎45‎:‎18: debug Parsed MultiChannelCmdEncap(bitAddress: false, command: 3, commandClass: 37, destinationEndPoint: 1, parameter: [255], sourceEndPoint: 1) to [[‘name’:switch1, ‘value’:‘on’, ‘isStateChange’:false, ‘displayed’:false, ‘linkText’:‘R Outside Light’, ‘descriptionText’:R Outside Light switch1 is on]]

d13faffb-c933-4c29-9c5f-a6f6e2312a93 ‎14‎:‎45‎:‎18: debug Parsed MultiChannelCmdEncap(bitAddress: false, command: 3, commandClass: 37, destinationEndPoint: 1, parameter: [0], sourceEndPoint: 2) to [[‘name’:switch2, ‘value’:‘off’, ‘isStateChange’:false, ‘displayed’:false, ‘linkText’:‘R Outside Light’, ‘descriptionText’:R Outside Light switch2 is off]]

d13faffb-c933-4c29-9c5f-a6f6e2312a93 ‎14‎:‎45‎:‎17: debug Parsed MultiChannelCmdEncap(bitAddress: false, command: 3, commandClass: 37, destinationEndPoint: 1, parameter: [255], sourceEndPoint: 1) to [[‘name’:switch1, ‘value’:‘on’, ‘isStateChange’:true, ‘displayed’:true, ‘linkText’:‘R Outside Light’, ‘descriptionText’:R Outside Light switch1 is on]]

d13faffb-c933-4c29-9c5f-a6f6e2312a93 ‎14‎:‎45‎:‎16: debug Parsed BasicSet(value: 255) to [physicalgraph.device.HubMultiAction@481c7479]

Awesome, did you have to change the association for group 2 or did the device type start working with just the changes I made? I believe that the SmartThings hub needs to be associated with group 2 for the second switch to notify the hub of a state change.

On the device properties I changed the association to 2, not sure if it would work without it as I made the change straight away.

Hi @erocm1231

Just a small update, the device type works great. I have had a few lights turn on randomly, has only happened 6-7 times mainly over night.

Paul

@pukka

I have noticed something similar with a virtual garage door that I have. Out of no where it will randomly turn on and open the garage door. I looked in the device logs and the virtual device just gets activated for no apparent reason. There were no traces of any SmartApp or routine activating the virtual switch so I summed it up to SmartThings wonkiness. Hopefully it will clear up, but post back after a while if it hasn’t.

Being a bit thick but can you give and idiot guide on how to install this into a UK v2 Hub… as we have several of these I need to use

Sure, see the link below for instructions on how to add a custom device type and SmartApp.

http://thingsthataresmart.wiki/index.php?title=Using_Custom_Code#Using_A_Custom_SmartApp

Just wanted to say thanks for putting this together. Installed one today and worked perfectly.

1 Like

FYI to users of this device. I have updated the device handler to support more functionality of the switch. Check it out in the first post.

1 Like

Hello @erocm1231, I was wondering what i could do to stop the power meter from reporting in notifications, every second. Is there any lines of code that i could edit to stop this?, as the reports are flooding my notification window.

The device handler works great thanks ! with my (Z-Wave Qubino Flush Relay x 1 Plus)