I also have a Raspberry Pi with PHP which spits out JSON and that works with HAss for some odd reason. I’ve taken ALL of the headers (including the HTTP 200 success, content-type, etc.) from that response and threw it into my Arduino code but it still did not work. I realize the above curl example shows return of no headers but, believe me I’ve tried every way possible with & w/o headers. Even with identical headers that the RPi succeeds with I’m still getting that annoying fetch REST error above. I can also clearly see good attempts via TCPDUMP when manually running the CURL attempts. The HAss attempt never show up in TCPDUMP.
Any way to debug this? Can I see the URL being called, headers, etc… The logged error entries above are not very actionable. I’ve also tried the LOGGER component in HAss and it showed nothing extra.
Sorry, that’s my fault definitely using the same URL. Not an ID 10 T problem, I swear modified above to match. I also have multiple NodeMCU modules for testing.
Just tried it, changed to wemos_uptime and got same error. Went into HASS UI and badges were missing as usual. Below is a successful RPi with mixed letter case, seems to work well.
I’m no longer getting a single REST Error… so friggin strange… Anyway here’s the Arduino HTTP header that was used with success:
jsonResponse.concat("HTTP/1.x 200 OK\n");
jsonResponse.concat("Content-Type: application/json\n");
jsonResponse.concat("\n"); // do not forget this one
jsonResponse.concat("{\n"); // start of json