Common Composite (Child) Device Handlers

Hello, and thank you for working on these DTH’s. I’m looking for a resolution to an issue I’m having. I have 2 aeotec nano dual switch with monitoring. Switch one works on both devices, but the second switch on both devices are not working with the new Smartthings app. I’m using erocm123: Metering Switch Child Device (from 2017). It shows up as being able to turn on or off with the new Smartthings app, but when you try to turn it on or off I get a network or system error and it doesn’t work and still doesn’t show up for available devices in Alexa or Google home. In the new app, the 2nd switch is always stuck showing “Checking status…”.
Only the primary switch, switch one shows up and works which has a DTH of Z-wave Multi Metering Switch.
Any suggestions or are there any new DTH that i need?

Whichever device handler you are using needs to create the child devices with the option “isComponent: false”. The call to “addChildDevice” also needs componentName & componentLabel removed.
Here is an example:

2 Likes

Thanks for replying. I’m having trouble following. Which device handler do you recommend for the main switch and what do you recommend for the 2nd switch. I tried using your “Metering Switch Child Device” that you have at the beginning of this thread, and placing the:

addChildDevice(“erocm123”, “Metering Switch Child Device”, “${device.deviceNetworkId}-ep${i}”, null,
[completedSetup: true, label: “${device.displayName} (Q${i})”,
isComponent: false, componentName: “ep$i”, componentLabel: “Output $i”])

in the script/code but I just get the following error when I try to create it. “Org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: script_dth_metadata_5db19765_ebfa_478f_af06_7b8a9509f888: 103: expecting ‘)’, found ‘Switch’ @ line 103, column 38. addChildDevice(“erocm123”, “Metering Switch Child Device”, “${device.deviceNetworkId}-ep${i}”, null, ^ 1 error”

Sorry I’m having so much trouble understanding, I’m pretty new to this. I have had the devices for 2 year with no issues and now the second switch on 2 devices are not working. It must have something to do with new software/app that Smartthings started using. Would you be willing to give me a link or a finished copy of the main device handler and the child handler you use?

Is this the device handler you are using? https://github.com/SmartThingsCommunity/SmartThingsPublic/blob/2d0ab8b08036764a41eb32187e81beafcbaa2b3b/devicetypes/smartthings/zwave-multi-metering-switch.src/zwave-multi-metering-switch.groovy

I can only direct you on how to have it create the child devices in a way that works with the new app, but I have no experience with that device handler and that device. The error you are seeing is because you have a syntax error in what you have edited. Usually missing a quotation mark, closing bracket, etc. If the above is the handler you are using the following lines would change:

addChildDevice(“Child Metering Switch”, childDni, device.getHub().getId(), [
completedSetup : true,
label : componentLabel,
isComponent : false
])

To this:

addChildDevice(“Child Metering Switch”, childDni, device.getHub().getId(), [
completedSetup : true,
isComponent : false
])

1 Like

NOTE: The double quotes are the wrong type… here is the corrected version

addChildDevice("Child Metering Switch", childDni, device.getHub().getId(), [
completedSetup : true,
isComponent : false
])
3 Likes

Thanks so much for your help. I got it working with your “Aeotec Inc Dual Nano Switch with Energy Reading” and fixing the addChildDevice like you suggested. This then automatically created 2 metering switch child devices that I could then rename and now everything seems to be working. They show up under devices in smartthings IDE and also in the new app.

2 Likes

Eric - sorry to disturb…

I have a feeling, that you know a lot about device handlers :slight_smile:

I’m totally new to Smartthings, device handlers, groovy (and a lot more!)

I have a Smartthings hub and two Heiman HS1SA-E smoke detectors (zigbee) - I am going to buy more detectors if I can make this work :wink:

What I want to do, is to add the posibility to start the siren on all smoke detectors when one (or more) detects smoke.
I have been thinking to add a “switch” to the smokedetector in the App, and then - using “Automation” - turn the switch on for all my detectors when one of them detects smoke. (Hope that makes sense)
I think I might need to use “childdevices” to have both the original readout (status+battery level) AND the new switch.
Do use have a simple example how to use the “addChildDevice”?

Regards from Denmark
Jens

Hmmm, you replied to my post, but addressed @erocm1231 in your post… I’ll give it a shot, but Eric may have some additional inputs as well.

First question I have for you… Does the standard, default Device Handler for the Heiman HS1SA-E smoke detectors allow you to remotely control the siren currently? Smoke alarms are usually SENSOR only devices, meaning that they can only report data to SmartThings. SmartThings cannot send commands to these devices to turn on or off the audible siren.

As such, there is no way to achieve your goal of interlinking smoke detectors together via SmartThings. I can see why one might want to do this, however I have never heard of it being done in the 6+ years I have been using SmartThings and other home automation platforms.

Instead, you could have SmartThings send push notifications to cell phones, turn on lights, and even play sounds on Sonos-type speakers when any of the smoke alarms detects an issue.

2 Likes

In the US, UL standards for residential smoke detectors prohibit their sirens being used for any other purpose out of fear that residents will become desensitized to them or take steps that they might only take take for a fire, so most companies do not allow the siren to be initiated externally.

@Jens_Denmark

However, since this conversation is getting very far off topic for this particular thread, if you want to continue this discussion you should start a new thread under projects. :sunglasses:

2 Likes

Sorry - didn’t see I was replying you :slight_smile:
No, the standard Device Handler does not support remote control - but I have found out, that it IS possible (using another gateway).
But - I need to make another Device Handler that the “Automation” in the app will accept as a “action” when one smoke detector is triggered - sorry if I don’t use the right terms yet - remember I’m new to this :wink: (and normally speaking danish)

Actually, I started all this with buying two detectors and a gateway from a company called “Wattle” - the detectors are labeled “Heiman HS1SA-E” so I think this is common to all HS1SA-E.
When I trigger one detector, both starts the siren - the second a little later of course.
The problem is, that I don’t like the Wattle gateway (WGW) - it’s beeing discontinued, and the Smartthings looks more “open” (possible to tweak), so I got one of these too.

So - what I think I need to do, is to make a modificated DH that will send a Zigbee message to the smoke detector when triggered by a “automation” in the app. I think that I need to make a “composite” DH - but I’m not sure :slight_smile:

Regards from Jens

@JDRoberts
Please see my answer to @ogiewon - I hope this is still the right place?

BTW - I have no intension to use the sirens for anything else - just smoke alarms - but I get your point!

Jens

I think you’d get more assistance if you started your own dedicated thread to this device, or possibly add on to the following thread.

Also, you may be able to glean some knowledge by looking at the Hubitat Community driver for this device.

But let’s please stop posting in this thread as your request really has nothing to do with “Common Composite (Child) Device Handlers”

Good luck!

1 Like

I haven’t seen your new thread yet, but composite devices are usually only needed if you have a device that supports multiple endpoints for a single function. For example, a power strip with 4 controllable outlets. In this case you really just need to add the “Switch” capability to the smoke alarm device handler and create an on() & off() method that sends the zigbee commands.

1 Like