I have tried numerous variations of this and still can’t seem to get it to work.
No matter what I do, the sensor still has “unknown” as it’s state. I checked the json output from the api and it contains the correct fields. Below is my config file code.
I tried that also. Same results.
I copied the JSON data into the template developer and tried the value_template and it worked correctly.
Just not making sense. It seems like the JSON data is not being captured by HA… still chasing it. I’ll see what I can figure out.
Your JSON looks basically the same as mine. I just can’t seem to make the “REST” sensor to work. I seems like HA is not reading the data…
I’ve tried about everything I can think of. I can’t tell if HA is even receiving any data back.
Guess I need to get away for a while and then maybe a fresh look at it will point something out.
That seems to work just fine. Never could get the REST sensor to work. It’s probably something to do with the API key, but I didn’t get it figured out.
Thanks for this. Working well. Only change I made was to the value template for the octoprint connection switch. When printing the ready value is set to false which turns the switch off in the frontend.
I noticed you have a few filament sensors and a filament switch in your lovelace configuration and I also see a reference to “sensor.filament_menge_api” in your config, but I can’t figure out where that’s coming from. Am I missing something?
Edit: found the source of the sensors It was right where I was looking at Still curious about the filament switch though!
I’m still trying to get commands setup in HA for Octoprint. I am running HA in Docker. If I open an SSH terminal on the host system Docker is running on and run this command:
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
> <title>400 Bad Request</title>
> <h1>Bad Request</h1>
> <p>The browser (or proxy) sent a request that this server could not understand.</p>
I fixed my issue, I went back and got Rest Commands working. Now, however I can’t get my sensors that display the STL File name, size, and filament length to work. They all say “unknown”. I feel if I get one figured out, the other two will work also. Here is what I’ve tried:
I can see the correct JSON in a browser, for some reason, the sensor just isn’t pulling the data. Someone else had that issue with a Rest Sensor and got this command line working, however I’m not having luck with either.