PJCzx / homebridge-thermostat

Supports thermostat devices on HomeBridge Platform
Apache License 2.0
34 stars 71 forks source link

getting error message #44

Closed roberkane212 closed 4 years ago

roberkane212 commented 4 years ago

SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse (:null:null) at Thermostat. (/usr/local/lib/node_modules/homebridge-thermostat/index.js:93:27) at Request._callback (/usr/local/lib/node_modules/homebridge-thermostat/index.js:65:15) at Request.self.callback (/usr/local/lib/node_modules/homebridge-thermostat/node_modules/request/request.js:185:22) at Request.emit (events.js:198:13) at Request. (/usr/local/lib/node_modules/homebridge-thermostat/node_modules/request/request.js:1161:10) at Request.emit (events.js:198:13) at IncomingMessage. (/usr/local/lib/node_modules/homebridge-thermostat/node_modules/request/request.js:1083:12) at Object.onceWrapper (events.js:286:20) at IncomingMessage.emit (events.js:203:15) at endReadableNT (_stream_readable.js:1145:12) at process._tickCallback (internal/process/next_tick.js:63:19)

phenotypic commented 4 years ago

The JSON your API is returning when you request /status is improperly formatted so the plugin can't parse it, throwing this error. Would you be able to give an example of the JSON your API is trying to return?

roberkane212 commented 4 years ago

"accessory": "Thermostat", "name": "Thermostat", "apiroute": "https://www.mytotalconnectcomfort.com/portal/"

roberkane212 commented 4 years ago

is this wrong? should i input username and password?

phenotypic commented 4 years ago

That looks to be your config.json. Please show what your API returns when you request /status. It should follow this specification.

roberkane212 commented 4 years ago

It’s not I’m getting error message, should I use ip of my thermostat instead