Having a problem with Picos, where to start troubleshooting?

I have Picos all over the house to control my Hue bulbs. It was either when I installed 1.1.7 or when I installed the IP2IR telnet driver, that I started noticing large delays with the Picos. I have an app that sets the Hue bulbs to different color temperatures depending on how many times the Pico "on" button is pressed, used to be I could press 3 times quickly and the lights would immediately change, now sometimes I'm seeing as much as 10 seconds of delay, or even nothing happening.

I am not sure where is the best place to start to debug this. The Picos interface with the Lutron hub and then Hubitat passes the event on to my app which then tells Hubitat to set the color and then Hubitat has to interface with the Hue hub, so lots of areas where there could be a problem. Also if this is somehow telnet related, I have no idea where to look.

Have you tried the simple experiment of disconnecting the IP2IR telnet driver? It would be the most logical place for something to be messing up the Lutron telnet connection. There were no changes to Lutron devices or integration in 1.1.7 --> rule that cause out.

1 Like

Was hoping not to have to do that, as I have a bunch of apps & children that rely on it. Will they have to be recreated if I remove the driver?

Don't remove the driver. Disable it's telnet connection somehow. It's just a test.

OK I see, I can comment out the connect code. Thank you, I will try that when I get home tonight!

The bigger question will be, if that clears up your Pico problem, how do we resolve what's happening with telnet.

Yes, that would be a big can of worms...but I will do whatever I can to help if it goes that way! Will post the results of my test here.

Well, commenting out the telnetConnect did not make a difference. I copied log entries for all the devices involved and will go through and see if I can tell where the delay might be occurring.

But, the hub was locked up when I got home. I pulled the plug and after it restarted, took a look at the logs. I saw these errors throughout, this is a screen dump for Lutron Telnet, but it happened for other devices too:

Those errors may have nothing to do with the Pico slowness, but you never know so I thought I would include it. I've not seen those errors since I rebooted the hub, but the light is still slow to respond.

Other than viewing the logs for the devices, any other suggestions?

It appears that your database was corrupted.. can you try rebooting the hub and see if the errors go away? If they do not can you restore your hub from a previous backup.

I had to reboot the hub when I got home from work, as I was getting Error 500 on all pages. Then I checked past logs and saw those errors. I've not seen them anymore since I rebooted.

Looking at the logs, the delay is happening from the time my app tells the Hue group to go on until it finally does go on:

Device Time Log
Lutron Telnet dev:1005 2018-11-05 05:00:21.372 pm info rcvd: DEVICE,4,4,3
Lutron Telnet dev:1005 2018-11-05 05:00:21.499 pm info rcvd: DEVICE,4,4,4
Bathroom Pico dev:1008 2018-11-05 05:00:21.551 pm info Master Bathroom Pico Switch button 5 was pushed
Pico Controller app:1418 2018-11-05 05:00:23.322 pm debug button 5 pushed
Hue Group dev:1147 2018-11-05 05:00:23.423 pm info Group Master Bath was turned off
Lutron Telnet dev:1005 2018-11-05 05:00:30.280 pm info rcvd: DEVICE,4,2,3
Lutron Telnet dev:1005 2018-11-05 05:00:33.013 pm info rcvd: DEVICE,4,2,4
Bathroom Pico dev:1008 2018-11-05 05:00:33.396 pm info Master Bathroom Pico Switch button 1 was pushed
Pico Controller app:1418 2018-11-05 05:00:33.702 pm debug button 1 pushed
Pico Controller app:1418 2018-11-05 05:00:33.743 pm debug pressNum is 0, On
Hue Group dev:1147 2018-11-05 05:00:41.526 pm info Group Master Bath was turned on

Here is my app code in case that might be doing something incorrectly (though it was working up until about a week ago):

/*
 *  Pico color temp bulb controller instance
 *  Button 1 presses:
 *  1: turn bulb(s) on (can have the bulb programmed to set color temp depending on time of day, when it is turned on)
 *  2: set bulb(s) to Nightlight 
 *  3: set bulb(s) to Relax
 *  4: set bulb(s) to Read
 *  5: set bulb(s) to Concentrate
 *  6: set bulb(s) to Energize
 *  7: back to Nightlight, etc
 */
definition(name: "Pico Color Temp Bulb Controller Instance",
           namespace: "hubitat",
           author: "dagrider",
           description: "Cycle through bulb color temps with button 1, off with button 5, dim with buttons 2 and 4 (instance)",
           category: "Green Living",
           parent: "hubitat:Pico Color Temp Bulb Controller",
           iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/temp_thermo-switch.png",
           iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/temp_thermo-switch@2x.png")

preferences {
    section {
        input "thePico", "capability.pushableButton", title: "Choose Pico Remote"
        input "theBulb", "capability.colorTemperature", title: "Choose bulb/group to control"
    }
}

def installed() {
    log.debug "Installed with settings: ${settings}"
    initialize()
}

def updated() {
    log.debug "Updated with settings: ${settings}"
    unsubscribe()
    initialize()
}

def initialize() {
    log.debug "initialize"
    subscribe(thePico, "pushed", pushedHandler)
    subscribe(theBulb, "switch", switchHandler)
    state.pressNum = 0
}

def pushedHandler(evt) {
    switch(evt.value) { 
        case "1": 
            log.debug "button 1 pushed"
        
            if (state.pressNum == 0) {
                    log.debug "pressNum is 0, On"
                    bulbOn()
                    sendEvent(name: "on", value: "pressNum: $state.pressNum", descriptionText: "Turn bulb on")
                    state.pressNum = 1
            } else if (state.pressNum == 1) {
                    log.debug "pressNum is 1, Nightlight"
                    theBulb.setLevel(1)
                    theBulb.setColorTemperature(2237)
                    sendEvent(name: "on", value: "pressNum: $state.pressNum", descriptionText: "Set bulb to Nightlight")
                    state.pressNum = 2
            } else if (state.pressNum == 2) {
                    log.debug "pressNum is 2, Relax"
                    theBulb.setColorTemperature(2237)
                    theBulb.setLevel(57)
                    sendEvent(name: "on", value: "pressNum: $state.pressNum", descriptionText: "Set bulb to Relax")
                    state.pressNum = 3
            } else if (state.pressNum == 3) {
                    log.debug "pressNum is 3, Read"
                    theBulb.setColorTemperature(2890)
                    theBulb.setLevel(100)
                    sendEvent(name: "on", value: "pressNum: $state.pressNum", descriptionText: "Set bulb to Read")
                    state.pressNum = 4
            } else if (state.pressNum == 4) {
                    log.debug "pressNum is 4, Concentrate"
                    theBulb.setColorTemperature(4292)
                    theBulb.setLevel(100)
                    sendEvent(name: "on", value: "pressNum: $state.pressNum", descriptionText: "Set bulb to Concentrate")
                    state.pressNum = 5
            } else if (state.pressNum == 5) {
                    log.debug "pressNum is 5, Energize"
                    theBulb.setColorTemperature(6536)
                    theBulb.setLevel(100)
                    sendEvent(name: "on", value: "pressNum: $state.pressNum", descriptionText: "Set bulb to Energize")
                    state.pressNum = 1
            }
        
            break;
        case "2": 
            log.debug "button 2 pushed"
        
            if (theBulb.currentValue("switch") == "off") {
                bulbOn()
                sendEvent(name: "brighten", value: "", descriptionText: "Brighten bulb to on")
            } else {
                def lvl = getLevel(1)
                log.debug "brighten to level $lvl"
                theBulb.setLevel(lvl)
                sendEvent(name: "brighten", value: "level: $lvl", descriptionText: "Brighten bulb to $lvl")
            }
        
            break;
        case "3": 
            // todo: center button
            break;
        case "4": 
            log.debug "button 4 pushed"
            
            if (theBulb.currentValue("switch") != "off") {
                def lvl = getLevel(0)
                log.debug "dim to level $lvl"
                
                if (lvl == 0) {
                    bulbOff()
                    sendEvent(name: "dim", value: "", descriptionText: "Dim bulb to off")
                } else {
                    theBulb.setLevel(lvl)
                    sendEvent(name: "dim", value: "level: $lvl", descriptionText: "Dim bulb to $lvl")
                }
            } 
        
            break;
        case "5": 
            log.debug "button 5 pushed"
            bulbOff()
            sendEvent(name: "off", value: "pressNum: $state.pressNum", descriptionText: "Turn bulb off")
            break;
        default:
            return
    }
}

private bulbOn() {
    theBulb.on()
    theBulb.refresh()
}

private bulbOff() {
    theBulb.off()
    theBulb.refresh()
    state.pressNum = 0
}

def switchHandler(evt) {
    switch(evt.value) { 
        case "on": 
            state.pressNum = 1
            break
        case "off":
            state.pressNum = 0
            break
    }
}

private int getLevel(typ) {
    def lvl = theBulb.currentValue("level").toInteger()
    log.debug "current level: $lvl"
    
    switch (lvl) {
        case 0..10: 
            lvl = 0
            break
        case 11..30:
            lvl = 20
            break
        case 31..50:
            lvl = 40
            break
        case 51..70:
            lvl = 60
            break
        case 71..90:
            lvl = 80
            break
        default:
            lvl = 100
            break
    }
    
    log.debug "adjusted level: $lvl"
    
    if (typ == 1) lvl = lvl + 20
    else lvl = lvl - 20
        
    if (lvl > 100) lvl = 100
    else if (lvl <= 0) lvl = 0
    
    log.debug "new level: $lvl"
    return lvl
}

Denise, I am also having problems with my pico switches being slow or a lot of times not working at all. Were you able to fix your problem and if so what fixed it? It’s frustrating when they don’t work and they aren’t working about 50% of the time.

I took out the refreshes from my Pico app and that helped some. It turned out to be the Hue integration that was causing the problem, as my Picos all control Hue bulbs.

There were some enhancements done in the Hue integration recently, are you on the latest release? What do your Picos control? If not Hue bulbs, then you may have a different problem.

I was able to figure it out over the weekend. My IP reservations weren’t working for my Hue bridge or Lutron hub. This was my problem. My picos control hue lights and other lights now and have been working great!

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.