Isaksson / node-red-contrib-unifi

MIT License
52 stars 20 forks source link

setWLanPassword command not working :( #98

Closed MHagreis closed 1 year ago

MHagreis commented 1 year ago

msg.payload.command = setWLanPassword, wlan_id: My-Test x_passphrase: Newpassword

msg.payload.command = setWLanPassword, wlan_id: "My-Test" x_passphrase: "Newpassword"

What am i doing wrong node gives back No Command read works perfect and account is able to write to UNIFI DreamMachine

image

ozett commented 1 year ago

just a guess, (i am not using this), but may you must use curly- brackets{} and set payload-type to JSON

image

Isaksson commented 1 year ago

use this in a function node msg.payload = { command: "setWLanPassword", wlan_id: "you can get the id from the command getWLanSettings", x_passphrase: "New Password"}; return msg;

MHagreis commented 1 year ago

this works perfect thanks problem was is the wlanID this is the last part of the URL in the Unifi controller if you select the WIFI settings in the Unifi controller

thanks or putting me in the right direction now node red can create a password set this to guest wifi and create a QR code to scan :-) solved all my challenges thanks

Isaksson commented 1 year ago

That sounds great 👍