(SOLVED) Setting temperature profile (tool and bed together) via API

Is there a way to set a profile via the API? Instead of setting the tool and bed separately and having to hard code the temperatures in the request, I'd like to grab the existing temperature profiles in OctoPrint and call them from the API. Even just getting the temperatures from the profiles would be enough.

Do you mean the "Temperatures" settings dialog presets?

I don't have any temp settings for a specific printer profile.
image

And the mentioned temperature presets/profiles are set by the UI - they're available on the settings API, and then the frontend interprets the profile and just sends the temperatures itself, rather than sending 'set the PLA profile'.

Yea, figured it would be like that. But still, to send "tool = 210 bed = 60" for PLA, it needs to know PLA_tool = 210 and PLA_bed = 60. Are these two variables (PLA_tool and PLA_bed) accessible from the API?

They are on the settings API, under temperature.profiles.

1 Like

Alright, I didn't quite get what you meant by "they're available on the settings API"; after looking around, I found out how to grab the settings from here.

For future readers, you can get all your saved profiles with this Python script:

import requests

json = requests.get(url="http://YOUR-OCTOPI-URL/api/settings", headers=headers).json()

for temp in json["temperature"]["profiles"]:
    print(temp)

This prints out all your temperature profiles. Some more parsing and you can get down to each individual temperature.

1 Like