planetk / homebridge-netatmo

This is a homebridge plugin for several netatmo devices
Apache License 2.0
108 stars 25 forks source link

problem reading config.json #65

Open GasCZ opened 6 years ago

GasCZ commented 6 years ago

Hello,

everytime I try to start homebridge I get "There was a problem reading your config.json file." error.

I use code as you recommended - "platforms": [ { "platform": "netatmo", "name": "netatmo platform", "ttl": 10, "auth": { "client_id": "XXXXX Create at https://dev.netatmo.com/", "client_secret": "XXXXX Create at https://dev.netatmo.com/", "username": "your netatmo username", "password": "your netatmo password" } } ],

When I verified this .json on jsonlint.com site, I got another error "Error: Parse error on line 1". So there must be something wrong with the code. I use Atom text editor to edit config.json.

Can you help me with this problem please?

Thank you in advance!

planetk commented 6 years ago

Hi,

did you keep the rest of the config file as well? (The bridge and description entry?) Does jsonlint tell you anything else about the reason? you might want to remove all the content leaving just the curly brackets and then paste the inner content step by step. Be aware of the ","

Does your password contain quotation marks? if so, you need to escape them, or even better use a different password...

Did you use a program like MS-Word, Openoffice, Pages for editing? These program tend to replace Qutation marks with styled versions, which are not allowed in json.

Hope this helps...

S474N commented 6 years ago

This is correct sample code with { and }:

{ 
  "platforms": [
        {
            "platform": "netatmo",
            "name": "netatmo platform",
            "ttl": 10,
            "auth": {
                "client_id": "XXXXX Create at https://dev.netatmo.com/",
                "client_secret": "XXXXX Create at https://dev.netatmo.com/",
                "username": "your netatmo username",
                "password": "your netatmo password"
            }
        }
    ]
}
GasCZ commented 6 years ago

@S474N Thank you, now the file is validated but the issue remains the same.

I use Atom editor, which was recommended for this purpose.

I'm really confused, any ideas?

S474N commented 6 years ago

It's only platforms code, you must have also section "bridge". See my example at down on page: http://www.s474n.com/apple-homekit-homebridge-netatmo/

GasCZ commented 6 years ago

@S474N Děkuji za odpověď a pomoc. Dovolím si upozornit, že ve vzorovém JSON file na vaší stránce je na řádku 21 čárka navíc mezi závorkami. Po jejím odstranění je JSON file validován a funkční a díky tomu se mi podařilo zprovoznit netatmo na homebridge. Ještě jednou díky za pomoc.

S474N commented 6 years ago

Mas pravdu, vzniklo to vykopirovanim z funkcniho souboru, kde mam pochopitelne vice sekci v konfiguraku. Hned jsem to odstranil. Diky za zpetnou odezvu.