Hello!

I need to parse a JSON array like that:

[
{"Test":"Output "},{"Test2":"Output2"}
]

I am using the "HTTP/XML Rest-Sensor" but it shows me the error "Data at the root level is invalid. Line 1, position1."

I read that its because of the "[" at the beginng. Can somebody tell me how I can fix this?


Article Comments

Hi Manuel,

Thank you for the KB-Post. Can you please use the new Rest Custom Sensor for a test? Does it throw the same error?

best regards.


Oct, 2017 - Permalink

Hello, thanks for your help and I tried the "Rest Custom Sensor". Unfortunately it doesn't work for me. Now I get following error: "can not query endpoint can not load entdpoint http://0.0.0.0https://admin......."

Default settings in the "Rest Custom Sensor" with Basic authentication and "channelDiscovery" as REST Configuration.

Best Regards, Manuel


Nov, 2017 - Permalink

Hi there,

As the error message indicates, the requested URL can't work. For example you have the following URL:
http://my-server/json/api/api.php

Then please enter the first part, the domain/hostname into the connection settings of the device:

  • IPv4 Address/DNS Name: my-server
    Afterwards enter the last part, the URL, into the URL field of the sensor:
  • REST Query: /json/api/api.php

    Best regards.

Nov, 2017 - Permalink

Hi there!

It's working now, thanks!

Is it possible to add a hyperlink to the channel names that leads to another site? Atm I just see state number, ID etc. but nothing informative.

Best Regards


Nov, 2017 - Permalink

Hi there,

Unfortunately, that is not possible. You can however add the URL in the device settings as the service url of the device.

Best regards.


Nov, 2017 - Permalink