Code Monkey home page Code Monkey logo

Comments (10)

tonesto7 avatar tonesto7 commented on August 11, 2024

You have a communication issue likely caused by a firewall.
These are really basic HTTP requests so if the devices are online and the config is correct they should work unless a firewall is blocking the port on the plugin side

from homebridge-hubitat-tonesto7.

jorhett avatar jorhett commented on August 11, 2024

You have a communication issue likely caused by a firewall.
These are really basic HTTP requests so if the devices are online and the config is correct they should work unless a firewall is blocking the port on the plugin side

Look at the logs I supplied again. How does something blocking a port let through fader operations but not on/off?

I can assure you there is no firewall in place. I'm happy to assist you with debugging.

from homebridge-hubitat-tonesto7.

jorhett avatar jorhett commented on August 11, 2024

Uploading Screen Shot 2020-11-07 at 11.40.02 AM.png…

from homebridge-hubitat-tonesto7.

jorhett avatar jorhett commented on August 11, 2024

Of note, FYI I'm not quite sure at least for this purpose that your GOOD debug logging has much value. It seems to be echoing a code block, rather than showing us the data sent or received.

[11/7/2020, 4:59:10 am] [Hubitat-v2] GOOD: [CHARACTERISTIC (function On() {
        var _this = _super.call(this, 'On', On.UUID) || this;
        _this.setProps({
            format: "bool" /* BOOL */,
            perms: ["pr" /* READ */, "pw" /* WRITE */, "ev" /* NOTIFY */]
        });
        _this.value = _this.getDefaultValue();
        return _this;
    }) GET] switch (P3 - Crystals) | LastUpdate: (Sat Nov 07 2020 04:56:56 GMT-0800 (Pacific Standard Time)) | Value: (false)

Shouldn't this perhaps be DEBUG, while some of the much more concise DEBUG logs would seem to be more useful?

[11/7/2020, 12:02:37 pm] [Hubitat-v2] DEBUG: sendStartDirect Resp: {"status":"OK"}

This is a bit confused I think (as per my edits on this message) by the choice to send GOOD logs when debug is enabled:

 if (this.logConfig.debug === true) this.log.good(`[CHARACTERISTIC (${char}) GET]

And of note, when an operation fails there is no debug output--which seems like the ideal time to dump some data.

[11/7/2020, 4:59:07 am] [Hubitat-v2] NOTICE: Sending Device Command: on | Name: (P4 - Breeze Fan) | DeviceID: (809) | LocalCommand: (false)
[11/7/2020, 4:59:08 am] [Hubitat-v2] ERROR: sendDeviceCommand Error: [object Object] | Message: Request failed with status code 500

from homebridge-hubitat-tonesto7.

jorhett avatar jorhett commented on August 11, 2024

#27 is IMHO a logging improvement. It doesn't seem likely to cause other issues but your judgement call

from homebridge-hubitat-tonesto7.

jorhett avatar jorhett commented on August 11, 2024

Okay, some more debugging. Don't know if the initial registration is the problem, but disabling Cloud now works for local devices. And switch on/off works fine locally! Flip back to cloud, on/off doesn't work. Back to local it works fine. So something is wrong with the Cloud update for on/off that doesn't affect setLevel

It appears err.response is undefined when a 500 error happens, so replacing that with JSON.stringify(err) I get this output:

DEBUG: Sending {"method":"post","url":"https://cloud.hubitat.com/api/2020abcd-1a2b-3c4d-5e6f-123456abcdef/apps/512/808/command/on","params":{"access_token":"1a2b3c4d-9f8e-1a2b-3c4d-9f8e7d6d5c4b1fdd71"},"headers":{"evtsource":"Homebridge_Hubitat-v2_512","evttype":"hkCommand"},"timeout":5000}

ERROR: sendDeviceCommand {"message":"Request failed with status code 500","name":"Error","stack":"Error: Request failed with status code 500\n at createError (/homebridge/node_modules/homebridge-hubitat-tonesto7/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/homebridge/node_modules/homebridge-hubitat-tonesto7/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/homebridge/node_modules/homebridge-hubitat-tonesto7/node_modules/axios/lib/adapters/http.js:244:11)\n at IncomingMessage.emit (events.js:327:22)\n at endReadableNT (_stream_readable.js:1220:12)\n at processTicksAndRejections (internal/process/task_queues.js:84:21)","config":{"url":"https://cloud.hubitat.com/api/2020abcd-1a2b-3c4d-5e6f-123456abcdef/apps/712/808/command/on","method":"post","headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/x-www-form-urlencoded","evtsource":"Homebridge_Hubitat-v2_512","evttype":"hkCommand","User-Agent":"axios/0.21.0"},"params":{"access_token":"1a2b3c4d-9f8e-1a2b-3c4d-9f8e7d6d5c4b1fdd71"},"transformRequest":[null],"transformResponse":[null],"timeout":5000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1}} | Message: Request failed with status code 500

from homebridge-hubitat-tonesto7.

tonesto7 avatar tonesto7 commented on August 11, 2024

You've been busy :)
Thanks for working on this stuff... I'm not sure why you are seeing so many errors, but I'm glad someone is reviewing the logging to make it more readable useful.

I'm in the middle of working on v2.1.0 of the main app and I will make sure to merge any more finding you make into v2.1.0 of the plugin.

I just tested using cloud and I'm able to duplicate your finding of the 500 errors. I will investigate and get the fix out in the next release

from homebridge-hubitat-tonesto7.

jorhett avatar jorhett commented on August 11, 2024

Thank you for developing this! It been been tremendously useful.

I really suspect my errors were around regenerating and regenerating the access token. The last two times I was super careful to regenerate then completely exit the app and I've had no problems (other than the 500 for this)

Everything else is working fantastically!

from homebridge-hubitat-tonesto7.

tonesto7 avatar tonesto7 commented on August 11, 2024

I tracked the issue down. It's because I wasn't passing the header key 'Content-Type': 'application/json'
:(

from homebridge-hubitat-tonesto7.

tonesto7 avatar tonesto7 commented on August 11, 2024

This issue is now resolved and the fix is in the latest code

from homebridge-hubitat-tonesto7.

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.