Json api to change segment name

Hello!

Wanted to change the segmentname of segment id 0 to XXX
WLED Version 0140-b4

curl -X POST “http://192.168.8.71/json/state” --data {“nn”:[{“0”:“XXX”}]} --header “Content-Type: application/json” --verbose

Does not work, got it from Chagpt

Maybe someone can help me. THX

I do not have access to Chagpt but this works in windows


send_wled_text.txt (109 Bytes)

IT WORKS!
Thank you so much!!!

I’m trying to do the same thing via MQTT (using Home Assistant) but it doesn’t seem to work. Where am I wrong?

topic: wled/2de761/json
payload: {"seg":[{"id":0,"n":"07_10"}]}

who said wled/<mac>/json?

it is wled/<mac>/api

I misinterpreted this:

WLED versions since 0.8.4 implement a powerful JSON API over HTTP.
It is accessible using the /json subpage.

Sorry!

It says HTTP. :smiley:

For anyone finding this that uses mac, the MacOS terminal command syntax is as follows:

curl http://192.168.1.163/json -d '{"seg":[{"id":0,"n":"Your text here"}]}' -H "Content-Type: application/json"

but replace the IP address with the IP of your target controller