A web service SmartApp: public approval or what?

smartapp
webservices
publication

(Nicola Russo) #1

Hi everyone!

I’ve developed a web service SmartApp in order to implement ST (hub and devices) in the platform we developed:
Gideon Smart Home (gideon.ai). As we know the user have to install this app through ST app, and at the same time,
we know the “biblical times” we have to wait for ST approval (due to the number of app that ask for the
pubblication :slight_smile: ), I have a pending request opened from 7 months.

I’m looking for alternative solution but seems that the only way is to ask to the user to create a new smartapp and
copy and paste the source code on his profile (“My SmartApps”) and then “publish for himself” the app.

Anyway, every time we want to extend the support to a device, every user need to update the source code of the relative
Smartapp, it’s a mess…

Any alternative solutions?


SmartApp code update
(Greg) #2

You could get the URL of your SmartApp from within the SmartApp, pass this to Gideon, and then use that to call the SmartApp.

Alternatively, @jody.albritton, can you help? 7 months seems a bit…long?

EDIT: Gideon is awesome btw.
If anyone else wants to know more: https://play.google.com/store/apps/details?id=mobile.alfred.com.alfredmobile


(Mark Whipp) #3

This is how most of the community SmartApps are handled using GitHub. We are used to it and they can be semi-auto updated through the ST GitHub Repository Integration.

Not sure if it would work with your app requirements, just a suggestion. BTW- your app looks very well polished, good luck!


(Jody) #4

If it’s just a web service smartapp, we might be able to get it reviewed. Adding @slagle


(Tim Slagle) #5

We are evaluating all apps submitted now, we hope to have responses to everyone soon based on the evaluation.


(Ingmichelegalli) #6

Hey guys,
I work in Gideon too.
Thanks for the replies,we will add the code of the smartapp asap.
it is a simple web service to let Gideon communicate with the SmartThings devices.
We are also aware that SmartThings have an unbeatable compatibility, but what our users love from us is the overall user experience they have in Gideon and i promise they would die to have the ST products in Gideon.
We also try to give a seamless experience across all the devices and with Github the problem is that not every user is a tech addicted or a developer, most of our users would not have a GitHub account ( they would not even know what GitHub is :smile: ) but probably would be easier than creating a smartapp with our code every time we do some changes.
The best solution would be an endpoint in the SmartThings cloud we can call to control the devices, check the devices status and maybe a few webhooks for the alarms.
With the smartapp we can simulate this kind of endpoint.
Having access to a ST endpoint or at least have the smartapp approved would be hundreds of times more efficient and easier for us and would result in a great UX for the SmartThings users in Gideon
:slight_smile:


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #7

Join the club. :pensive:

Sincerely,
SmartTiles.


(Kevin [Yorkshire UK]) #8

Only in the US - despite every effort to get ST to fix this in the UK we still don’t have this functionality :frowning:


(Nicola Russo) #9

Thank you all guys! The app is very simple, I’ve followed the official tutorial:

`/**

  • Gideon
  • Copyright 2016 Nicola Russo
  • Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at:
  •  http://www.apache.org/licenses/LICENSE-2.0
    
  • Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
  • on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
  • for the specific language governing permissions and limitations under the License.

*/
definition(
name: “Gideon”,
namespace: “gideon.api”,
author: “Braindrain Solutions”,
description: “Gideon AI Smart app allows you to connect and control all of your SmartThings devices through the Gideon AI app, making your SmartThings devices even smarter.”,
category: “Family”,
iconUrl: “http://s33.postimg.org/t77u7y7v3/logo.png”,
iconX2Url: “http://s33.postimg.org/t77u7y7v3/logo.png”,
iconX3Url: “http://s33.postimg.org/t77u7y7v3/logo.png”,
oauth: [displayName: “Gideon AI API”, displayLink: “gideon.ai”])

preferences {
section(“Control these switches…”) {
input “switches”, “capability.switch”, multiple:true
}
section(“Control these motion sensors…”) {
input “motions”, “capability.motionSensor”, multiple:true
}
section(“Control these presence sensors…”) {
input “presence_sensors”, “capability.presenceSensor”, multiple:true
}
section(“Control these outlets…”) {
input “outlets”, “capability.switch”, multiple:true
}
section(“Control these locks…”) {
input “locks”, “capability.lock”, multiple:true
}
section(“Control these locks…”) {
input “temperature_sensors”, “capability.temperatureMeasurement”
}
}

def installed() {
log.debug “Installed with settings: ${settings}”

initialize()

}

def updated() {
log.debug “Updated with settings: ${settings}”

unsubscribe()
initialize()

}

def initialize() {
// TODO: subscribe to attributes, devices, locations, etc.
subscribe(outlet, “energy”, outletHandler)
subscribe(outlet, “switch”, outletHandler)
}

// TODO: implement event handlers
def outletHandler(evt) {
log.debug “$outlet.currentEnergy”
//TODO call G API
}

private device(it, type) {
it ? [id: it.id, label: it.label, type: type] : null
}

//API Mapping
mappings {
path("/getalldevices") {
action: [
GET: “getAllDevices”
]
}
path("/doorlocks/:id/:command") {
action: [
GET: “updateDoorLock”
]
}
path("/doorlocks/:id") {
action: [
GET: “getDoorLockStatus”
]
}
path("/tempsensors/:id") {
action: [
GET: “getTempSensorsStatus”
]
}
path("/presences/:id") {
action: [
GET: “getPresenceStatus”
]
}
path("/motions/:id") {
action: [
GET: “getMotionStatus”
]
}
path("/outlets/:id") {
action: [
GET: “getOutletStatus”
]
}
path("/outlets/:id/:command") {
action: [
GET: “updateOutlet”
]
}
path("/switches/:command") {
action: [
PUT: “updateSwitch”
]
}
}

//API Methods
def getAllDevices() {
def locks_list = locks.collect{device(it,“Lock”)}
def presences_list = presence_sensors.collect{device(it,“Presence”)}
def motions_list = motions.collect{device(it,“Motion”)}
def outlets_list = outlets.collect{device(it,“Outlet”)}
def switches_list = switches.collect{device(it,“Switch”)}
def temp_list = temperature_sensors.collect{device(it,“Temperature”)}
return [Locks: locks_list, Presences: presences_list, Motions: motions_list, Outlets: outlets_list, Switches: switches_list, Temperatures: temp_list]
}

//LOCKS
def getDoorLockStatus() {
def device = locks.find { it.id == params.id }
if (!device) {
httpError(404, “Device not found”)
} else {
return [Device_state: device.currentValue(‘lock’)]
}
}

def updateDoorLock() {
def command = params.command
def device = locks.find { it.id == params.id }
if (command){
if (!device) {
httpError(404, “Device not found”)
} else {
if(command == “toggle”)
{
if(device.currentValue(‘lock’) == “locked”)
device.unlock();
else
device.lock();

            return [Device_id: params.id, result_action: "200"]
        }
    }
}

}

//PRESENCE
def getPresenceStatus() {

def device = presence_sensors.find { it.id == params.id }
if (!device) {
        httpError(404, "Device not found")
    } else {
    	return [Device_state: device.currentValue('presence')]

}
}

//MOTION
def getMotionStatus() {

def device = motions.find { it.id == params.id }
if (!device) {
        httpError(404, "Device not found")
    } else {
    	return [Device_state: device.currentValue('motion')]

}
}

//OUTLET
def getOutletStatus() {

def device = outlets.find { it.id == params.id }
if (!device) {
        httpError(404, "Device not found")
    } else {
    	return [Device_state: device.currentSwitch, Current_watt: device.currentValue("energy")]

}
}

def updateOutlet() {

def command = params.command
def device = outlets.find { it.id == params.id }
if (command){
    if (!device) {
        httpError(404, "Device not found")
    } else {
        if(command == "toggle")
        {
            if(device.currentSwitch == "on")
              device.off();
            else
              device.on();
              
            return [Device_id: params.id, result_action: "200"]
        }
    }
}

}

//SWITCH
def updateSwitch() {
def command = params.command
def device = switches.find { it.id == params.id }
if (command){
if (!device) {
httpError(404, “Device not found”)
} else {
if(command == “toggle”)
{
if(device.currentSwitch == “on”)
device.off();
else
device.on();

            return [Device_id: params.id, result_action: "200"]
        }
    }
}

}

//TEMPERATURE
def getTempSensorsStatus() {

def device = temperature_sensors.find { it.id == params.id }
if (!device) {
        httpError(404, "Device not found")
    } else {
    	return [Device_state: device.currentValue('temperature')]

}
}


(Nicola Russo) #10

Do you think this kind of app can be refused?


(Marc) #11

I just checked out Gideon (didn’t install the ST smart app yet). Looks cool and I really like the timeline and energy/temperature consumption features. Currently, I am using Yonomi and IFTTT to compliment Smartthings, and I am not sure I have a real use for Gideon right now. Ultimately, all off the ST automations will still rely on the ST cloud. If Gideon can include other integrations eventually, I might be able to use it for something already. Could be useful for someone who doesn’t want to mess with CoRE and wants a more GUI friendly rule builder.

I noticed a few issues:

  1. I noticed a bug in the iOS app as I set my temperature preference to F, but in my timeline, it’s still reporting C.

  2. When I tried to connect my Hue account, my Bloom didn’t show, only my light strips. In the native Hue app, all show up fine.

  3. On your site, it says you have Sonos compatiablity, but in the app, I don’t see an option to add.


(Ingmichelegalli) #12

Thank you :slight_smile:

  1. the bloom light wasn’t compatible yet because every type of hue light has a different ID and Philips never revealed the complete list of ids.
    if you can send me the username or email you used to sign in Gideon, i would be able to check the bloom type id and add the compatibility in Gideon.
  2. this is not a bug but more a improvement we can do (again, Thank you)
  3. the android version has Sonos while in the ios app we had to temporary remove it to do some new tests, we will add it again in the next updates on ios

(Marc) #13

Thanks. Sonos on Yonomi is a little flakey, so I’d love to give that a shot. I strongly encourage integration with the Echo :slight_smile:


(Ingmichelegalli) #14

Yes i agree having echo would be great.
We are evaluating the best way to implement it.
There are tons of devices we want to add in the next months but for now we are focusing on what the users ask and we received hundreds of emails in the past weeks asking for ST :smile: so we want to put all the effort on this now


(Ingmichelegalli) #15

Hi i was taking a look at SmartTiles and i went through the installation process.
How do you add the smartapp automatically on the SmartThings app, after the user log in their SmartThings account?
Because if we can do that we don’t need to have approved our SmartApp, or am i wrong?
How do you keep updated the smartapp?

Thanks :slight_smile:


(Greg) #16

This is one for the ST developers to answer, hope this might make everyone’s life a bit easier.

Would it not be possible to provide a standard endpoint which allows users to get device informant send device commands, ith the ability to code your own information in.

There seem to be loads of apps that require exactly the same information - I can think of Gideon and SmartThings right off the bat.

You’d simply just need a standard built in endpoint that Web apps can call, and the user can get an api key from their account.

Easy


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #17

That’s the normal result of an “OAuth” SmartApp that is approved by the user via the OAuth install flow.

SmartTiles is an submitted, approved and published SmartApp. It just doesn’t appear in the SmartThings App’s “Marketplace”.

We’re like IFTTT or Amazon Alexa SmartApps.


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #18

Yes, it’s possible, but like many things, this has been a “feature request” submitted to SmartThings by many people over and over for 3+ years.

It may eventually be something they provide, but, really, there are still enough consumer-facing issues that have priority (eg, hub migration tool?).

The OAuth Endpoint SmartApp is a sufficient and effective workaround, unlike the consumer-facing issues (bugs and features) that don’t have workarounds.


(Ingmichelegalli) #19

ok thanks for the reply
i was asking because i didn’t see smarttiles on the marketplace


(Ingmichelegalli) #20

i can understand they have different priorities but it sounds so weird that a developer-oriented company like SmartThings doesn’t have conventional REST apis…
but i agree with you that the OAuth Endpoint Smartapp is a good workaround to get the problem sorted…
the only dilemma is that it seems almost impossible to get the approval :confused:
if this is going to change in the next days/weeks it would solve most of the problems.

As SmartTiles we don’t need the app in the marketplace but we need it approved for the OAuth