OPNsense Forum

English Forums => General Discussion => Topic started by: burntoc on July 31, 2020, 06:08:27 pm

Title: Moving to OPNsense, will my Home Assistant API toggles still work?
Post by: burntoc on July 31, 2020, 06:08:27 pm
Hello everyone,

I am very much leaning towards finally making the move over to OPNsense, but there's at least one key capability that would be a showstopper if I had to give it up.  Currently I use the following code so that Home Assistant has switches I can use to toggle my FW rules on and off to block my kids internet on pfSense:

https://github.com/dgshue/home-assistant-custom-components (https://github.com/dgshue/home-assistant-custom-components)

It uses FauxAPI for this.  I know OPNsense has a basic API.  Would I be able to continue to use this via the built in API or FauxAPI?  If not, is there any other sort of easy way to create toggles between HA and OPNsense? 
Title: Re: Moving to OPNsense, will my Home Assistant API toggles still work?
Post by: marjohn56 on August 02, 2020, 04:08:05 pm
Have a read of this https://docs.opnsense.org/development/api/plugins/firewall.html (https://docs.opnsense.org/development/api/plugins/firewall.html).


You can do what you want very easily, or just set up schedule in the rules you want to enforce, it's all in the doc.





Title: Re: Moving to OPNsense, will my Home Assistant API toggles still work?
Post by: burntoc on August 03, 2020, 04:30:23 am
Thanks, but I compared the docs with the code from the existing component and I realized I have no idea where to even begin to make this work.  I'm afraid it is well beyond me.  It's SUPER helpful being able to toggle the rules from the Home Assistant app on my phone, so I think I'm going to have to hope something equally simple comes this way before I make the switch as this is something I use several times each week.