Closed cymplecy closed 4 years ago
Are you sure that you get that error message when ju inject a timestamp? or could that error message be from a test you did with injecting commands (JSON)?
Pure timestamp as per image 1st attempt at using node ever -just installed it a few minutes beforehand - Windows10 if that makes any diff Tried it twice - same error both times
Ok, then we will make a test like this.
1: inject node (timestamp is ok to use)
2: function node, add this code:
msg.payload = { command: "events"}; return msg;
3: your Unifi node
4: debug node
Please try this example.
That works fine
Perfect. I have made a change in the code and will publish that soon, I think that will solve your first Issue. Do you need any more help about your first issue that you post on the forum, how to disable a AP?
you could to the same thing but replace the command and also add the MAC. Change the code in the function node to this
msg.payload = { command: "disableAP", mac: "device MAC address"}; return msg;
"I have made a change in the code and will publish that soon, I think that will solve your first Issue" Ta :)
"Do you need any more help about your first issue"
I've tried out your function code command and I get this error message
JFI I'm not the OP on that thread
Ahh I see, there is a change in the API. I will correct this, the MAC is not the correct value to identify the AP, you need to use the 24 char device ID. I will make the change to the code and update the Readme.
But the new function will be like this
msg.payload = { command: "disableAP", device_id: "24 char device id"}; return msg;
But that will be implemented in next version
JFI I'm not the OP on that thread Ahh I see, your just testing this out to help the OP.
I have now pushed the new version to NPM
I've upgraded to 0.1.11
Node shows red indicator and I get this in my console log
I will run some tests and see what is causing this error, the code was untested from my side.
Version 0.1.12 includes this fix
Sorry for delay - I (stupidly) decided to upgrade my controller from 4.x to 5.x and it was VERY wrong so I've had to re-setup my network!
Disable now works :)
And enable works as well :)
Thanks for your efforts :) - I'll report back to the forum :)
Just got another error when trying to inject timestamp into node to read accessdevices
I'd sucessfully done it once before so may just be a one-off glitch!
About your last error message. From the error message I could read out that you are injecting the command disableap and it failes because its missing the parameter device_id
so maybe you inject a timestamp but it passes a function node that injects the command or something like that.
I "think" that the node seems to not handle direct timestamp injects consistently (based on other experiences I've had) but I'll wait till I can repeat the error before posting again
I "think" that the node seems to not handle direct timestamp injects consistently (based on other experiences I've had) but I'll wait till I can repeat the error before posting again
There should no be any issues with injecting timestamp, you could inject anything, but if you inject a command then the payload must match that command. So as long as you do not provide the command then it should be fine, and if you inject command then you need to make sure that you follow the information about the command from the Readme file.
OK -I've been thru all the options in the node just using timestamp as an injector and they all worked fine and without error :)
No error - but when I tried 1 (which sends msg.payload.command= "events" - I got events in debug
But then when I press plain timestamp into the node - it did events again even though node was set to AccessPoints
No error - but when I tried 1 (which sends msg.payload.command= "events" - I got events in debug
But then when I press plain timestamp into the node - it did events again even though node was set to AccessPoints
Ahh ok, but if you "deploy" between the tests then it works I guess. In this case the Node remembers the last command and because of that it ignores the one from the drop down. I will make a fix for this that will be included in next release (no need to push just the fix for this bug)
Manged to repeat the last error - I pressed 1 to disable the AP (which worked) and then press plain timestamp 2 which should have listed AccessDevices but instead gave the same error as last time
Yes, same thing. It "remembers" the last command.
Could you publish the fix to NPM please?
Could you publish the fix to NPM please?
Done.
The node is working fine for me on Version 0.1.13 - thanks for all your efforts :)
Using this
getiing this
https://discourse.nodered.org/t/node-red-contrib-unifi/27653