travisghansen / hass-pfsense

pfSense integration with Home Assistant
191 stars 27 forks source link

Feature Request: Interface Duplex Attribute #66

Closed hockey6611 closed 2 years ago

hockey6611 commented 2 years ago

Thank you for the excellent integration! I am wondering if it is possible to add the current media/duplex of interfaces as an attribute to the interface sensors? I am hoping this is possible with xmlrpc, but I am not knowledgeable on this feature to know if it is possible.

Screenshot 2022-02-18 131143 tempsnip

My use case for this would be to set up a template sensor in HA for if the duplex changes to anything from full duplex. I have the unfortunate issue where my WAN interface, very occasionally and silently, drops to 100baseTX and requires me to reseat the cable between modem and router. However, I don't usually realize this until streaming a movie and it buffers. Checking this issue is usually the last thing I think of 😅. It is a long run and replacing, and further troubleshooting, is not worth it yet, given the infrequency of the issue. But an alert from HA would be perfect!

travisghansen commented 2 years ago

I'll get it released after a couple other things land: https://github.com/travisghansen/hass-pfsense/commit/84fbbeb5d876afe6d2929ff6c754380c82044967

hockey6611 commented 2 years ago

Looks like a quick addition, that's awesome, thank you!

hockey6611 commented 2 years ago

Is there a way to expose the next branch in HACS to easily test this addition?

travisghansen commented 2 years ago

Released in v0.5.0. I've introduced 2 new services exec_php and exec_command which will allow you to do any arbitrary actions on the firewall. With those you should be able to reset nics or any other crazy ideas you can come up with :)