tomaae / homeassistant-mikrotik_router

Mikrotik router integration for Home Assistant
Apache License 2.0
301 stars 50 forks source link

[Feature] POE out status and power #259

Open ckiliboz opened 1 year ago

ckiliboz commented 1 year ago

Is your feature request related to a problem? Please describe.

Is it possible to show the poe status/power information for each poe capable port? Existing poe_out attribute doesn't show if poe is powered or not.

Describe the solution you'd like

Values can be fetch with below command and 2 new attributes can be added to the existing port entity

[/interface ethernet poe monitor ether1 as-value once]->"poe-out-status"
[/interface ethernet poe monitor ether1 as-value once]->"poe-out-power"

Describe alternatives you've considered

Additional context

tomaae commented 1 year ago

Not sure about this yet, adding docs

MikroTik devices with PoE-Out controller (not injector) provides port monitoring option. /interface ethernet poe monitor [find]

Property | Description poe-out-power () | Displays PD power consumption poe-out-voltage () | Displays PoE Voltage which is applied to the PD. poe-out-current () | Displays port current (mA) which is drawn by the PD. name () | Name of an interface poe-out-status () | Shows current PoE-Out status on port

poe-out () | Shows PoE-Out settings

If power-cycle-ping feature is used, /interface ethernet poe monitor [find] will show additional fields: power-cycle-host-alive: <YES/NO> (Shows if monitored host is reachable) power-cycle-after:

tastyllama commented 1 year ago

I would love to see this feature also, it would help to setup automations - EG see if something is getting powered, how much power. Alert if a camera or phone goes down (poe-out-power below a threshold...) or not powering correctly or maybe using too much power. Also for calculations where something is battery powered, in many of our cases when battery power is low, turn off certain ports if power is being used. I'm using your integration to turn on/off using a simple script trigger currently.