The Unifi support is really quite nice as it is. +1 for this work.
For the switches with PoE, it seems very appropriate to provide the PoE ports as switch items.
With IoT, I’ve been converting most of my devices over to PoE with PoW splitters from Wifi Texas. Using this I could control or reboot most of my smaller devices in my house.
Current unifi controller support is provided through unifi.py
It look like Unifi.py currently support get.client(currently implemented, get.stats, block/unblock client, get stats, get config and maybe few other things. You may ask developer there to add the support then try get HA dev to add support but not sure if it is even possible.
With that said, I found this script that allow you to do it via CLI but not sure how controller will react to CLI changes
Steps via CLI:
ssh into your switch [email protected]
US.v3.7.12# telnet localhost 2222
Warning!
The changes may break controller settings and only be effective until reboot.
(UBNT) >
(UBNT) >en
(UBNT)# conf
(UBNT) (Config)# interface 0/2
(UBNT) (Config)#poe opmode shutdown
(UBNT) (Config)#exit
EDIT
I do agree though.
This would be great if possible. Would be great to have indoor cam that turn OFF(hardware not software) when I am home or maybe just in room
Did you ever git this to work? I have create a command line switch to do this but cannot get it to work even-though the ssh commands work prefect from the ubuntu server instance the my docker runs on where HA is installed as a container.
Old thread but here’s what I did to turn interior cameras on/off. I have a input.boolean switch to trigger several automation actions. Here’s example for a specific camera off/on.
You could have templates and variables to reduce this but in the interest of security I avoided variables and eval in the shell scripts. Another thing I did is configure ssh on the homeassistant environment to set “strictHostKeyChecking no” to avoid the interactive “Host key verification”.
Edit: I used the log excerpt for shutdown while showing the cam_on script.