I am writing a driver for a Fan/Light combo and there are 2 on/off switches. Initially, I just coded it for the fan and everything worked fine with the fan being the “main” component. Then I added a second component for “light” so that I could add switch support for that as well. This multiple component device does not work with routines. The details screen works, but when adding it to a routine, the device is not listed. The single component version did show up in routines. Are there additional things that need to be defined to support routines in a multi-component device?
Have you seen the existing threads on issues with multicomponent drivers? There is quite a bit of discussion there. I’m not sure if they cover the exact issue that you are seeing, though. Hopefully someone else will know, or you will be able to tell from reading the other threads.
I did, but neither addressed why the device wouldn’t show up in routines. Oddly enough, my multi component device is now showing up in routines. My best guess is either a delayed cloud sync finally kicked in, or it has to do with upgrading the SmartThings mobile app. Can’t say which at this point.
I’ve also experienced delays with devices populating on the routines screen when I’m working on the driver. It’s not limited to multi-component devices - I had it happen with a single component device last night. I agree it’s likely lag somewhere in the cloud as it seems like waiting is the only fix.
Yeah, I agree with @w35l3y, please share the presentation ID (we can query the configuration using this value). You can find it when you list the devices, it doesn’t matter if it’s the one generated by default, we want to check if it matches the device profile.
The configuration in all the views (dashboard, detail, and automation) depend on the presentation used by the device which in Edge is generated based on the profile.
They will appear in the ST app in the same order as they are included there.
The first capability will be used in the dashboard view
If the capability presentation doesn’t include a configuration for the view where it is included, nothing will be displayed.
For example, in the case of Switch it has a configuration for all the views, but thermostatMode doesn’t have the dashboard view configuration.
This means that, if we use thermostatMode first in our profile, the device won’t display any status in the dashboard view.
Use this command to verify the presentation configuration of each capability
Have you done any testing to show that this is true? In my experience, profiles with multiple components function properly without a custom device presentation. The exception is the known issue regarding components that have a number in their ID, but that only impacts the sort order on the detail view.
The default presentation is generated based on the components and capabilities defined in the profile. From what I’ve seen, a profile that lacks a custom-defined vid works equally well regardless of whether the profile has one or many components.
Getting back on topic:
The device has been functioning properly in routines since post 3. No changes to the presentation are necessary.
The question is what changed between post 1 and post 3 to fix the issue. It could be something that @blueyetisoftware did while troubleshooting, such as re-packaging the driver. Or it could be cloud delays, possibly related to what was going on in that timeframe.
Update on the routines. I am seeing some unexpected behavior in the configuration for a multi-component device. When I go into the settings screen, it is selecting a setting for my main switch by default, even if I only want to change the settings for a secondary component. For example, I have this Fan/Light combo with the fan being the “main” component. Both have a switch capability:
This happens whenever the switch capability is included - it’s not specific to multi-component devices. My phone is Android and it allows me to do what @w35l3y demonstrated - simply unselect the switch capability so it’s not part of the automation.
That video seems to show a condition being selected. You can only have one selected.
@blueyetisoftware is trying to select an action and is seemingly being forced to choose between one of the three options for the switch in the main component. It can’t be deselected.
This came up in October last year in the context of Edge drivers for devices with a master switch and individual switches. It wasn’t possible to change only a component switch without choosing a state for the master switch.
It is much older than that though. I encountered it two years ago with a momentary switch. I couldn’t just select ‘push’, I was forced to select between toggle, on and off for the switch too…
I assumed it had been fixed a long time ago and I don’t have a device to test it on myself. Clearly @blueyetisoftware and others have found otherwise.
Well, I feel a bit silly now. I was able to unselect the main component by tapping the selected option a second time. So if ON was selected by default, tapping ON again unselected that component. Seems to work. I was thrown off by the default selection and clicked everywhere except there.