Git Product home page Git Product logo

homebridge-eightsleep-platform's Introduction

homebridge-eightsleep-pod

homebriged plugin for the eightsleep pod

Installation

npm i --save homebridge-eightsleep-pod

Usage

Example config, It will show up as a Heater/Cooler in homekit. Fan speed controls the temperature level.

"platforms": [
    // This is the config for this plugin
    {
      "platform": "EightSleepPod",
      "email": "[email protected]",
      "password": "mypassword",
      "oauthClient": {
          "id": "oauth-client-id",
          "secret": "oauth-client-secret"
      }
    }
    // End of the config
  ],

How do I get my oauth client id and secret?

Check out this comment

Screenshots

tiles controls

License

MI

homebridge-eightsleep-platform's People

Contributors

dsully avatar npsconsultingllc avatar tjmehta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

homebridge-eightsleep-platform's Issues

Config info is not working

Sorry maybe i am just being a noob, but I cant get the config to save when I add what you suggested. I also assume one needs to get the oauth ID and secret from somewhere but i am not sure how to find that. mind helping me out?

No longer able to login (using Client_Id & Client secret) 400 error

I am no longer able to login with this plugin, and I'm not sure how to debug any further. This is the error Im getting:

StatusCodeError: unexpected status
    at EightSleepClientApi.<anonymous> (/var/lib/homebridge/node_modules/homebridge-eightsleep-pod/node_modules/simple-api-client/src/index.ts:280:21)
    at Generator.next (<anonymous>)
    at fulfilled (/var/lib/homebridge/node_modules/homebridge-eightsleep-pod/node_modules/simple-api-client/dist/cjs/index.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
{
  "expectedStatus": 200,
  "status": 400,
  "headers": {},
  "path": "login",
  "init": {
    "method": "POST",
    "headers": {
      "accept": "application/json",
      "content-type": "application/json",
      "user-agent": "Eight%20Sleep/1000018 CFNetwork/1237 Darwin/20.4.0",
      "accept-language": "en-us",
      "accept-encoding": "gzip, deflate, br"
    },
    "body": "{\"email\":\"[email protected]\",\"password\":\"MySecurePassword\"}"
  },
  "body": {
    "status": 400,
    "code": "BadRequest",
    "error": "Error logging in."
  }
}

This is what my config looks like:

      {
            "platform": "EightSleepPod",
            "email": "[email protected]",
            "password": "MySecurePassword",
            "oauthClient": {
                "id": "08XXXXXXXX",
                "secret": "f095XXXXXXXXXXX"
            }
        }

Thanks for the time and I'm grateful for the plugin.

EDIT:Formatting

v 2.4.3 validation error and Hombridge slow warning

Hi thjmehta,

Thanks for the quick response. I'm posting as a separate issue here.

I'm on v2.4.3 and am now getting the second set of errors posted above. I normally have the beta temperature setting disabled, but I get these errors now whether it's enabled or disabled.

Pasting a subset of my errors below:
Get CurrentHeaterCoolerState Error -> InvalidSid
eStatusError: invalid currentTargetLevel
at validateSideStatus (/usr/local/lib/node_modules/homebridge-eightsleep-pod/node_modules/eightslee
p/src/validateDeviceStatus.ts:76:11)
at Object.validateDeviceStatus [as default] (/usr/local/lib/node_modules/homebridge-eightsleep-pod/
node_modules/eightsleep/src/validateDeviceStatus.ts:51:11)
at EightSleepAppApi. (/usr/local/lib/node_modules/homebridge-eightsleep-pod/node_modules
/eightsleep/src/EightSleepAppApi.ts:79:32)
at Generator.next ()
at fulfilled (/usr/local/lib/node_modules/homebridge-eightsleep-pod/node_modules/eightsleep/dist/cj
s/EightSleepAppApi.js:5:58)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
{
"sideStatus": {
"currentLevel": 7,
"currentTargetLevel": 6,
"currentActivity": "schedule",
"version": 2,
"smartTemperature": {
"bedTimeLevel": 6,
"initialSleepLevel": 10,
"finalSleepLevel": 9,
"currentPhase": "bedtime"
}
}
}
{
sideStatus: {
currentLevel: 7,
currentTargetLevel: 6,
currentActivity: 'schedule',
version: 2,
smartTemperature: {
bedTimeLevel: 6,
initialSleepLevel: 10,
finalSleepLevel: 9,
currentPhase: 'bedtime'
}
}
}
[07/02/2022, 22:39:20] [EightSleepPod] Get TargetHeaterCoolerState Error -> InvalidSide
StatusError: invalid currentTargetLevel
at validateSideStatus (/usr/local/lib/node_modules/homebridge-eightsleep-pod/node_modules/eightslee
p/src/validateDeviceStatus.ts:76:11)
at Object.validateDeviceStatus [as default] (/usr/local/lib/node_modules/homebridge-eightsleep-pod/
node_modules/eightsleep/src/validateDeviceStatus.ts:51:11)
at EightSleepAppApi. (/usr/local/lib/node_modules/homebridge-eightsleep-pod/node_modules
/eightsleep/src/EightSleepAppApi.ts:79:32)
at Generator.next ()
at fulfilled (/usr/local/lib/node_modules/homebridge-eightsleep-pod/node_modules/eightsleep/dist/cj
s/EightSleepAppApi.js:5:58)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
{
"sideStatus": {
"currentLevel": 7,
"currentTargetLevel": 6,
"currentActivity": "schedule",
"version": 2,
"smartTemperature": {
"bedTimeLevel": 6,
"initialSleepLevel": 10,
"finalSleepLevel": 9,
"currentPhase": "bedtime"
}
}
}
{
sideStatus: {
currentLevel: 7,
currentTargetLevel: 6,
currentActivity: 'schedule',
version: 2,
smartTemperature: {
bedTimeLevel: 6,
initialSleepLevel: 10,
finalSleepLevel: 9,
currentPhase: 'bedtime'
}
}
}
[07/02/2022, 22:39:20] [EightSleepPod] Get Active Error -> InvalidSideStatusError: inva

The logs look ok before this, but there is a warning that precedes this. Including this just in case it helps. Let me know if I can include more info!

This plugin slows down Homebridg
e. The read handler for the characteristic 'Active' didn't respond at all!. Please check that you properly
call the callback! See https://git.io/JtMGR for more info.
[07/02/2022, 21:39:31] [homebridge-eightsleep-pod] This plugin slows down Homebridg
e. The read handler for the characteristic 'Current Heater-Cooler State' didn't respond at all!. Please che
ck that you properly call the callback! See https://git.io/JtMGR for more info.
[07/02/2022, 21:39:31] [homebridge-eightsleep-pod] This plugin slows down Homebridg
e. The read handler for the characteristic 'Target Heater-Cooler State' didn't respond at all!. Please chec
k that you properly call the callback! See https://git.io/JtMGR for more info.
[07/02/2022, 21:39:31] [homebridge-eightsleep-pod] This plugin slows down Homebridg
e. The read handler for the characteristic 'Rotation Speed' didn't respond at all!. Please check that you p
roperly call the callback! See https://git.io/JtMGR for more info.

I'm a bit out of my scope to do my own PR, but let me know if I can help in any way. Many thanks!

Unexpected failure occured during plugin load

I'm trying the plugin for the first time and getting the following error on startup. It looks to relate to authentication with Eight Sleep but I have double checked my credentials and they are correct. Are you able to suggest a diagnosis?

[11/24/2023, 11:56:32 AM] [Eight Sleep Thermostat] Something went omething went wrong... Error: Unexpected failure occured during plugin load.wrong... Error: Unexpected failure occured during plugin load.
    at EightSleepThermostatPlatform.discoverDevices (/homebridge/node_modules/homebridge-eightsleepthermostat/src/platform.ts:70:13)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

ERROR LOADING PLUGIN homebridge-eightsleep-pod:

==================== [19/12/2021, 21:23:26] ERROR LOADING PLUGIN homebridge-eightsleep-pod: [19/12/2021, 21:23:26] ReferenceError: window is not defined at Object.<anonymous> (/usr/local/lib/node_modules/homebridge-eightsleep-pod/node_modules/fast-abort-controller/src/index.ts:20:5) at Module._compile (node:internal/modules/cjs/loader:1101:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.<anonymous> (/usr/local/lib/node_modules/homebridge-eightsleep-pod/node_modules/promise-backoff/src/index.ts:2:1) at Module._compile (node:internal/modules/cjs/loader:1101:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) [19/12/2021, 21:23:26] ====================

I have been trying to add the EightSleep Plugin but I keep getting this error after adding the plugin. My config looks like this:

{ "platform": "EightSleepPod", "email": "n***********@gmail.com", "password": "************", "oauthClient": { "id": "0************************8", "secret": "f*********************************************6" } }

UnhandledPromiseRejectionWarning: InvalidUserError: invalid currentDevice.side

When running the plugin I get this error
(node:28588) UnhandledPromiseRejectionWarning: InvalidUserError: invalid currentDevice.side at Object.validateUser [as default] (/usr/lib/node_modules/homebridge-eightsleep-pod/node_modules/eightsleep/src/validateUser.ts:113:11) at EightSleepClientApi.<anonymous> (/usr/lib/node_modules/homebridge-eightsleep-pod/node_modules/eightsleep/src/index.ts:188:24) at Generator.next (<anonymous>) at fulfilled (/usr/lib/node_modules/homebridge-eightsleep-pod/node_modules/eightsleep/dist/cjs/index.js:24:58) at processTicksAndRejections (internal/process/task_queues.js:97:5)

I have omitted the oauth portion of the config as I am not sure where to get that information. The logs also print some of my account information so I am sure I have the correct login information in the config.

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.