Error java.lang.NullPointerException: Cannot invoke method toInteger() on null object @ line 689

0310dab7-9a55-49b4-96f1-369f703b17e5 20:37:57: error java.lang.NullPointerException: Cannot invoke method toInteger() on null object @ line 689

Does anyone knows what does it mean?

For what device and which DH is it using?

1 Like

i have Fibaro Dimmer 2. this happend when i install device handler

Rajiv, Elnar Hajiyev

/**

  • Copyright 2016 SmartThings
  • 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.

*/
metadata {
definition (name: “Fibaro Dimmer 2”, namespace: “smartthings”, author: “Rajiv, Elnar Hajiyev”) {
capability "Energy Meter"
capability "Actuator"
capability "Switch"
capability "Power Meter"
capability "Polling"
capability "Refresh"
capability "Sensor"
capability "Configuration"
capability “Switch Level”

    //Extending Fibaro Dimmer 2 devices with scene attribute
    attribute "scene", "number"

    command "reset"
    command "changeSingleParamAfterSecure"
    command "configureAfterSecure"

    fingerprint deviceId: "0x1001", inClusters: "0x5E, 0x20, 0x86, 0x72, 0x26, 0x5A, 0x59, 0x85, 0x73, 0x98, 0x7A, 0x56, 0x70, 0x31, 0x32, 0x8E, 0x60, 0x75, 0x71, 0x27, 0x22, 0xEF, 0x2B"
}

// simulator metadata
simulator {
    status "on":  "command: 2003, payload: FF"
    status "off": "command: 2003, payload: 00"
    status "09%": "command: 2003, payload: 09"
    status "10%": "command: 2003, payload: 0A"
    status "33%": "command: 2003, payload: 21"
    status "66%": "command: 2003, payload: 42"
    status "99%": "command: 2003, payload: 63"

    for (int i = 0; i <= 10000; i += 1000) {
        status "power  ${i} W": new physicalgraph.zwave.Zwave().meterV3.meterReport(
            scaledMeterValue: i, precision: 3, meterType: 4, scale: 2, size: 4).incomingMessage()
    }
    for (int i = 0; i <= 100; i += 10) {
        status "energy  ${i} kWh": new physicalgraph.zwave.Zwave().meterV3.meterReport(
            scaledMeterValue: i, precision: 3, meterType: 0, scale: 0, size: 4).incomingMessage()
    }

    ["FF", "00", "09", "0A", "21", "42", "63"].each { val ->
        reply "2001$val,delay 100,2602": "command: 2603, payload: $val"
    }
}

// tile definitions

tiles(scale: 2) {
    multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){
        tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
            attributeState "on", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff"
            attributeState "off", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn"
            attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff"
            attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn"
        }
        tileAttribute ("device.level", key: "SLIDER_CONTROL") {
            attributeState "level", action:"switch level.setLevel"
        }
    }
    valueTile("power", "device.power", decoration: "flat", width: 2, height: 2) {
        state "default", label:'${currentValue} W'
    }
    valueTile("energy", "device.energy", decoration: "flat", width: 2, height: 2) {
        state "default", label:'${currentValue} kWh'
    }
    standardTile("reset", "device.energy", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
        state "default", label:'reset kWh', action:"reset"
    }
    standardTile("configureAfterSecure", "device.configure", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
        state "configure", label:'', action:"configureAfterSecure", icon:"st.secondary.configure"
    }
    standardTile("refresh", "device.power", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
        state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh"
    }

    main(["switch","power","energy"])
    details(["switch","power","energy","configureAfterSecure","refresh","reset"])
}

preferences {
    def paragraph = "GROUP 0 - The Dimmer 2 behavior - Basic functionalities"
    input name: "param1", type: "number", range: "1..98", defaultValue: "1", required: true,
        title: paragraph + "\n\n" +
               "1. Minimum brightness level. " +
               "This parameter is set automatically during the calibration process. " +
               "The parameter can be changed manually after the calibration.\n" +
               "Available settings: 1-98 - percentage level of brightness.\n" +
               "Default value: 1."

    input name: "param2", type: "number", range: "2..99", defaultValue: "99", required: true,
        title: "2. Maximum brightness level. " +
               "This parameter is set automatically during the calibration process. " +
               "The parameter can be changed manually after the calibration.\n" +
               "Available settings: 2-99 - percentage level of brightness.\n" +
               "Default value: 99."

    input name: "param3", type: "number", range: "1..99", defaultValue: "1", required: true,
        title: "3. Incandescence level of dimmable compact fluorescent lamps. " +
               "Virtual value set as a percentage level between parameters MIN (1%) and MAX (99%). " +
               "The Dimmer 2 will set to this value after first switch on. " +
               "It is required for warming up and switching dimmable compact fluorescent lamps and certain types of light sources.\n" +
               "Available settings: 1-99 - percentage level of brightness.\n" +
               "Default value: 1."

    input name: "param4", type: "number", range: "0..255", defaultValue: "0", required: true,
        title: "4. Incandescence time of dimmable compact  fluorescent lamps. " +

Ok, but which device handler? Is it ST’s default or did you get it from somewhere here in the Community? Are there device preferences that should be configured/defined (mobile app, go to the device, tap on the gear in the upper right corner)?

It’s not default, i’ve got it in community and that error is showing when i install this DH. Rajiv, Elnar Hajiyev - he made this DH it’s long one. about 796 lines and error pops up right after install before i can make any changes in settings

Hi @mannerman,

So that I can get notified when you reply, please click on the Reply that’s within my post, not the blue Reply button at the bottom of the discussion. That will help you and I keep a good discussion going.

Unfortunately the code you posted isn’t complete and it didn’t paste correctly, but not to worry. Do you have the original link to the source code, perhaps it’s on Github? I’ll do some searching too.

Hi @mannerman. Are you in the UK?

@rmbhatia, I think this may be your DH. Can you help debug this?

Ok @mannerman, I found the code you’re using (I think):

https://raw.githubusercontent.com/hajar97/FibaroDimmers/07739ae7dfac5b68f72d41f0fb82323a7b12febd/devicetypes/fibarodimmer2.groovy

I think the error is being caused by parameters not being set correctly or that are empty and must have a value. You can keep your DH as is, and remove and re-include the device to force a configuration, or you keep trying to get into the device in the mobile app and get into preferences to make changes.

If I were you I’d start over again and create a brand new device handler with the code from the link I provided above, and then edit the device in the IDE to use your new DH.

1 Like

sorry about this reply but im new in here so im still learning. That’s true about those setting because later after install i’ve setted up all and it works without problem
thank for help

Nothing to be sorry about at all! Glad to hear that you got it working.

Hi @mannerman I am having this issue as well. What did you do to get it working?

Hi there,

Help me, please.
I Connect Hue Bulb (Single bulb ampoule unique) with ST (Not through Hue Bridge). They connected together.
When i control Hue Bulb by ST App, i receive that “java.lang.NullPointerException: Cannot invoke method on() on null object @ line 81”. Hue bulb cannot turn on/off.

Thanks