Smanar / CYD-Domoticz-Remote

WIP project to control your home-automation using Domoticz and a CYD (Cheap touchscreen).
9 stars 2 forks source link

Info panel is not showing all devices. #13

Closed SargonofAssyria closed 1 month ago

SargonofAssyria commented 1 month ago

The info panel only showed the 'temp' devices. After I changed the 'baro' into 'weather', I also got devices under weather. The light and utility don't show any devices. The output of the 4 json are:

light 162346 bytes
temp 24766 bytes
weather 13397 bytes
utility 128093 bytes

So I suspect that the size is the problem. Is there a solution for this problem? Probably in the HTTPGETRequestWithReturn function?

SargonofAssyria commented 1 month ago

Found it, by setting it to false.

    if (!HTTPGETRequestWithReturn(buff, &doc, false)) return;

Streams works in my case.

Smanar commented 1 month ago

Ha ? I think you have found something here. The last flag is a filter, used to decrease size, so with a filter it work better on large size. If it work better with the filter set to false, it's probably because the filter remove too much stuff.

The filter is

    // The filter: it contains "true" for each value we want to keep
    filter["result"][0]["Data"] = true;
    filter["result"][0]["idx"] = true;
    filter["result"][0]["Name"] = true;

I don't see something bad here, but I think, you are right with "streams", can you try with replacing

        if (NeedFilter)
        {
            err = deserializeJson(*doc, client.getString(), DeserializationOption::Filter(filter));
        }

by

        if (NeedFilter)
        {
            err = deserializeJson(*doc, client.getStream(), DeserializationOption::Filter(filter));
        }
SargonofAssyria commented 1 month ago

Oke I process stream now with filter and it works fine...

Smanar commented 1 month ago

Nice, thx, I correct the code.