[OBSOLETE] GroveStreams SmartThings QuickStart

Just to confirm - changing to a new GS smartApp worked fine for me, i.e. old streams in GS itself were not affected and it just added the new component/stream as I had wanted.

I think I went through the guide ok but I get no components showing, I am in the UK if that causes any problems.
Any idea what I can check to get this working?

well just typical, there are components now, hours after I set it all up :slight_smile:

yvesracine,

Thank you for posting this. I have been modifying the existing code to collect all of this data and doing it rouge. I’m glad I did as it forced me to learn about what’s going on behind the scenes. I ran into a wall when trying to figure out how to pass the enum variables. So I broke down and searched this post for ecobee support… appreciate the work :+1:

Nick

Thanks for putting this together!

Hi @Nsiegfried,

Please note that the groveStream’s ecobee support is done with My Ecobee device which is the most comprehensive ecobee integration with SmartThings.

Regards.

I have everything setup using your code at the bottom of the tutorial. I seem to be using a lot of data. I have only bee using it about a week and im very close to the 5MB monthly allowance. Any guidance on how to slow this down ?

Dear all

I have reached my maximum 5 mb of data in Grovestream. I have a lot of sensors that report different types of data. One sensor (power plug) reports data every 5-10 seconds.

I have read the entire thread but have not been able to find any solution to reduce my data usage - maybe someine in here could help me?

My grovestreams setup is as follows:

/**
 * SmartThings example Code for GroveStreams
 * A full "how to" guide for this example can be found at
 *   https://www.grovestreams.com/developers/getting_started_smartthings.html
 *
 * Copyright 2015 Jason Steele
 *
 * 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: "GroveStreams",
                namespace: "JasonBSteele",
                author: "Jason Steele",
                description: "Log to GroveStreams",
                category: "My Apps",
                iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
                iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png",
                iconX3Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png")
 
preferences {
 
        section("Log devices...") {
                input "temperatures", "capability.temperatureMeasurement", title: "Temperatures", required:false, multiple: true
                input "illuminance", "capability.illuminanceMeasurement", title: "Illuminance", required:false, multiple: true
                input "ultravioletIndex", "capability.ultravioletIndex", title: "ultravioletindex", required:false, multiple: true
                input "humidities", "capability.relativeHumidityMeasurement", title: "Humidities", required: false, multiple: true
                input "contacts", "capability.contactSensor", title: "Doors open/close", required: false, multiple: true
                input "accelerations", "capability.accelerationSensor", title: "Accelerations", required: false, multiple: true
                input "motions", "capability.motionSensor", title: "Motions", required: false, multiple: true
                input "presence", "capability.presenceSensor", title: "Presence", required: false, multiple: true
                input "switches", "capability.switch", title: "Switches", required: false, multiple: true
                input "waterSensors", "capability.waterSensor", title: "Water sensors", required: false, multiple: true
                input "batteries", "capability.battery", title: "Batteries", required:false, multiple: true
                input "powers", "capability.powerMeter", title: "Power Meters", required:false, multiple: true
                input "energies", "capability.energyMeter", title: "Energy Meters", required:false, multiple: true
        }
 
        section ("GroveStreams Feed PUT API key...") {
                input "apiKey", "text", title: "API key"
        }
}
 
def installed() {
        initialize()
}
 
def updated() {
        unsubscribe()
        initialize()
}
 
def initialize() {
 
        subscribe(temperatures, "temperature", handleTemperatureEvent)
        subscribe(illuminance, "illuminance", handleIlluminanceEvent)
        subscribe(ultravioletIndex, "ultravioletIndex", handleultravioletIndexEvent)
		subscribe(waterSensors, "water", handleWaterEvent)
        subscribe(humidities, "humidity", handleHumidityEvent)
        subscribe(contacts, "contact", handleContactEvent)
        subscribe(accelerations, "acceleration", handleAccelerationEvent)
        subscribe(motions, "motion", handleMotionEvent)
        subscribe(presence, "presence", handlePresenceEvent)
        subscribe(switches, "switch", handleSwitchEvent)
        subscribe(batteries, "battery", handleBatteryEvent)
        subscribe(powers, "power", handlePowerEvent)
        subscribe(energies, "energy", handleEnergyEvent)
}
 
def handleTemperatureEvent(evt) {
        sendValue(evt) { it.toString() }
}
 
def handleIlluminanceEvent(evt) {
		sendValue(evt) { it.toString() }
}

def handleultravioletIndexEvent(evt) {
		sendValue(evt) { it.toString() }
}

def handleWaterEvent(evt) {
        sendValue(evt) { it == "wet" ? "true" : "false" }
}
 
def handleHumidityEvent(evt) {
        sendValue(evt) { it.toString() }
}
 
def handleContactEvent(evt) {
        sendValue(evt) { it == "open" ? "true" : "false" }
}
 
def handleAccelerationEvent(evt) {
        sendValue(evt) { it == "active" ? "true" : "false" }
}
 
def handleMotionEvent(evt) {
        sendValue(evt) { it == "active" ? "true" : "false" }
}
 
def handlePresenceEvent(evt) {
        sendValue(evt) { it == "present" ? "true" : "false" }
}
 
def handleSwitchEvent(evt) {
        sendValue(evt) { it == "on" ? "true" : "false" }
}
 
def handleBatteryEvent(evt) {
        sendValue(evt) { it.toString() }
}
 
def handlePowerEvent(evt) {
        sendValue(evt) { it.toString() }
}
 
def handleEnergyEvent(evt) {
        sendValue(evt) { it.toString() }
}
 
private sendValue(evt, Closure convert) {
        def compId = URLEncoder.encode(evt.displayName.trim())
        def streamId = evt.name
        def value = convert(evt.value)
       
        log.debug "Logging to GroveStreams ${compId}, ${streamId} = ${value}"
 
        def url = "https://grovestreams.com/api/feed?api_key=${apiKey}&compId=${compId}&${streamId}=${value}"
 
        //Make the actual device the origin of the message to avoid exceeding 12 calls within 2 minutes rule:
        //http://forum.grovestreams.com/topic/155/10-second-feed-put-limit-algorithm-change/
        def header = ["X-Forwarded-For": evt.deviceId]
 
        def putParams = [
                uri: url,
                header: header,
                body: []]
 
        httpPut(putParams) { response ->
                if (response.status != 200 ) {
                        log.debug "GroveStreams logging failed, status = ${response.status}"
                }
 
        }
 
}

you would have to switch to a device handler that doesn’t report so often. The Centralite plug is crazy-noisy at default. Maybe there is a custom handler for it.

I found it easier to use a different physical device with better defaults, or use custom DH with customizable report rates, e.g. Zooz Zen15.

1 Like