I would like to be able to toggle (On/Off POE) POE on unifi switch ports from Loxone commands (http or udp doesnt matter it is working for me).
I have POE Unifi switch US-8-60W. (1-4 port is without POE and ports 5-8 is POE ports).
I am using Node-RED v2.1.3.
I have found related nodes: Toggle POE State of UniFi Switch Ports node-red-contrib-unifi-os
I have installed node-red-contrib-unifi-os and imported Toggle POE State of UniFi Switch Ports and setup Unifi network Aplication in unifi-request node it is inicialized:
Let me inform you that if I connect by putty (SSH) to me Unifi switch US-8-60W and send comand: swctrl poe set auto id 5
POE on port 5 is switched on.
and if I send command: swctrl poe set off id 5
POE on port 5 is switched Off
So switch is working correctly.
Yes this should be possible. You'll need to use an HTTP PATCH command sent to that same endpoint. Just send the JSON key and value that you notice changing.
I'll watch (also @marcus-j-davies will watch, we're together this week ) how things go and might have time this weekend to do a few quick tests if you need more help.
Many many thanks @crxporter for your fast and reply and help!!!
I have read your post many times and also your example link and looks eassy but to be honest I dont want to kill me switch
So at first I triggered unifi-request node and you can see response.
First up: you won't kill the switch. Best case is the command works. Worst case it does nothing and you try another command.
I'm going to give it a try from my side - the thing missing from your PATCH command is the port index, this will have to be added. I'll return back soon with whatever I learn.
@crxporter
Many thanks for your famous reply and help mate and especially your lost time!
To be honest I was trying to find such solution for years!!!!
You are great I love you
Also big thanks to @marcus-j-davies
I have already check and all is working as you sent exactly!
As you can see here in picture I am sending text commands by UDP from loxone and in the switch it is splited to your unifi request nodes (ON or OFF).
Is it ok or I should implement some more simple way...any advise from you please?
I have already give you stars in nodered page and also I have already registered in github and also there give you stars and how I should buy coffe please?
Many many thanks !!!!
@crxporter
Sorry for late reply.
At first let me say big thanks really you are owesome! Great job!!
To be honest, once all working, I went to test in real condition and I have found my switch doesnt support 24V POE where I want to use so I am considering to buy some new unifi switch currently....
Just the question, this way it should be working in any Unifi switch ?
Thanks !
BR
ager
I would expect yes. But there may be more values for PoE mode to set it at 24v - since 24v mode will cook many devices if they aren't 24v PoE compatible.
Sorry I can't help, I don't have any of those switches. I can tell you what to look for though if you decide to get another switch.