JSON API Buttons

Hi all,

I have some presets for my toilet during the day and some for the night. I have Home Assistant that should change the playlists for the input button. I want to have this logic decentral in WLED, so it keeps working even without HA.

For now it works like a charm. my PIR sensor triggers playlist 3.

For in the night, a red light

During the day I want to change the macro 3. to lets say 9. So I have more presets in the playlists.

Is there a way to reassign button-short to 9 instead of 3 via rest/json/home-assistant?

ps. also asked on reddit
https://www.reddit.com/r/WLED/comments/1giod86/setup_buttons_via_jsonapi/

Use /json/cfg endpoint to upload a new configuration (in JSON format).
You’ll need to examine cfg.json for correct JSON API.

Yes! Not so much documentation
But if i browse /json/cfg
I get this halfway:

"btn": {
"max": 4,
"pull": true,
"ins": [
{
"type": 2,
"pin": [
4
],
"macros": [
0,
0,
0
]
},
{
"type": 5,
"pin": [
12
],
"macros": [
3,
4,
0
]
},

Just a normal POST works! Thanks alot

To help the project you can write the documentation.