For information on hosting your SmartApp, visit the Hosting section. NodeJs Java The SDKs are a set of libraries and wrappers around the SmartThings API designed specifically for SmartApp creation. So, let’s consider my example again and let’s simplify it it even more. Create Your SmartApp With the SmartApp SDK There are two SDKs available to help create your SmartApp. I’d like to avoid writing device code at all if that is possible. With that said, when I try to create a new routine to use that switch as a trigger, the device is not in the list to be used. You look at it putting device code at the first place. It looks like you are looking at this problem from a different perspective. Why I want this virtual device? Because I want many rules to use the attribute from that virtual device and I don’t want to repeat the algorithm that I have in the rule reading light sensors in all the rules. The devices.yml config file maintains a mapping of device attribute command to the MQTT topic payload to be published. Then I would use that virtual device values in other rules. For every event Smartthings generates a device attribute command event package that the SmartApp is subscribed to and sends it to the mbs-server. The SmartThings nodes provided in the Automation Studio allows you to wire installed devices to implement autorun rules without any code. To create a new SmartApp, click the New SmartApp button from the My SmartApps page. Then I create a rule and put an algorithm there to set those properties on that virtual device. So, I was thinking why don’t I create a virtual device with an enum attribute for than and corresponding commands with all those values. Then I will use that value in other rules in other complex expression. I decided to create an algorithm to translate the numeric values from those sensors into a descriptive value like: dusk, earlyNight, night, dawn, earlyMorning, morning, brightDay and so on. Let’s say I have a light sensor or a few of them. Then I wanted to have other rules using that virtual device attribute and doing something to other devices. I wanted to have a few sensors, then I wanted to aggregate an information from the few sensors in a virtual device using a rule. Maybe I’m wrong in my thinking, let me know if there is a better way to do that, again in a “new” way using Rules API etc. I need it for better structuring of automation. I need to create a completely custom virtual device.
0 Comments
Leave a Reply. |