Vertical Slider Bar - How to adjust?


(Charles) #1

I feel like this is a really dumb question, because it is incredibly frustrating to me, yet my search shows nobody else is complaining. Must be me!

But… How on earth do I adjust and save a slider of the folding form:

This style appeared about a year ago and I have never been able to deal with it. I can change it by either moving the thermometer or tapping the arrows. But it never sticks. I thought maybe it was my tablet or phone, so I’ve tried many. No difference. It seems that there is a “DONE” button I’m missing. But where? How?


Intermatic PE653 Pool Control System
(Jimmy) #2

On my iPhone you drag it and it adjusts live. Then tap the X in the upper left to exit.


(Charles) #3

Thanks, Jimmy. On my various devices, the “X” leaves but it reverts to the previous setting.


(Dan) #4

Are these your own custom devices, or standard devices?


(Charles) #5

I’m down to two dimmer-type devices left on ST and they are both custom (but not mine). The one I posted was from a community driver for the OSRAM GardenSpot mini’s.


(Dan) #6

Can you post a link to the device handler code? Most likely it’s just a bug in the custom device handler.


(Charles) #7

Thanks a lot, Dan.

Here’s the github link for the GardenSpot DTH:
https://github.com/infofiend/Osram_gSpots/blob/master/devicetypes/info-fiend/osram-gardenspot-mini-rgb-aap-version.src/osram-gardenspot-mini-rgb-aap-version.groovy


(Dan) #8

Looks like a simple bug in the Device Handler code. 3 of the 4 sliders work fine, but the main LEVEL slider code was messed up.

Try replacing the setLevel() function in your DTH with the following which I modified slightly. The level value now sticks, however you’ll have to test it to see if it behaves as desired with the real device.

def setLevel(value) {
	log.trace "setLevel($value)"
	def tt = (this.device.currentValue("transitionTime") ) ?: 3.2
    Integer duration = tt * 10
    log.debug "duration = ${duration} / tt = ${tt} "
    
    state.levelValue = (value==null) ? 100 : value
	def transitionTime = swapEndianHex(hexF(duration,4)) 
    log.debug "transitionTime = ${transitionTime} "
    
    def cmds = []

    if (value == 0) {
        sendEvent(name: "switch", value: "off", isStateChange: true)
        cmds << "st cmd 0x${device.deviceNetworkId} ${endpointId} 6 0 {}"
        cmds << "delay 150"
    } else if (device.latestValue("switch") == "off") {
        sendEvent(name: "switch", value: "on", isStateChange: true)
		cmds << "st cmd 0x${device.deviceNetworkId} ${endpointId} 6 1 {}"
		cmds << "delay 150"
    }


    sendEvent(name: "level", value: state.levelValue, isStateChange: true)
    def scaledLevel = zigbee.convertToHexString(Math.round(state.levelValue * 0xfe / 100.0), 2)
    cmds <<  "st cmd 0x${device.deviceNetworkId} ${endpointId} 8 4 {${scaledLevel} ${transitionTime}}"

    //log.debug cmds
    cmds
}

(Dan) #9

Also, looks like you might be better off just using the default DTH from ST for these lights…


(Charles) #10

Thank you, Dan. That change to setLevel did the trick, at least for that DTH. See you on the other side.