# Writing code

**URL:** <https://community.smartthings.com/t/writing-code/40388>\
**Category:** General Discussion\
**Tags:** developers\
**Created:** [February 25, 2016, 7:16pm UTC](https://community.smartthings.com/t/writing-code/40388 "2016-02-25T19:16:46Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![AvantiDiane](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/avantidiane/32/27395_2.png) [@AvantiDiane](https://community.smartthings.com/u/AvantiDiane)\
**Post date:** [February 25, 2016, 7:16pm UTC](https://community.smartthings.com/t/writing-code/40388/1 "2016-02-25T19:16:46Z")

</div>

Ok, I’ll admit I know ABSOLUTLY nothing about writing code but I am finding if I want to do anything other than extreme basic stuff, I’m going to have to learn.  
I have a SmartThing starter kit with more Things coming, Alexa, Harmony with remote coming, and IFTTT.  
I found the language ‘groovy’ here and wondering if this is the easiest/best way to learn/operate code?  
I very much appreciate any assistance in learning program that you could give as I think I do need to learn to really utilize all this $ spent.  
I’m running on iPad and iPhones, but do have a Windows desktop on the network.  
Ty, Diane

Sorry, but now I am seeing Apache in SmartThings and wondering if this will do what I want? (which is about everything) 🙂

---

<div class="post-metadata">

**Author:** ![schapper05](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@schapper05](https://community.smartthings.com/u/schapper05)\
**Post date:** [February 25, 2016, 7:39pm UTC](https://community.smartthings.com/t/writing-code/40388/2 "2016-02-25T19:39:28Z")

</div>

> [@AvantiDiane](#):
>
> anything other than extreme basic stuff

Not true, You will need to familiarize yourself with the [IDE](https://graph.api.smartthings.com/), but by no means do you need to learn to code.

> [@\[OBSOLETE\] FAQ: An Overview of Using Custom Code in SmartThings (SmartThings Classic, Groovy Code)](https://community.smartthings.com/t/faq-an-overview-of-using-custom-code-in-smartthings/16772):
>
> The original FAQ information in this thread refers to the original smartthings architecture, which was in place through the end of 2022 and a little beyond. Custom code was written in the groovy programming language and ran in the smartthings cloud. As of May 2023, you can no longer add new Groovy DTH‘s or smartapps to your smartthings account. So if you came here because of a link in an old forum thread, or on another site, I’m afraid the Groovy information is no longer usable. All of this was replaced by a new architecture. Cloud to cloud integrations use the smartthings API. Hub connected devices, mostly Zigbee and zwave, now use “Edge Drivers,” written in the LUA programming language. Here’s the official announcement on those: The process for using a custom Edge Driver in the new …

> [@Announcing ThingsThatAreSmart.wiki](https://community.smartthings.com/t/announcing-thingsthataresmart-wiki/25564):
>
> Hi everyone, Something has been bothering me for a while, and I’ve seen others comment on it as well… There is so much amazing content from the community on these forums, but in the forum format, it can be really hard to find the info that you’re looking for, and when you do find an answer, it’s impossible to know whether it is the latest and greatest info on the topic. To solve this problem, I’d like to announce the launch of [ThingsThatAreSmart.wiki][1], the unofficial SmartThings wiki! smiley [][1] We’ve setup this wiki to provide a place for the community to create content in wiki article format, that can be easily linked to, updated, and maintained by everyone. The initial set of categories includes: Officially supported devices Details we’ve learned about these dev…

> [@FAQ: Github Integration How to Add and Update from Repositories \[OBSOLETE\]](https://community.smartthings.com/t/faq-github-integration-how-to-add-and-update-from-repositories/39046):
>
> I couldn’t find a good/in-depth FAQ for a GitHub How to with ST so here goes: If you’re looking for uk integration: Please, I am by no means an Expert, If you find an error or see something that I should change let me know and I will update it. Log into the IDE @ [https://account.smartthings.com](https://account.smartthings.com) Enable and Link your GitHub Account: Section taken from Smartthings developer docs Step 1 - Enable GitHub Integration Click the Enable GitHub Integration link on the My SmartApps or My Device \>Types page. This will launch a wizard that will guide you through the process. [image] Step 2 - Connect your GitHub Account to SmartThings On Step 1 of the wizard, follow the instructions to authorize SmartThings to integrate \>with your GitHub account. Click the Next button after you have done t…

After perusing these topics Install Rule Machine:

> [@Rule machine - as per the app developer, this app is no longer available for new installs, distribution, or support](https://community.smartthings.com/t/release-rule-machine/28730):
>
> Rule Machine is no longer available.

> [@Rule Machine User Guide](https://community.smartthings.com/t/rule-machine-user-guide/40176):
>
> [image]Rule Machine Rule Machine User Guide [Rule Machine](https://community.smartthings.com/t/release-rule-machine/28730) is a powerful automating tool for SmartThings. The Rule Machine User Guide has four sections below: Conditions and Trigger Events Actions Expert Features: Custom Commands Restrictions Conditions and Trigger Events Rules and Triggers respond to events on the selected devices. In the case of a Rule, it evaluates its rule upon any event affecting its Conditions. In the case of a Trigger, it is fired whenever the selected event occurs. Devices with the following capabilities may be Conditions or Trigger Events: [with noted exceptions] Acceleration "active" or "inactive" Battery value Button [Only available as Trigger Event] "number": "pressed"or "held" Contact: "open" or "closed" Certain Time [Only…

If you want to take it into coding see [SmartThings Developer Docs](http://docs.smartthings.com/en/latest/)

---

<div class="post-metadata">

**Author:** ![AvantiDiane](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/avantidiane/32/27395_2.png) [@AvantiDiane](https://community.smartthings.com/u/AvantiDiane)\
**Post date:** [February 25, 2016, 8:46pm UTC](https://community.smartthings.com/t/writing-code/40388/3 "2016-02-25T20:46:54Z")

</div>

> [@schapper05](#):
>
> and

Cool. A place to start. Ty

---

<div class="post-metadata">

**Author:** ![obycode](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/obycode/32/12597_2.png) [@obycode](https://community.smartthings.com/u/obycode)\
**Post date:** [February 25, 2016, 8:57pm UTC](https://community.smartthings.com/t/writing-code/40388/4 "2016-02-25T20:57:51Z")

</div>

Another option is our iOS app, [SmartRules](http://smartrulesapp.com), which provides a very simple way to setup rules for your smart things.

 ![](https://global.discourse-cdn.com/smartthings/original/3X/b/9/b9384113ad2b7cd6db6ae43bd5021dbd4c5939aa.png)

---

<div class="post-metadata">

**Author:** ![kevintierney](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/kevintierney/32/95651_2.png) [@kevintierney](https://community.smartthings.com/u/kevintierney)\
**Post date:** [February 26, 2016, 1:36am UTC](https://community.smartthings.com/t/writing-code/40388/5 "2016-02-26T01:36:10Z")

</div>

For learning to code, one of the easiest ways to start is take a look at various examples here on the forums and on the GitHub site, look how they differ, try changing it slightly and see what happens. Over time, you’ll get more comfortable with it.

The docs at [http://docs.smartthings.com](http://docs.smartthings.com) are decent and has only been getting better.

Also check out @pstuart’s live code friday show. @ [http://livecodefridays.com](http://livecodefridays.com) . He goes through coding various things and has started a coding concepts part of the show. All of his old shows are also available on the youtube channel

---

<div class="post-metadata">

**Author:** ![AvantiDiane](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/avantidiane/32/27395_2.png) [@AvantiDiane](https://community.smartthings.com/u/AvantiDiane)\
**Post date:** [February 26, 2016, 5:23pm UTC](https://community.smartthings.com/t/writing-code/40388/6 "2016-02-26T17:23:38Z")

</div>

Thank you all for your answers.  
I am starting with Git hub and IDE and what they are/how to access and use.  
From there I’m thinking I will try to load the Rules Machine as this seems a more straight forward method for complex formulas that I could wrap my mind around. (A bit like basic algerbra)  
Also, been watching the past Friday podcasts, tho still a bit overwhelmed with his easy of tech talk that is beyond me at the moment. Will work on.  
Wish my Father was still here as he built his first computer in the 60’s the size of a dining room table and as heavy as a car. (Had to move it several times) He was a Mensa genius and I would have loved to have had his help now. Life.  
Well, I’m sure you will not have seen the last of me here so hello to all and thank you all in advance for answering all the elementary q’s you’ll probably be seeing from me.  
Ty, Diane

---

<div class="post-metadata">

**Author:** ![AvantiDiane](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/avantidiane/32/27395_2.png) [@AvantiDiane](https://community.smartthings.com/u/AvantiDiane)\
**Post date:** [March 2, 2016, 10:18pm UTC](https://community.smartthings.com/t/writing-code/40388/7 "2016-03-02T22:18:44Z")

</div>

Ok, I’m not too bright with this apparently.  
I am assuming ide means the smartthings app. I installed bravenel as a repository integration to gethub and saved.  
\*Now it says in instructions to go to settings, see two apps, copy and publish.  
I lost it at \*. I am not seeing any apps anywhere on ST. I see the code if I go to gethub but not sure how to get it into my ST.

---

<div class="post-metadata">

**Author:** ![schapper05](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@schapper05](https://community.smartthings.com/u/schapper05)\
**Post date:** [March 2, 2016, 10:54pm UTC](https://community.smartthings.com/t/writing-code/40388/8 "2016-03-02T22:54:56Z")

</div>

> [@AvantiDiane](#):
>
> I lost it at \*. I am not seeing any apps anywhere on ST. I see the code if I go to gethub but not sure how to get it into my ST.

In the IDE on the my smartapps tab do you show these two apps installed: bravenel : Rule & bravenel : Rule Machine or not?

---

<div class="post-metadata">

**Author:** ![AvantiDiane](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/avantidiane/32/27395_2.png) [@AvantiDiane](https://community.smartthings.com/u/AvantiDiane)\
**Post date:** [March 3, 2016, 1:58pm UTC](https://community.smartthings.com/t/writing-code/40388/9 "2016-03-03T13:58:09Z")

</div>

I can go into ST apps ‘update from Repo’ and see bravenel added but I don’t see the apps listed below that.

---

<div class="post-metadata">

**Author:** ![schapper05](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@schapper05](https://community.smartthings.com/u/schapper05)\
**Post date:** [March 3, 2016, 2:00pm UTC](https://community.smartthings.com/t/writing-code/40388/10 "2016-03-03T14:00:23Z")

</div>

> [@AvantiDiane](#):
>
> I can go into ST apps ‘update from Repo’ and see it but I do to see the apps listed below that.

Are they listed on the Left side or the very right side?

---

<div class="post-metadata">

**Author:** ![AvantiDiane](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/avantidiane/32/27395_2.png) [@AvantiDiane](https://community.smartthings.com/u/AvantiDiane)\
**Post date:** [March 3, 2016, 2:02pm UTC](https://community.smartthings.com/t/writing-code/40388/11 "2016-03-03T14:02:52Z")

</div>

Sorry had to update my post to say I Don’t see the apps.

---

<div class="post-metadata">

**Author:** ![schapper05](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@schapper05](https://community.smartthings.com/u/schapper05)\
**Post date:** [March 3, 2016, 2:08pm UTC](https://community.smartthings.com/t/writing-code/40388/12 "2016-03-03T14:08:50Z")

</div>

> [@AvantiDiane](#):
>
> Sorry had to update my post to say I Don’t see the apps.

Under Update from repo it should say: “Rule-Trigger (Master)” Do you see that? or Bravenel?

---

<div class="post-metadata">

**Author:** ![AvantiDiane](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/avantidiane/32/27395_2.png) [@AvantiDiane](https://community.smartthings.com/u/AvantiDiane)\
**Post date:** [March 3, 2016, 2:51pm UTC](https://community.smartthings.com/t/writing-code/40388/13 "2016-03-03T14:51:18Z")

</div>

I see:  
SmartThingsPublic (master)  
Rule-Trigger (master)

---

<div class="post-metadata">

**Author:** ![schapper05](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@schapper05](https://community.smartthings.com/u/schapper05)\
**Post date:** [March 3, 2016, 3:04pm UTC](https://community.smartthings.com/t/writing-code/40388/14 "2016-03-03T15:04:13Z")

</div>

And when you click on rule trigger master is there anything in the left column, or is there more than 2 things in the right column

---

<div class="post-metadata">

**Author:** ![AvantiDiane](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/avantidiane/32/27395_2.png) [@AvantiDiane](https://community.smartthings.com/u/AvantiDiane)\
**Post date:** [March 3, 2016, 3:10pm UTC](https://community.smartthings.com/t/writing-code/40388/15 "2016-03-03T15:10:06Z")

</div>

Bottom left under New ( only in gethub)  
smartapps/bravenel/RuleMachine.png  
/bravenel/RuleMachine@2x.png  
smartapps/bravenel/rule-machine.src/rule-machine.groovy  
smartapps/bravenel/rule.src/rule.groovy

I checked all 4 boxes publish, execute and get error message -

Error  
500: Internal Server Error  
URI  
/ide/app/doRepoUpdates  
Reference Id  
251e4b10-e72f-4617-935a-3f10cb7d9ec8  
Date  
Thu Mar 03 15:09:20 UTC 2016

---

<div class="post-metadata">

**Author:** ![schapper05](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@schapper05](https://community.smartthings.com/u/schapper05)\
**Post date:** [March 3, 2016, 3:11pm UTC](https://community.smartthings.com/t/writing-code/40388/16 "2016-03-03T15:11:44Z")

</div>

The error is because you checked the .png files(those are pictures)

Did you check the Publish for me box before selecting done?

I go through this in a step by step pictorial faq here:

> [@FAQ: Github Integration How to Add and Update from Repositories \[OBSOLETE\]](https://community.smartthings.com/t/faq-github-integration-how-to-add-and-update-from-repositories/39046):
>
> I couldn’t find a good/in-depth FAQ for a GitHub How to with ST so here goes: If you’re looking for uk integration: Please, I am by no means an Expert, If you find an error or see something that I should change let me know and I will update it. Log into the IDE @ [https://account.smartthings.com](https://account.smartthings.com) Enable and Link your GitHub Account: Section taken from Smartthings developer docs Step 1 - Enable GitHub Integration Click the Enable GitHub Integration link on the My SmartApps or My Device \>Types page. This will launch a wizard that will guide you through the process. [image] Step 2 - Connect your GitHub Account to SmartThings On Step 1 of the wizard, follow the instructions to authorize SmartThings to integrate \>with your GitHub account. Click the Next button after you have done t…

---

<div class="post-metadata">

**Author:** ![AvantiDiane](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/avantidiane/32/27395_2.png) [@AvantiDiane](https://community.smartthings.com/u/AvantiDiane)\
**Post date:** [March 3, 2016, 3:16pm UTC](https://community.smartthings.com/t/writing-code/40388/17 "2016-03-03T15:16:05Z")

</div>

Genius. Checked only ones without png (don’t see done) and now getting the two programs showing published. Yea.  
Namespace / Name GitHub Repository Status Category OAuth Locations  
bravenel : Rule bravenel/Rule-Trigger (master) Published Convenience   
bravenel : Rule Machine bravenel/Rule-Trigger (master) Published My Apps Showing 1 to 2 of 2 entries

Anything else to do?

---

<div class="post-metadata">

**Author:** ![AvantiDiane](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/avantidiane/32/27395_2.png) [@AvantiDiane](https://community.smartthings.com/u/AvantiDiane)\
**Post date:** [March 3, 2016, 3:19pm UTC](https://community.smartthings.com/t/writing-code/40388/18 "2016-03-03T15:19:04Z")

</div>

See now I need to update and ready. Thank you so much Jason.

---

<div class="post-metadata">

**Author:** ![schapper05](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@schapper05](https://community.smartthings.com/u/schapper05)\
**Post date:** [March 3, 2016, 3:38pm UTC](https://community.smartthings.com/t/writing-code/40388/19 "2016-03-03T15:38:15Z")

</div>

> [@AvantiDiane](#):
>
> Anything else to do?

If you haven’t done it already you should be able to go to the mobile app now and add new smartapp.

In the my apps section you should now see rule machine.

---

<div class="post-metadata">

**Author:** ![AvantiDiane](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/avantidiane/32/27395_2.png) [@AvantiDiane](https://community.smartthings.com/u/AvantiDiane)\
**Post date:** [March 3, 2016, 3:49pm UTC](https://community.smartthings.com/t/writing-code/40388/20 "2016-03-03T15:49:23Z")

</div>

Actually no. I see:  
From Form  
From Code  
From Template

[Next page](https://community.smartthings.com/t/writing-code/40388.md?page=2)
