pfSense Integration

Thank you for hard work. I having problem enabling entities on this Integration I currently have device trackers enabled and they are working fine. But all of the disabled Entities are saying that they are disabled by the integration

Click the pencil in the upper right, and enable the device.

this is freakinā€™ awesome. already using it to enable / disable openvpn rules based on a simple automation to track my iPhone and when wifi goes offline (means I am away or testing), turn on the firewall rules that allow my openvpn to function. one problem is that old rule entities that I removed from pfsense seem to be showing up under entities not shown, which is where you have to look for rules.

  1. how do I flush this entities list? reloaded the integration, restarted home assistant, but they are still there. I will try to remove the integration next, I guess - edit: that worked :grin:
  2. how do I lookup these rules on my pfsense? I donā€™t see where pfsense refers to rules as filter_rule_1874259885?
  3. this integration has way too much access to pfsense than I need it to for my purpose. does anyone know how to reduce the effective permissions under the user manager, or something else I can do on the pfsense side to allow no access to to pfsense, except the 2 firewall rules I am working with?

Glad you like the integration!

  1. I can probably wipe those in more automated fashion. Several entities I cannot do that but the rules it may be possible.

  2. Itā€™s the created timestamp of the rule. It is pretty much the only possible thing to use as an ā€˜idā€™ since the rules do not otherwise have a legit id associated with them.

  3. The basis for the integration is the xmlrpc api which is built-in and eliminates the need for any third-party plugins or solutions on the fw. The downside is that the xmlrpc api has full control to do anything. Itā€™s unfortunate but until a proper pfsense-supported api with higher granularity is available itā€™s unlikely to change how it works with this integration :frowning:

well, I was able to make your brilliant integration do exactly what I wanted, and think itā€™s kind of clever what I did with it, tbh. I turn off wifi on my phone and the automation turns on the rules that allow openvpn to work, but it kind of feels like I am trying to drive a car from the back seat. been hammering on chatgpt to teach me how to do all this from the pfsense command line using the php shell and php scripts. not a coder at all, but so far, I can get my openvpn server to start and stop with the commandsā€¦

pfSsh.php playback svc stop openvpn server 1
pfSsh.php playback svc start openvpn server 1

I would think that pfsense would have a proper api

Could these log entries in pfSense be caused by this integration, or the UPnP one?

POST /xmlrpc.php HTTP/1.1" 200 170 "-" "Python-xmlrpc/3.10" 

Iā€™m wondering because there are thousands of them a day, and they flood my firewall logs. Trying to track it down. They do come from the Home Assistant IP, but I also use the UPnP integration. One of the two is reaching out a dozen times a minute, all day, every dayā€¦

Any insight would be appreciated.

Thanks,
Steven

Yes those are from the integration!

1 Like

There is a issue on github about supporting toggling openvpn services on/off. Itā€™s a little abnormal because all the other services donā€™t have effectively multiple services for the same thing (ie: dns, etc are either on or off whereas openvpn is either on/off per config). In any case I have a generic hass service where you can invoke any arbitrary php code so it would be easy enough to draft up the necessary bit to invoke that.

oh, I appreciate it but the next day I wrote my first php script with the help of chatgptā€¦

so far, nobody seems to care, but I think itā€™s awesome!

Awesome! As an FYI I have finally gotten around to adding proper switches for all openvpn servers that ā€˜just workā€™. I plan to release relatively soon.

OK Iā€™ve released more robust handling of pfsense service switches in v0.6.0. There should now be a switch per openvpn configuration and any other services with odd behavior should hopefully be much better at starting/stopping now as well.

So how can I quiet them down? LOL

Change the scan interval :slight_smile: I donā€™t really have control over what logging pfsense is doing. Alternatively, ignore them :wink:

First, since I got your attentionā€¦ Thanks a million for all your work on this integration. I donā€™t think enough of us ā€œfreeloadersā€ express our appreciation enough. :+1:

Anyhow, the scan interval was set to 30 seconds, device tracker is offā€¦ I set it to 60 seconds, but it doesnā€™t change. It doesnā€™t seem to break anything, it just seems like useless processor time to me. Not a huge deal, but the scan interval has no effect on these logins.

As you can see, itā€™s and endless flood of entries, so not insignificantā€¦ Just pointing it out because it seems like a lot of unwarranted entries.

Thanks,
Steven

Thanks for the thanks :smiley: basically what should be happening is 10-15 requests every scan interval. Do you have multiple HA installs? Without multiple HA installs my initial thought is something is in a crazy loop (switch is getting toggled non-stop or similar). I may be able to add some logging on the ha/integration side that could give us some insight into what specific methods are getting invoked.

Itā€™s easier for me to work through these kinds of technical issues on github if you donā€™t mind moving it over there.

Yeah, Github is fine. Need a ticket created or something?

I only have the one HA running on a Pi 4. So yeah, letā€™s get over on Github and give it a go. :+1:

Created. Thanks!

I upgraded PFsense to 23.01 from 22.05, I had a heap off errors appearing / crash dumps. I assumed something went wrong with the upgrade and rolled back, however after googling the logs after I rolled back, I suspect this integration was causing them?.. just a guess.

see netgate forum post.

Mostly tracking new version errors here: Compatibility with PfSense 2.7.0 alpha Ā· Issue #123 Ā· travisghansen/hass-pfsense Ā· GitHub

Some have been resolved some I cannot reproduce currently so any help is appreciated.

2 Likes

Hi, love this integration, was a game changer for me for system monitoringā€¦! Thank you!

Since the past couple of weeks the only time interface RTT and loss, in and out bandwidth, and openvpn server connections update is when the integration is first loaded or restarted. Maybe other stuff too but thats what I monitor.

Host metrics like cpu%, load, and Temp are fine. Firewall hasnā€™t changed at all, and I rebooted it just in case. Do you have any thoughts on what I might change in HA to get it working again? I think it started after upgrade to 2023.2.1. pfsense 2.6 on metal.

Thanks