perbrage / sectoralarm

Sector Alarm Node.js Library
MIT License
23 stars 8 forks source link

ERR_PARSING_ERROR #13

Closed gystaph closed 5 years ago

gystaph commented 5 years ago

Hi, I'm trying to get this up and running but I'm getting the parsing error below. I'm using the template suggested in the readme to get "site.info()". I've also tried running your node-red version but with the same error.

How can I debug this further? Running version 2.0.5

Could not parse the response received from Sector Alarm. See innerError for more details
ERR_PARSING_ERROR
perbrage commented 5 years ago

The nodered version is not yet updated to the correct API version, it is in the works.

Can you post your code that you are using with 2.0.5?

gystaph commented 5 years ago

I've redacted some details.

const sectoralarm = require('sectoralarm');

const email = 'abc@gmail.com',
      password = 'abc',
      siteId = '02688123',
      code = '0000',
      lockId = '1',
      sensorId = '1';

var settings = sectoralarm.createSettings();

settings.jsonOutput = false;

sectoralarm.connect(email,password,siteId)
    .then(site => {
        return site.info();
    })
    .then(console.log)
    .catch(error => {
        console.log(error.message);
        console.log(error.code);
    })
gystaph commented 5 years ago

I retried this exact same script today and now its working. Don't know why.