Could an app provide functionality to support non-linear lighting

Since we have not worked as a SmartThings developer and are not yet familiar with the tools or programmability, we are asking the developers if what we need to do is within the capabilities of this product.

We have a 120VAC lighting application but the load itself does not linearly follow the voltage applied to it. To set the dimming to 75% you might provide 60 VAC, to set the dimming to 50% you might set the voltage to 30VAC, for 25% you might set the voltage to 10VAC. We maintain an internal table which converts dimming percentages to voltage required.

If someone using a dimmer switch as input, sets it to 75%, we want to provide that 60VAC to the load. Or, if someone from a SmartPhone app sets the dimmer to 75%, we need to provide 60VAC to the load.

If someone wants to slowly dim the light from 0% to 100% over a 10 second period, we would need to send a series of voltage setting over the 10 second period which provided that set of voltages which would smoothly change the dimming from 100% down to 0%.

It is unclear what functions operate in the cloud as opposed to which operate in the hub. If in the case of the slow dimming function, it is operated out of the cloud, we are concerned about insuring the proper voltage setting are provided at the right timing to insure the light smoothly appears to dim from 0% to 100%. It would seem to us that we would want that function to operate in the local hub.

In the case when a user, through the smartphone app says “set the dimmer to 75%”, that operation seem more straight forward where we would want our custom application to receive the 75% request and then to output a command to tell the dimmer to go to 50% which would output the 60VAC that would be required.

Does it seem feasible to write custom code for the simple case of capturing the input request and then setting the load on a dimmer to the desired value? Does it seem feasible to write code to intercept a request to dim over a period of time and have that code send the necessary sequence of commands for the setting of the necessary voltages over time. (Because we are working with dimmers that are linear (go from 0% to 100%), when we say ‘set the voltage’ we really mean that we would command the dimmer to a particular setting from 0% to 100% which results in the output voltage that we desire).

SmartThings merely sends commands using established protocols to third party devices expecting those messages. It doesn’t itself control any loads.

If you identify third party hardware devices which can do what you want as far as controlling the current, you can probably write a device type handler for the SmartThings platform which will send the appropriate message, although it might be cloud to cloud.

The SmartThings code runs in the cloud. At the present time no custom code is allowed to run locally on the hub itself.

That doesn’t mean SmartThings might not be a match to your project, but it’s not a complete solution. You’re going to have to find a hardware piece to do the current management. Then SmartThings can provide a cloud-based UI and rules engine to talk to that hardware piece.

However, at present SmartThings is not a really good match for anything requiring Precision timing because of latency introduced by the cloud-based aspect, and it’s not a super efficient cloud. The SmartThings developer docs say that timing cannot be specified in less than one minute increments. You can try it, and it might work, but it can’t be guaranteed to work every time.

So again, you would want a hardware piece that could do the pattern management.

A good example is devices like the Homeseer switch which has single tap, double tap, and triple tap pattern recognition built into the switch itself. For both the top and bottom of the switch. When the switch firmware recognizes a pattern, it sends a single byte “central scene” identifier to the SmartThings hub, where is passed to the cloud, where a custom device type handler recognizes that the central scene identifier has been received, and a smartapp, also running in the cloud, which subscribes to that specific event is notified. Then if something needs to be done with a device in the home because of that event the smartapp requests the device command which is sent back from the cloud to the hub which then sends it on to the appropriate device. So you can see why precision timing is challenging.

So essentially first you have to figure out exactly how you would accomplish what you want without having SmartThings in the picture. What hardware would you use to control the current, etc. Once you have that figured out, you may be able to use SmartThings as a networked UI to send command and control messages to that hardware. But it’s the hardware that has to be able to manage the current directly.

Thank you. You have answered my question. With SmartThings sending commands via the cloud and not via the Hub, my application will not work. The device that I need to control is an existing Z-Wave dimmer switch. But to perform the ramping function I defined, the cloud would need to send a series of dimmer messages to the dimmer device in a timed order and less than 250ms between each command. A cloud based service is not going to be able to meet the timing. I will need a home automation system that sends commands out of the local hub and can be programmed to send the command sequence I require. There are other products that do execute code in the local hub that I will need to turn to in lieu of the SmartThings unit.

1 Like