Setting device preferences with a Rule

Finally, we have a Edge Driver for the HomeSeer series of switches

[GitHub - jshessen/SmartThingsEdgeDrivers]

. In the not so distant past, there was an ability to set which LED was on, it’s color and whether or not that LED would blink.

I am trying to figure out, what (and if it exists) is the command to send and the arguments to include. in the ST App, the LEDs are all on the settings tab, so i am (hoping) sure that there is a command that is being sent under the hood to make that work, but can i do that from a Rule?

i’ve used the CLI to capture the component-status

**Capability   Attribute              Value**
 button       button                 "pushed"
 button       numberOfButtons
 button       supportedButtonValues
 switchLevel  level                  67 %
 switch       switch                 "off"

and tried the device:command, without the actual command to get the list of commands

C:\Program Files (x86)\SmartThings>smartthings devices:commands 4808b802-9d87-4fba-ab31-f18c2047d458

Foyer Lights

Capabilities:
────────────────
 1  switch
 2  switchLevel
 3  button
 4  refresh
────────────────

? Enter capability index or id 1

Commands:
──────────
 1  off()
 2  on()
──────────

so i am thinking that to set the values, isn’t a command per se… any advice?

The only way to change things on the Settings tab of the app is through the Settings tab of the app.

The way to do this is to modify the driver… Remove the LED parameter from the Settings tab and use a custom capability to control it instead, which will allow it to be controlled through the Details tab or automations.

4 Likes

The custom driver already exposes them, so no need for the configuration tool. OP is looking to use the settings dynamically, probably as notifications.

2 Likes

@philh30 is correct. the device in the app shows the settings

i’d like to set the individual LEDs and their color in a Rule.

psuedo-code

if FrontDoor unlocks
     set LED1 Red and blinking
else if FrontDoor is locked 
     set LED1 Green and not_blinking

Hi @AZSteve

What do you want to do exactly?

Use the state of the led to make a routine?: This cannot be done if the device does not report the state of the led with some command, which does not usually happen

Establish a value of a parameter (led color) with a routine?: This can be done by adding several things to the driver

1 Like

Thanks @philh30, this is a bit (a lot) beyond my capability at this time, i will need to do a whole lot more learning to accomplish this.

1 Like

@Mariano_Colmenarejo : i want to be able to SET the LED color and status (blink or not) when something else happens. if a door unlocks, set the LED red, if locked, set it green.

these switches have a number of LED (for the HS-WS200 there are 7). i plan that LED 1 = Front Door status, LED2 is Garage Door status, etc,

i have 4 of these throughout my house, so at a glance i can see if there are any open doors, unlocked doors, who is home, lights on in the garage, etc.

with WebCore i had a whole piston to manage that and was hoping to replicate the functionality in a Rule, but as @philh30 pointed out, the Edge driver, as it is now, won’t allow for it as the led colors are implemented as a setting and there is no command provided to actually call from a Rule.

there needs to be a command to set NORMAL MODE (which would show the level of the dimmer) or STATUS Mode (which allows for the setting the color and mode of each LED individually)

example (i used the app to set the colors manually, i want to do this with an automation (rule, but a scene would be cool too)

so, yes, i want to

Establish a value of a parameter (led color) with a routine

correct

1 Like

i’ve written, what i think the Rule should look like, but the 'THEN’s are no good, as there isn’t a command to actually call yet… :face_with_raised_eyebrow:

here i am using the Z-wave lock and the door contact sensor as the triggers.

{
	"name": "Front Door Open Indicator (Status)",
	"actions": [
		{
			"if": {
				"changes": {
					"equals": {
						"left": {
							"device": {
								"devices": [
									"616651dc-a473-4129-b051-661fcfe2ed5f"
								],
								"component": "main",
								"capability": "lock",
								"attribute": "lock"
							}
						},
						"right": {
							"string": "unlocked"
						}
					}
				},
				"then": [
					{
						"command": {
							"devices": [
								"4808b802-9d87-4fba-ab31-f18c2047d458"
							],
							"commands": [
								{
									"component": "main",
									"capability": "switch",
									"command": "setStatusLED",
									"arguments": [
										{
											"ledStatusColor ": {
												"integer": 1
											},
											"colorName": {
												"integer": 1
											},
											"blink": {
												"string": "on"
											}
										}
									]
								}
							]
						}
					}
				],
				"else": [
					{
						"if": {
							"changes": {
								"equals": {
									"left": {
										"device": {
											"devices": [
												"a1df7c9b-2fcd-49e8-aa69-c9745c451e4c"
											],
											"component": "main",
											"capability": "contactSensor",
											"attribute": "contact"
										}
									},
									"right": {
										"string": "open"
									}
								}
							},
							"then": [
								{
									"command": {
										"devices": [
											"4808b802-9d87-4fba-ab31-f18c2047d458"
										],
										"commands": [
											{
												"component": "main",
												"capability": "switch",
												"command": "setStatusLED",
												"arguments": [
													{
														"ledNumber": {
															"integer": 1
														},
														"colorName": {
															"integer": 4
														},
														"blink": {
															"string": "on"
														}
													}
												]
											}
										]
									}
								}
							],
							"else": [
								{
									"command": {
										"devices": [
											"4808b802-9d87-4fba-ab31-f18c2047d458"
										],
										"commands": [
											{
												"component": "main",
												"capability": "switch",
												"command": "setStatusLED",
												"arguments": [
													{
														"ledNumber": {
															"integer": 1
														},
														"colorName": {
															"integer": 2
														},
														"blink": {
															"string": "off"
														}
													}
												]
											}
										]
									}
								}
							]
						}
					}
				]
			}
		}
	]
}

I’d suggest you bring this up with the author of the driver. It’s probably functionality that others would want for these devices too.

1 Like

I agree with this wholeheartedly, since it’s exactly how these devices were advertised by the manufacturer, with the LEDs as real time indicator lights:

image

If this was possible in the previous Groovy, DTH, I would definitely suggest looking at that to see what Z wave commands they were sending.

@Mariano_Colmenarejo

3 Likes

OK, I took a quick look at the original Groovy DTH for the dimmer, written by the always impressive @krlaframboise , and while I am limited in my understanding because I use a screen reader, it looks like that was created with a whole bunch of child devices which handled the setting of the individual colors and blink rates for the indicator LEDs.

The original edge Driver architecture didn’t use a parent/child construct but they did add one later because they couldn’t get voice control of the individual components without it.

So my guess is you could use exactly the same approach in an edge driver and build on the work that @krlaframboise did for the groovy version as long as there’s not some new limit on the number of child devices.

So I would suggest going to the author of the new edge driver and making that suggestion to them.

Here’s the link to the Groovy DTH for the dimmer so you can see what I mean

Once you have those child devices, turning them on and off from a regular routine should be very straightforward. They’ll just look like another RGBW smart bulb. :sunglasses::bulb:

3 Likes

That DTH used a bunch of child devices and exploited misc capabilities because custom capabilities weren’t supported in Routines when I wrote it, but I personally wouldn’t implement it that way now…

2 Likes

thank you gentleman, your detailed knowledge is astounding and greatly appreciated as we work to transition years of automation from one platform to another… painful but necessary.

1 Like