Scheduler and Polling quits after some minutes, hours, or days

Awesome. (I know the connection to the Hue Bridge is WiFi, but the bulbs are zigbee. :wink:)

1 Like

True. When I said “I don’t own any Zigbee stuff”, I meant “no Zigbee stuff connected to ST hub” :smile:

1 Like

For several weeks (or so) events to my devices miss, and sometimes after few days schedules stop in applications and have to “restart”/update to start again (not running more then 3 jobs per application).

For example if telling siren to turn off through application or even iphone app does not turn off nor shows in online logging. Sometimes (most often lately) does not get the event and stays on, which is same thing with motion events. Seems information not being sent up to the cloud or cloud is to busy to accept.

Is the cloud just that busy? Do we have a way to monitor it (not just see logging)? I have high hopes V2 fixes a lot of these problems. I never get a notice saying my Hub is offline and since I am live monitoring logging other events and actions keep happening, so do not think is connection issue on my end.

Note my internet is not super fast (live rural), but is 2Mbps with dual load balancer local provider and with phone carrier. Maybe switching carriers with load balancer is messing it up?

So I guess I just looking for thoughts?

1 Like

We already have a lengthy open thread on this. Feel free to read up here and let support know you are being affected too. support@smartthings.com
Scheduler and Polling quits after some minutes, hours, or days

@April can we merge theres 2 threads pls :smile:

2 Likes

Ok I cannot do anything on my end that I am aware of to handle events being missed, motion, alarm, contact, what have you. Unless the firmware on hub end gets updated to know when and retry if it did not send event to cloud say within ~1 minute else forget (to much time has past).

However, for apps halting I ended up following strategy of using a “heartbeat” event and took the closest one of being mode change event. On mode change will call “update()” and restart application, which still keeps state variable if needed. Note if have application that cares about mode change, have it restart/reset on all modes but the one you care about.

An overall daily or 12hr heart beat event across the cloud would be nice to follow this strategy…

1 Like

I have five zxt-120 IR sending thermostats in my home and they all fail to get polled. I also have two Aeon Power Monitors with the same issue.

I contacted support months back and they said they knew polling was not working all the time but had no resolution.

One way to solve this is to add a scheduled event to your device. This is actually what the pollster smart app does and then calls your devices poll command. The problem with this is that this too is broken in Smart Things. It is a known issue that timed events sometimes get missed and once they are missed the next event is never scheduled. So unless you open the device and re-configure your schedule it stops working.

So I have used both pollster and scheduled events for my devices. That works but randomly stops working. So I can’t rely on polling.

But here is the part that I don’t understand. Why doesn’t every one scream about this issue ? What good are z-wave sensors that fail to report because polling is not working ?

Some newer devices like my Fibaro Motion Sensor which has temperature and other sensors actually post their data so there is no need for polling and they work well. But my older model Aeon Power Monitor and my zxt-120 devices all need polling and are therefor useless with ST if you care about reliability.

So my bottom line question is doesn’t anyone else care that polling is broken and scheduled events are unreliable ?

2 Likes

@april Might as well merge these as well

and

and

and

I am sure there are more but it has still never been resolved by support.

I started a new thread in the hopes that we could get rid of the noise and just have support realize these two issue exist and should really be addressed.

Also this merge lost the fact that I was addressing Polling AND Scheduling, not just scheduling.

Don’t feel like this belongs in Devices & integration category but don’t see any categories good for asking about issues with ST. Anyway I have to zxt-120 ir sender’s which act like thermostats and report temp. The polling which was working fine up until Tuesday 2.24.15 isn’t working correctly anymore. One device was last polled 26 hours ago and the other was polled 6 hours ago.

Is anyone else having issues with polling ?

Not polling, specifically, but for the last week many different community members have been reporting new problems with actions never occurring, from sunset triggers to simple motion detector switches. (I’ve had problems with both.) The requests get sent to the hub, but never come back from the cloud.

http://status.smartthings.com

Sounds like you might have run into the same thing, just with a different command.

Report it to support and see what they say.

FWIW.

1 Like

Strange, one of my devices has not had activity since Thursday (today is Saturday)
The other has activity all day yesterday so the polling was working fine yesterday. Today nothing again.

I think polling doesn’t work !

I submitted ticket to support. I had a reply that they wanted to run a network repair. I replied that they could but I never heard back. No idea if they tried that and no idea if any progress has been made on their side.

Yes, that’s why Pollster is there to help.

I wonder why ST support doesn’t know that polling doesn’t work. When I submitted support request they are asking to repair my network and asked if my devices are possibly out of range. My devices are 10ft from hub and they work fine for manual refresh and any actions like AC on AC Off etc. So I know the zwave signals are fine.

It never worked reliably. Support just has no clue. See this

… and this

… and this

I have created a custom Device Type and specified the capability “Polling”. Also wrote a poll() method. But the problem is that it is never called. When I manually refresh, it is working and the value is updating. I checked the log also and nothing is there, if I manually refresh the log is coming.

I saw couple of posting regarding this here but no concrete answer is given, could some help me to figure out the issue?

I’ve run into issues with polling, as well. See this tread, for example. Others have reported problems, as well.

As a work around, try to generate an event (sendEvent) inside your poll method, every time the method is called. It’s important to do that even though no state has changed. Does that make sense? Give it a shot and let us know if it helps.

Thanks @florianz for the help!.

I am using two sendEvent to update the Temperature and Humidity, but still not getting called, is this what you mean or I am something here?

Yeah, that’s what I meant. The only caveat is that you really have to send the event, even if the temperature or humidity values did not really change from when you polled the last time.

As an experiment, can you create a dummy timestamp attribute, which you simple update to the current time by sending an event on every invocation of the poll method. That way the attribute value is guaranteed to change every time. If that works, we can go from there.

Also, make sure that you are not running your device handler in the simulator. poll will not be invoked if any instance of your device type handler is running in the simulator. Make sure to terminate all open simulator sessions, by clicking the ‘X’ in the ‘Sessions’ column under ‘My Device Types’ in the IDE.

Also looping in @urman, because he has helped me with this in the past.

Thanks @florianz!, let me try and update it here.

@florianz, I tried but not working, I am posting my code here, basically I am trying to get Temperature and Humidity from my Spark Core. Could you please check and advice?

/**
 *  Spark Core Temperature & Humidity Sensor
 *
 *  Copyright 2014 Krishnaraj Varma
 *	
 *	INSTALLATION
 *	------------
 *
 *  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.
 *
 */
 
preferences {
    input("deviceId", "text", title: "Device ID")
    input("token", "text", title: "Access Token")
}

metadata {
	definition (name: "Spark Core Temperature Sensor", namespace: "krvarma/sparktemperature", author: "Krishnaraj Varma") {
		capability "Polling"
		capability "Temperature Measurement"
        capability "Relative Humidity Measurement"
        capability "Sensor"
	}

	simulator {
		
	}

	tiles {
		valueTile("temperature", "device.temperature", width: 2, height: 2){
            state "temperature", label: '${currentValue}°C', unit:"",
            	backgroundColors: [
                    [value: 25, color: "#202040"],
                    [value: 30, color: "#202080"]
                ]
		}
        
        valueTile("humidity", "device.humidity", width: 2, height: 2){
            state "humidity", label: '${currentValue}%', unit:"",
            	backgroundColors: [
                    [value: 50, color: "#202040"],
                    [value: 80, color: "#202080"]
                ]
		}
        
        standardTile("refresh", "device.temperature", inactiveLabel: false, decoration: "flat") {
            state "pollsensors", action:"polling.poll", icon:"st.secondary.refresh"
        }
        
		standardTile("timestamp", "device.timestamp", inactiveLabel: false, decoration: "flat") {
            state "default", action:"polling.poll", icon:""
        }
        
        main "temperature"
		details(["temperature", "humidity", "refresh"])
	}
}

// handle commands
def poll() {
	log.debug "Executing 'poll'"
    
    getTemperature()
}

// Get the temperature & humidity
private getTemperature() {
    //Spark Core API Call
    def temperatureClosure = { response ->
	  	log.debug "Temeprature Request was successful, $response.data"
      
      	sendEvent(name: "temperature", value: response.data.return_value)
	}
    
    def temperatureParams = [
  		uri: "https://api.spark.io/v1/devices/${deviceId}/getTemp",
        body: [access_token: token],  
        success: temperatureClosure
	]

	httpPost(temperatureParams)
    
    def humidityClosure = { response ->
	  	log.debug "Humidity Request was successful, $response.data"
      
      	sendEvent(name: "humidity", value: response.data.return_value)
        sendEvent(name: "timestamp", value: response.data.published_at)
	}
    
    def humidityParams = [
  		uri: "https://api.spark.io/v1/devices/${deviceId}/getHum",
        body: [access_token: token],  
        success: humidityClosure
	]

	httpPost(humidityParams)
}

Sorry @krvarma, I am totally out of ideas. Your device handler looks great. I don’t see why the polling should not work, other than due to the known brokenness surrounding that feature.

If you are frustrated and willing to implement a total hack to get you unstuck: You can write a very simple ‘Scheduler’ SmartApp, which takes a list of devices with polling capability and simply calls the poll method on those devices from within a cron scheduler callback, say every 10 or 15 minutes.

I am hoping that you won’t have to go there, and that @urman will be able to shed some light on how to work around the existing polling bugs.

1 Like