mark-wade / homebridge-hive

Hive Thermostat plugin for Homebridge
MIT License
12 stars 5 forks source link

TypeError: Cannot read property 'attributes' of null #19

Open N8OEN opened 6 years ago

N8OEN commented 6 years ago

Hi,

I'm getting the error message below and further down is the debug output. I can see both homebridge and hivethermostat or Home app but show 'no response'. I have deleted 'persist' folder, run update, turned taregt temp to 10' and at one point changed the index frost temp to 7' (this last one has been returned now). Any help or direction would be great, just to check so I'm expecting the right outcome. By setting homebridge on my PI it is mimicking a Hive Hub and then allowing me to connect through the home app?

Thank you in advanced!

Error Message pi@raspberrypi:~ $ homebridge WARNING The program 'node' uses the Apple Bonjour compatibility layer of Avahi. WARNING Please fix your application to use the native API of Avahi! WARNING For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node WARNING The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. WARNING Please fix your application to use the native API of Avahi! WARNING For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister [2018-1-6 23:18:52] Loaded plugin: homebridge-hive [2018-1-6 23:18:52] Registering accessory 'homebridge-hive.HiveThermostat' [2018-1-6 23:18:52] --- [2018-1-6 23:18:52] Loaded config.json with 1 accessories and 0 platforms. [2018-1-6 23:18:52] --- [2018-1-6 23:18:52] Loading 1 accessories... [2018-1-6 23:18:52] [Hive Thermostat] Initializing HiveThermostat accessory... [2018-1-6 23:18:52] [Hive Thermostat] Logging into Hive... Setup Payload: X-HM://0023ISYWY3FIG Scan this code with your HomeKit app on your iOS device to pair with Homebridge:

Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:

┌────────────┐     
│ 031-45-154 │     
└────────────┘     

[2018-1-6 23:18:52] Homebridge is running on port 51826. [2018-1-6 23:18:52] [Hive Thermostat] Logged In [2018-1-6 23:18:52] [Hive Thermostat] Fetching data from Hive API [2018-1-6 23:19:13] [Hive Thermostat] Fetching data from Hive API /usr/lib/node_modules/homebridge-hive/index.js:304 var targetTemperature = data.attributes.targetHeatTemperature.reportedValue; ^

TypeError: Cannot read property 'attributes' of null at HiveThermostat. (/usr/lib/node_modules/homebridge-hive/index.js:304:35) at HiveThermostat. (/usr/lib/node_modules/homebridge-hive/index.js:116:30) at HiveThermostat. (/usr/lib/node_modules/homebridge-hive/index.js:139:4) at Request.self.callback (/usr/lib/node_modules/homebridge-hive/node_modules/request/request.js:186:22) at emitTwo (events.js:126:13) at Request.emit (events.js:214:7) at Request. (/usr/lib/node_modules/homebridge-hive/node_modules/request/request.js:1163:10) at emitOne (events.js:116:13) at Request.emit (events.js:211:7) at IncomingMessage. (/usr/lib/node_modules/homebridge-hive/node_modules/request/request.js:1085:12)

Debug Output pi@raspberrypi:~ $ homebridge WARNING The program 'node' uses the Apple Bonjour compatibility layer of Avahi. WARNING Please fix your application to use the native API of Avahi! WARNING For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node WARNING The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. WARNING Please fix your application to use the native API of Avahi! WARNING For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister [2018-1-6 23:12:44] Loaded plugin: homebridge-hive [2018-1-6 23:12:44] Registering accessory 'homebridge-hive.HiveThermostat' [2018-1-6 23:12:44] --- [2018-1-6 23:12:44] Loaded config.json with 1 accessories and 0 platforms. [2018-1-6 23:12:44] --- [2018-1-6 23:12:44] Loading 1 accessories... [2018-1-6 23:12:44] [Hive Thermostat] Initializing HiveThermostat accessory... [2018-1-6 23:12:44] [Hive Thermostat] Logging into Hive... Setup Payload: X-HM://0023ISYWYEI7N Scan this code with your HomeKit app on your iOS device to pair with Homebridge:

Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:

┌────────────┐     
│ 031-45-154 │     
└────────────┘     

[2018-1-6 23:12:44] Homebridge is running on port 51826. [2018-1-6 23:12:45] [Hive Thermostat] Logged In [2018-1-6 23:12:45] [Hive Thermostat] Fetching data from Hive API [2018-1-6 23:12:46] [Hive Thermostat] IncomingMessage { _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: BufferList { head: null, tail: null, length: 0 }, length: 0, pipes: null, pipesCount: 0, flowing: true, ended: true, endEmitted: true, reading: false, sync: false, needReadable: false, emittedReadable: false, readableListening: false, resumeScheduled: false, destroyed: false, defaultEncoding: 'utf8', awaitDrain: 0, readingMore: false, decoder: null, encoding: null }, readable: false, domain: null, _events: { end: [ [Function: responseOnEnd], [Function] ], close: [ [Function], [Function] ], data: [Function], error: [Function] }, _eventsCount: 4, _maxListeners: undefined, socket: TLSSocket { _tlsOptions: { pipe: false, secureContext: [Object], isServer: false, requestCert: true, rejectUnauthorized: true, session: <Buffer 30 82 05 1b 02 01 01 02 02 03 03 04 02 c0 2f 04 20 52 9f 7d 33 2f 43 51 0e f1 27 36 94 0a 49 95 6e b3 49 9e 3a ae 24 8c 17 d9 72 d4 a6 4a ac 6b b1 04 ... >, NPNProtocols: undefined, ALPNProtocols: undefined, requestOCSP: undefined }, _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, _SNICallback: null, servername: null, npnProtocol: undefined, alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: { close: [Array], end: [Object], finish: [Function: onSocketFinish], _socketEnd: [Function: onSocketEnd], secure: [Function], free: [Function: onFree], agentRemove: [Function: onRemove], drain: [Function: ondrain], error: [Function: socketErrorListener] }, _eventsCount: 9, connecting: false, _hadError: false, _handle: null, _parent: null, _host: 'api-prod.bgchprod.info', _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: [Object], length: 0, pipes: null, pipesCount: 0, flowing: true, ended: false, endEmitted: false, reading: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, resumeScheduled: false, destroyed: true, defaultEncoding: 'utf8', awaitDrain: 0, readingMore: true, decoder: null, encoding: null }, readable: false, domain: null, _maxListeners: undefined, _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: false, needDrain: false, ending: true, ended: true, finished: true, destroyed: true, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: false, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, bufferedRequest: null, lastBufferedRequest: null, pendingcb: 0, prefinished: true, errorEmitted: false, bufferedRequestCount: 0, corkedRequestsFree: [Object] }, writable: false, allowHalfOpen: false, _bytesDispatched: 272, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: null, _requestCert: true, _rejectUnauthorized: true, parser: null, _httpMessage: ClientRequest { domain: null, _events: [Object], _eventsCount: 5, _maxListeners: undefined, output: [], outputEncodings: [], outputCallbacks: [], outputSize: 0, writable: true, _last: true, upgrading: false, chunkedEncoding: false, shouldKeepAlive: false, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, socket: [Circular], connection: [Circular], _header: 'GET /omnia/nodes HTTP/1.1\r\nContent-Type: application/vnd.alertme.zoo-6.1+json\r\nAccept: application/vnd.alertme.zoo-6.1+json\r\nX-Omnia-Client: Hive Web Dashboard\r\nX-Omnia-Access-Token: mlLsMEmwBgD299vVLV6GyrWTSqItgtSC\r\nhost: api-prod.bgchprod.info:443\r\nConnection: close\r\n\r\n', _onPendingData: [Function: noopPendingOutput], agent: [Object], socketPath: undefined, timeout: undefined, method: 'GET', path: '/omnia/nodes', _ended: true, res: [Circular], aborted: undefined, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, [Symbol(outHeadersKey)]: [Object] }, read: [Function], _consuming: true, _idleNext: null, _idlePrev: null, _idleTimeout: -1,

 [Symbol(bytesRead)]: 616 },

connection: TLSSocket { _tlsOptions: { pipe: false, secureContext: [Object], isServer: false, requestCert: true, rejectUnauthorized: true, session: <Buffer 30 82 05 1b 02 01 01 02 02 03 03 04 02 c0 2f 04 20 52 9f 7d 33 2f 43 51 0e f1 27 36 94 0a 49 95 6e b3 49 9e 3a ae 24 8c 17 d9 72 d4 a6 4a ac 6b b1 04 ... >, NPNProtocols: undefined, ALPNProtocols: undefined, requestOCSP: undefined }, _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, _SNICallback: null, servername: null, npnProtocol: undefined, alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: { close: [Array], end: [Object], finish: [Function: onSocketFinish], _socketEnd: [Function: onSocketEnd], secure: [Function], free: [Function: onFree], agentRemove: [Function: onRemove], drain: [Function: ondrain], error: [Function: socketErrorListener] }, _eventsCount: 9, connecting: false, _hadError: false, _handle: null, _parent: null, _host: 'api-prod.bgchprod.info', _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: [Object], length: 0, pipes: null, pipesCount: 0, flowing: true, ended: false, endEmitted: false, reading: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, resumeScheduled: false, destroyed: true, defaultEncoding: 'utf8', awaitDrain: 0, readingMore: true, decoder: null, encoding: null }, readable: false, domain: null, _maxListeners: undefined, _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: false, needDrain: false, ending: true, ended: true, finished: true, destroyed: true, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: false, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, bufferedRequest: null, lastBufferedRequest: null, pendingcb: 0, prefinished: true, errorEmitted: false, bufferedRequestCount: 0, corkedRequestsFree: [Object] }, writable: false, allowHalfOpen: false, _bytesDispatched: 272, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: null, _requestCert: true, _rejectUnauthorized: true, parser: null, _httpMessage: ClientRequest { domain: null, _events: [Object], _eventsCount: 5, _maxListeners: undefined, output: [], outputEncodings: [], outputCallbacks: [], outputSize: 0, writable: true, _last: true, upgrading: false, chunkedEncoding: false, shouldKeepAlive: false, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, socket: [Circular], connection: [Circular], _header: 'GET /omnia/nodes HTTP/1.1\r\nContent-Type: application/vnd.alertme.zoo-6.1+json\r\nAccept: application/vnd.alertme.zoo-6.1+json\r\nX-Omnia-Client: Hive Web Dashboard\r\nX-Omnia-Access-Token: mlLsMEmwBgD299vVLV6GyrWTSqItgtSC\r\nhost: api-prod.bgchprod.info:443\r\nConnection: close\r\n\r\n', _onPendingData: [Function: noopPendingOutput], agent: [Object], socketPath: undefined, timeout: undefined, method: 'GET', path: '/omnia/nodes', _ended: true, res: [Circular], aborted: undefined, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, [Symbol(outHeadersKey)]: [Object] }, read: [Function], _consuming: true, _idleNext: null, _idlePrev: null, _idleTimeout: -1,

 [Symbol(bytesRead)]: 616 },

httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, headers: { 'access-control-allow-credentials': 'true', 'access-control-allow-headers': 'Content-Type, X-Omnia-Client, X-AlertMe-Client, X-Omnia-Access-Token, Authorization, X-Omnia-Client-User', 'access-control-allow-methods': 'GET, POST, DELETE, PUT, OPTIONS', 'cache-control': 'no-cache, no-store', 'content-type': 'application/vnd.alertme.zoo-6.1+json', expires: 'Thu, 01 Jan 1970 00:00:00 GMT', pragma: 'no-cache', vary: 'Accept-Encoding, User-Agent', 'x-zoo-transaction-id': 'c3862612-3bef-46f3-8c85-06f67e86187b', 'transfer-encoding': 'chunked', connection: 'Close' }, rawHeaders: [ 'Access-Control-Allow-Credentials', 'true', 'Access-Control-Allow-Headers', 'Content-Type, X-Omnia-Client, X-AlertMe-Client, X-Omnia-Access-Token, Authorization, X-Omnia-Client-User', 'Access-Control-Allow-Methods', 'GET, POST, DELETE, PUT, OPTIONS', 'Cache-Control', 'no-cache', 'Cache-Control', 'no-store', 'Content-Type', 'application/vnd.alertme.zoo-6.1+json', 'Expires', 'Thu, 01 Jan 1970 00:00:00 GMT', 'Pragma', 'no-cache', 'Vary', 'Accept-Encoding, User-Agent', 'X-Zoo-Transaction-Id', 'c3862612-3bef-46f3-8c85-06f67e86187b', 'transfer-encoding', 'chunked', 'Connection', 'Close' ], trailers: {}, rawTrailers: [], upgrade: false, url: '', method: null, statusCode: 200, statusMessage: 'OK', client: TLSSocket { _tlsOptions: { pipe: false, secureContext: [Object], isServer: false, requestCert: true, rejectUnauthorized: true, session: <Buffer 30 82 05 1b 02 01 01 02 02 03 03 04 02 c0 2f 04 20 52 9f 7d 33 2f 43 51 0e f1 27 36 94 0a 49 95 6e b3 49 9e 3a ae 24 8c 17 d9 72 d4 a6 4a ac 6b b1 04 ... >, NPNProtocols: undefined, ALPNProtocols: undefined, requestOCSP: undefined }, _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, _SNICallback: null, servername: null, npnProtocol: undefined, alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: { close: [Array], end: [Object], finish: [Function: onSocketFinish], _socketEnd: [Function: onSocketEnd], secure: [Function], free: [Function: onFree], agentRemove: [Function: onRemove], drain: [Function: ondrain], error: [Function: socketErrorListener] }, _eventsCount: 9, connecting: false, _hadError: false, _handle: null, _parent: null, _host: 'api-prod.bgchprod.info', _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: [Object], length: 0, pipes: null, pipesCount: 0, flowing: true, ended: false, endEmitted: false, reading: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, resumeScheduled: false, destroyed: true, defaultEncoding: 'utf8', awaitDrain: 0, readingMore: true, decoder: null, encoding: null }, readable: false, domain: null, _maxListeners: undefined, _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: false, needDrain: false, ending: true, ended: true, finished: true, destroyed: true, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: false, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, bufferedRequest: null, lastBufferedRequest: null, pendingcb: 0, prefinished: true, errorEmitted: false, bufferedRequestCount: 0, corkedRequestsFree: [Object] }, writable: false, allowHalfOpen: false, _bytesDispatched: 272, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: null, _requestCert: true, _rejectUnauthorized: true, parser: null, _httpMessage: ClientRequest { domain: null, _events: [Object], _eventsCount: 5, _maxListeners: undefined, output: [], outputEncodings: [], outputCallbacks: [], outputSize: 0, writable: true, _last: true, upgrading: false, chunkedEncoding: false, shouldKeepAlive: false, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, socket: [Circular], connection: [Circular], _header: 'GET /omnia/nodes HTTP/1.1\r\nContent-Type: application/vnd.alertme.zoo-6.1+json\r\nAccept: application/vnd.alertme.zoo-6.1+json\r\nX-Omnia-Client: Hive Web Dashboard\r\nX-Omnia-Access-Token: mlLsMEmwBgD299vVLV6GyrWTSqItgtSC\r\nhost: api-prod.bgchprod.info:443\r\nConnection: close\r\n\r\n', _onPendingData: [Function: noopPendingOutput], agent: [Object], socketPath: undefined, timeout: undefined, method: 'GET', path: '/omnia/nodes', _ended: true, res: [Circular], aborted: undefined, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, [Symbol(outHeadersKey)]: [Object] }, read: [Function], _consuming: true, _idleNext: null, _idlePrev: null, _idleTimeout: -1,

 [Symbol(bytesRead)]: 616 },

_consuming: true, _dumped: false, req: ClientRequest { domain: null, _events: { socket: [Function], response: [Function: bound ], error: [Function: bound ], drain: [Function], prefinish: [Function: requestOnPrefinish] }, _eventsCount: 5, _maxListeners: undefined, output: [], outputEncodings: [], outputCallbacks: [], outputSize: 0, writable: true, _last: true, upgrading: false, chunkedEncoding: false, shouldKeepAlive: false, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, socket: TLSSocket { _tlsOptions: [Object], _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, _SNICallback: null, servername: null, npnProtocol: undefined, alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: [Object], _eventsCount: 9, connecting: false, _hadError: false, _handle: null, _parent: null, _host: 'api-prod.bgchprod.info', _readableState: [Object], readable: false, domain: null, _maxListeners: undefined, _writableState: [Object], writable: false, allowHalfOpen: false, _bytesDispatched: 272, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: null, _requestCert: true, _rejectUnauthorized: true, parser: null, _httpMessage: [Circular], read: [Function], _consuming: true, _idleNext: null, _idlePrev: null, _idleTimeout: -1,

    [Symbol(bytesRead)]: 616 },
 connection: 
  TLSSocket {
    _tlsOptions: [Object],
    _secureEstablished: true,
    _securePending: false,
    _newSessionPending: false,
    _controlReleased: true,
    _SNICallback: null,
    servername: null,
    npnProtocol: undefined,
    alpnProtocol: false,
    authorized: true,
    authorizationError: null,
    encrypted: true,
    _events: [Object],
    _eventsCount: 9,
    connecting: false,
    _hadError: false,
    _handle: null,
    _parent: null,
    _host: 'api-prod.bgchprod.info',
    _readableState: [Object],
    readable: false,
    domain: null,
    _maxListeners: undefined,
    _writableState: [Object],
    writable: false,
    allowHalfOpen: false,
    _bytesDispatched: 272,
    _sockname: null,
    _pendingData: null,
    _pendingEncoding: '',
    server: undefined,
    _server: null,
    ssl: null,
    _requestCert: true,
    _rejectUnauthorized: true,
    parser: null,
    _httpMessage: [Circular],
    read: [Function],
    _consuming: true,
    _idleNext: null,
    _idlePrev: null,
    _idleTimeout: -1,
    [Symbol(asyncId)]: 64,
    [Symbol(bytesRead)]: 616 },
 _header: 'GET /omnia/nodes HTTP/1.1\r\nContent-Type: application/vnd.alertme.zoo-6.1+json\r\nAccept: application/vnd.alertme.zoo-6.1+json\r\nX-Omnia-Client: Hive Web Dashboard\r\nX-Omnia-Access-Token: mlLsMEmwBgD299vVLV6GyrWTSqItgtSC\r\nhost: api-prod.bgchprod.info:443\r\nConnection: close\r\n\r\n',
 _onPendingData: [Function: noopPendingOutput],
 agent: 
  Agent {
    domain: null,
    _events: [Object],
    _eventsCount: 1,
    _maxListeners: undefined,
    defaultPort: 443,
    protocol: 'https:',
    options: [Object],
    requests: {},
    sockets: [Object],
    freeSockets: {},
    keepAliveMsecs: 1000,
    keepAlive: false,
    maxSockets: Infinity,
    maxFreeSockets: 256,
    maxCachedSessions: 100,
    _sessionCache: [Object] },
 socketPath: undefined,
 timeout: undefined,
 method: 'GET',
 path: '/omnia/nodes',
 _ended: true,
 res: [Circular],
 aborted: undefined,
 timeoutCb: null,
 upgradeOrConnect: false,
 parser: null,
 maxHeadersCount: null,
 [Symbol(outHeadersKey)]: 
  { 'content-type': [Array],
    accept: [Array],
    'x-omnia-client': [Array],
    'x-omnia-access-token': [Array],
    host: [Array] } },

request: Request { domain: null, _events: { error: [Function: bound ], complete: [Function: bound ], pipe: [Function], data: [Function], end: [Function] }, _eventsCount: 5, _maxListeners: undefined, headers: { 'Content-Type': 'application/vnd.alertme.zoo-6.1+json', Accept: 'application/vnd.alertme.zoo-6.1+json', 'X-Omnia-Client': 'Hive Web Dashboard', 'X-Omnia-Access-Token': 'mlLsMEmwBgD299vVLV6GyrWTSqItgtSC' }, callback: [Function], readable: true, writable: true, _qs: Querystring { request: [Circular], lib: [Object], useQuerystring: undefined, parseOptions: {}, stringifyOptions: {} }, _auth: Auth { request: [Circular], hasAuth: false, sentAuth: false, bearerToken: null, user: null, pass: null }, _oauth: OAuth { request: [Circular], params: null }, _multipart: Multipart { request: [Circular], boundary: '9a2ee552-76d1-4c94-8065-854e6836bcc6', chunked: false, body: null }, _redirect: Redirect { request: [Circular], followRedirect: true, followRedirects: true, followAllRedirects: false, followOriginalHttpMethod: false, allowRedirect: [Function], maxRedirects: 10, redirects: [], redirectsFollowed: 0, removeRefererHeader: false }, _tunnel: Tunnel { request: [Circular], proxyHeaderWhiteList: [Array], proxyHeaderExclusiveList: [] }, setHeader: [Function], hasHeader: [Function], getHeader: [Function], removeHeader: [Function], method: 'GET', localAddress: undefined, pool: {}, dests: [], __isRequestRequest: true, _callback: [Function: bound ], uri: Url { protocol: 'https:', slashes: true, auth: null, host: 'api-prod.bgchprod.info:443', port: '443', hostname: 'api-prod.bgchprod.info', hash: null, search: null, query: null, pathname: '/omnia/nodes', path: '/omnia/nodes', href: 'https://api-prod.bgchprod.info:443/omnia/nodes' }, proxy: null, tunnel: true, setHost: true, originalCookieHeader: undefined, _disableCookies: true, jar: undefined, port: '443', host: 'api-prod.bgchprod.info', path: '/omnia/nodes', httpModule: { Server: [Object], createServer: [Function: createServer], globalAgent: [Object], Agent: [Object], request: [Function: request], get: [Function: get] }, agentClass: { [Function: Agent] super: [Object] }, agent: Agent { domain: null, _events: [Object], _eventsCount: 1, _maxListeners: undefined, defaultPort: 443, protocol: 'https:', options: [Object], requests: {}, sockets: [Object], freeSockets: {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, maxCachedSessions: 100, _sessionCache: [Object] }, _started: true, href: 'https://api-prod.bgchprod.info:443/omnia/nodes', req: ClientRequest { domain: null, _events: [Object], _eventsCount: 5, _maxListeners: undefined, output: [], outputEncodings: [], outputCallbacks: [], outputSize: 0, writable: true, _last: true, upgrading: false, chunkedEncoding: false, shouldKeepAlive: false, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, socket: [Object], connection: [Object], _header: 'GET /omnia/nodes HTTP/1.1\r\nContent-Type: application/vnd.alertme.zoo-6.1+json\r\nAccept: application/vnd.alertme.zoo-6.1+json\r\nX-Omnia-Client: Hive Web Dashboard\r\nX-Omnia-Access-Token: mlLsMEmwBgD299vVLV6GyrWTSqItgtSC\r\nhost: api-prod.bgchprod.info:443\r\nConnection: close\r\n\r\n', _onPendingData: [Function: noopPendingOutput], agent: [Object], socketPath: undefined, timeout: undefined, method: 'GET', path: '/omnia/nodes', _ended: true, res: [Circular], aborted: undefined, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, [Symbol(outHeadersKey)]: [Object] }, ntick: true, response: [Circular], originalHost: 'api-prod.bgchprod.info:443', originalHostHeaderName: 'host', responseContent: [Circular], _destdata: true, _ended: true, _callbackCalled: true }, toJSON: [Function: responseToJSON], caseless: Caseless { dict: { 'access-control-allow-credentials': 'true', 'access-control-allow-headers': 'Content-Type, X-Omnia-Client, X-AlertMe-Client, X-Omnia-Access-Token, Authorization, X-Omnia-Client-User', 'access-control-allow-methods': 'GET, POST, DELETE, PUT, OPTIONS', 'cache-control': 'no-cache, no-store', 'content-type': 'application/vnd.alertme.zoo-6.1+json', expires: 'Thu, 01 Jan 1970 00:00:00 GMT', pragma: 'no-cache', vary: 'Accept-Encoding, User-Agent', 'x-zoo-transaction-id': 'c3862612-3bef-46f3-8c85-06f67e86187b', 'transfer-encoding': 'chunked', connection: 'Close' } }, read: [Function], body: '{"meta":{},"links":{},"linked":{},"nodes":[]}' }

mpjalexander commented 6 years ago

See #12.

N8OEN commented 6 years ago

I have deleted 'persist' folder, run update, turned taregt temp to 10' and at one point changed the index frost temp to 7' (this last one has been returned now).

@mpjalexander I included in my initial explanation I have tried this option, I had read through #12 prior to posting hence knowing that @mark-wade had added a 'debug' feature. Do you have anythign specific I can try or could you confirm my understanding on the system is to imitate the Hive Hub and I do not actually need one?

Cheers :)

mpjalexander commented 6 years ago

@N8OEN Sorry, it looks like you have a different issue to that described in #12. In #12, the error is on line 306 of index.js. To resolve that error I changed line 306 from: targetTemperature = data.attributes.frostProtectTemperature.reportedValue; to: targetTemperature = 7;

I just realised your error comes from line 304 of index.js: var targetTemperature = data.attributes.targetHeatTemperature.reportedValue;

I don’t know enough to help you on this.

N8OEN commented 6 years ago

Cheers @mpjalexander I completely wiped and started again and now have an error on an earlier line. If in helps after running homebridge it gets to Fetching data from hive api and when i open the Home api it kicks out this error...

[2018-1-13 11:15:56] Homebridge is running on port 51826. [2018-1-13 11:15:56] [Hive Thermostat] Logged In [2018-1-13 11:15:56] [Hive Thermostat] Fetching data from Hive API [2018-1-13 11:16:01] [Hive Thermostat] Fetching data from Hive API /usr/lib/node_modules/homebridge-hive/index.js:197 if ( data.attributes.stateHeatingRelay.reportedValue == 'OFF' ) { ^

TypeError: Cannot read property 'attributes' of null at HiveThermostat. (/usr/lib/node_modules/homebridge-hive/index.js:197:16) at HiveThermostat. (/usr/lib/node_modules/homebridge-hive/index.js:116:30) at HiveThermostat. (/usr/lib/node_modules/homebridge-hive/index.js:139:4) at Request.self.callback (/usr/lib/node_modules/homebridge-hive/node_modules/request/request.js:186:22) at emitTwo (events.js:126:13) at Request.emit (events.js:214:7) at Request. (/usr/lib/node_modules/homebridge-hive/node_modules/request/request.js:1163:10) at emitOne (events.js:116:13) at Request.emit (events.js:211:7) at IncomingMessage. (/usr/lib/node_modules/homebridge-hive/node_modules/request/request.js:1085:12)

thanks in advanced