GithubHelp home page GithubHelp logo

Comments (16)

ikonron avatar ikonron commented on August 19, 2024

I could only get mine to turn back on by changing the server.js file in /usr/local/lib/node_modules/smartthings-mqtt-bridge

I remmed out 260 -267 and I was able to turn it back on with HA:

This is why it wasn't turning on.
info: Incoming message from MQTT: smartthings/Basement Light 1/switch = off
info: Incoming message from MQTT: smartthings/Basement Light 1/switch = on
info: Passing level instead of switch on

Must have something to do with the brightness level st is reporting to the bridge making it think it is already on:.

Now on to figure out why the brightness level reporting or control isn't working.

from smartthings-mqtt-bridge.

stjohnjohnson avatar stjohnjohnson commented on August 19, 2024

Interesting, because SmartThings should accept the brightness and turn the light on.
https://github.com/stjohnjohnson/smartthings-mqtt-bridge/blob/master/server.js#L260-L267

http://docs.smartthings.com/en/latest/capabilities-reference.html#switch-level
See comment:

    myswitch.setLevel(90) // also turns on the switch

from smartthings-mqtt-bridge.

mehuman avatar mehuman commented on August 19, 2024

Taking a second look at this, I'm now getting this error in the live log. It happens when setting either the switch or trying to set the level.
Tried restarting the bridge and am getting the same error.

10:21:48 AM: error groovy.lang.MissingMethodException: No signature of method: java.lang.String.div() is applicable for argument types: (java.lang.Integer) values: [100]
Possible solutions: is(java.lang.Object), drop(int), wait(), trim(), find(), size() @ line 85

from smartthings-mqtt-bridge.

stjohnjohnson avatar stjohnjohnson commented on August 19, 2024

What devicetype do you have for your light? It sounds like theres a bug in that code.

from smartthings-mqtt-bridge.

ikonron avatar ikonron commented on August 19, 2024

[image: Inline image 1]

Osram LIGHTIFY® LED A19 Tunable White
I also tried Zigbee Dimmer as well.
Both of my lights are the same Osram. Experiencing the same results on
both. One thing I did notice was that when I tried dimming, the slider
moved in the app but the lamp did nothing. I haven't had time to mess with
it but hope to this weekend.

On Fri, May 20, 2016 at 1:33 PM, St. John Johnson [email protected]
wrote:

What devicetype do you have for your light? It sounds like theres a bug in
that code.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#40 (comment)

from smartthings-mqtt-bridge.

scottosx avatar scottosx commented on August 19, 2024

I can verify that this condition is occurring as well. Commenting out lines 260 -267 restores the ability to turn the lights on and off. However, I still cannot set the level using the /level topic.

I do get the status update from the console (if running without PM2)
info: Incoming message from MQTT: smartthings/Bedroom Light 1/level = 50

I do not see any change in the level slider in the app as indicated by Ikonron.

I have tested this on Osram Lightify as well as LIFX bulbs.

Thanks for any insight and this awesome addition to the Smartthings arsenal.

from smartthings-mqtt-bridge.

scottosx avatar scottosx commented on August 19, 2024

In the log I do see a similar error as reported above:

10:36:55 AM: debug Received device event from bridge: [name:Bedroom Light 1, value:50, type:level]
10:36:55 AM: error groovy.lang.MissingMethodException: No signature of method: java.lang.String.div() is applicable for argument types: (java.lang.Integer) values: [100]
Possible solutions: is(java.lang.Object), drop(int), wait(), trim(), dump(), size() @ line 527

from smartthings-mqtt-bridge.

mehuman avatar mehuman commented on August 19, 2024

The lights I'm using are the Cree Connected Smartbulbs.
http://creebulb.com/connected-60-watt-replacement-soft-white

from smartthings-mqtt-bridge.

stjohnjohnson avatar stjohnjohnson commented on August 19, 2024

I'm thinking the problem is something in the Device Type for your light bulb. We're sending an integer, while it looks like the device requires a string. Very strange. Not sure how to proceed here.

from smartthings-mqtt-bridge.

kevinoconnor7 avatar kevinoconnor7 commented on August 19, 2024

I ran into this as well. It seems that the app is passing the bulb a string when it expects an int. I fixed it by updating the levelAction to call setLevel(value as int).

That resolved the issue for me, but I'm not sure it's going to be correct for all device types.

from smartthings-mqtt-bridge.

mehuman avatar mehuman commented on August 19, 2024

^ This fix worked for me as well. I updated mine to read:

def actionLevel(device, attribute, value) {
device.setLevel(value)
device.setLevel(value as int)
}

Everything appears to be working, I still get an error about the value not being an int but the light turns on and I can adjust the level with the slider in HA.

Logs turning light on and adjusting the level:

0a40c8f8-5f19-4376-8607-ddc933bcc0b9 10:24:24 AM: debug [raw:0104 0008 0A 01 0140 00 4917 00 00 0000 0B 01 0400, profileId:0104, clusterId:0008, clusterInt:8, sourceEndpoint:0A, destinationEndpoint:01, options:0140, messageType:00, dni:4917, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:0B, direction:01, data:[04, 00]]
0a40c8f8-5f19-4376-8607-ddc933bcc0b9 10:24:24 AM: debug DID NOT PARSE MESSAGE for description : catchall: 0104 0008 0A 01 0140 00 4917 00 00 0000 0B 01 0400
0a40c8f8-5f19-4376-8607-ddc933bcc0b9 10:24:24 AM: debug level updated successfully
0a40c8f8-5f19-4376-8607-ddc933bcc0b9 10:24:24 AM: debug description is catchall: 0104 0008 0A 01 0140 00 4917 00 00 0000 0B 01 0400
0a40c8f8-5f19-4376-8607-ddc933bcc0b9 10:24:24 AM: debug description is read attr - raw: 49170A00080A00000020BC, dni: 4917, endpoint: 0A, cluster: 0008, size: 0A, attrId: 0000, result: success, encoding: 20, value: bc
0a40c8f8-5f19-4376-8607-ddc933bcc0b9 10:24:23 AM: debug description is catchall: 0104 0006 0A 01 0140 00 4917 00 00 0000 0B 01 0100
0a40c8f8-5f19-4376-8607-ddc933bcc0b9 10:24:23 AM: error groovy.lang.MissingMethodException: No signature of method: java.lang.String.div() is applicable for argument types: (java.lang.Integer) values: [100]
Possible solutions: drop(int), is(java.lang.Object), wait(), trim(), dump(), find()
0a40c8f8-5f19-4376-8607-ddc933bcc0b9 10:24:10 AM: debug description is catchall: 0104 0006 0A 01 0140 00 4917 00 00 0000 0B 01 0100
0a40c8f8-5f19-4376-8607-ddc933bcc0b9 10:24:08 AM: debug [raw:0104 0008 0A 01 0140 00 4917 00 00 0000 0B 01 0400, profileId:0104, clusterId:0008, clusterInt:8, sourceEndpoint:0A, destinationEndpoint:01, options:0140, messageType:00, dni:4917, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:0B, direction:01, data:[04, 00]]
0a40c8f8-5f19-4376-8607-ddc933bcc0b9 10:24:08 AM: debug DID NOT PARSE MESSAGE for description : catchall: 0104 0008 0A 01 0140 00 4917 00 00 0000 0B 01 0400
0a40c8f8-5f19-4376-8607-ddc933bcc0b9 10:24:08 AM: debug level updated successfully
0a40c8f8-5f19-4376-8607-ddc933bcc0b9 10:24:08 AM: debug description is catchall: 0104 0008 0A 01 0140 00 4917 00 00 0000 0B 01 0400
0a40c8f8-5f19-4376-8607-ddc933bcc0b9 10:24:08 AM: error groovy.lang.MissingMethodException: No signature of method: java.lang.String.div() is applicable for argument types: (java.lang.Integer) values: [100]
Possible solutions: is(java.lang.Object), drop(int), wait(), trim(), dump(), size()

from smartthings-mqtt-bridge.

kevinoconnor7 avatar kevinoconnor7 commented on August 19, 2024

Just make the code:

def actionLevel(device, attribute, value) {
  device.setLevel(value as int)
}

That should work and you shouldn't get any errors

from smartthings-mqtt-bridge.

mehuman avatar mehuman commented on August 19, 2024

You said earlier "That resolved the issue for me, but I'm not sure it's going to be correct for all device types." I was thinking that even though it errors it should make it universal for all device types to have both calls in. Thoughts?

from smartthings-mqtt-bridge.

kevinoconnor7 avatar kevinoconnor7 commented on August 19, 2024

It's possible that an integer is always expected there, I just don't have enough devices to test with. If it works in your environment only passing in an int then I'd just leave it.

from smartthings-mqtt-bridge.

stjohnjohnson avatar stjohnjohnson commented on August 19, 2024

Agreed, looks like my bad. My devicetypes were fixing the string->int, but not Cree. I have a PR open and @jer should be able to review it today.

Good find.

from smartthings-mqtt-bridge.

stjohnjohnson avatar stjohnjohnson commented on August 19, 2024

from smartthings-mqtt-bridge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.