GithubHelp home page GithubHelp logo

johlc / pfsense-fauxapi-ha Goto Github PK

View Code? Open in Web Editor NEW
16.0 3.0 2.0 1.53 MB

!DEPRECIATED! A custom component for Home Assistant that interfaces with FauxAPI installed on a pfSense device

License: MIT License

Python 100.00%
pfsense-firewall pfsense-fauxapi pfsense home assistant hacs homeassistant homeassistant-components custom python3

pfsense-fauxapi-ha's People

Contributors

johlc avatar meichthys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pfsense-fauxapi-ha's Issues

No function-info.py

Looks great, thanks for your work.

The intructions refer to function-info.py, but it's not in the code

Port Other than 443, Can It Be Configurable?

I have my firewall configured to use 4343 instead of 443 for security purposes (plus it conflict with web services behind it on that port. Try as I might I could not get this going with port 4343.

I tried:

switch:

  • platform: pfsense_fauxapi
    host: 192.168.2.1:4343
    api_key: !secret pf_key
    access_token: !secret pf_token
    rule_filter: ha

switch:

  • platform: pfsense_fauxapi
    host: 192.168.2.1
    port: 4343
    api_key: !secret pf_key
    access_token: !secret pf_token
    rule_filter: ha

switch:

  • platform: pfsense_fauxapi
    host: 192.168.2.1
    server_port: 4343
    api_key: !secret pf_key
    access_token: !secret pf_token
    rule_filter: ha

I also tried all combinations with:

pf_api_restart: "python3 /config/custom_components/pfsense_fauxapi/function-reboot.py 192.168.2.1:4343 PFFAXXX
pf_api_command: "python3 /config/custom_components/pfsense_fauxapi/function-iterate.py 192.168.2.1:4343 PFFAXXX

These were the errors I got:

`
2021-06-24 20:11:53 ERROR (SyncWorker_3) [custom_components.pfsense_fauxapi.switch] Problem getting rule set from pfSense host: 192.168.2.1. Likely due to API key or secret. More Info:HTTPSConnectionPool(host='192.168.2.1', port=443): Max retries exceeded with url: /fauxapi/v1/?action=config_get&__debug=true (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f864280ee20>: Failed to establish a new connection: [Errno 110] Operation timed out'))

2021-06-24 20:18:03 ERROR (SyncWorker_22) [homeassistant.components.command_line] Command failed: python3 /config/custom_components/pfsense_fauxapi/function-iterate.py 192.168.2.1:4343 PFFAcredential1 3jmtdkbfvp3kndq5wswavbq4spakj6pmc82dno4sfc
Traceback (most recent call last):
File "/config/custom_components/pfsense_fauxapi/function-iterate.py", line 26, in
gw_status = FauxapiLib.gateway_status()
File "/config/custom_components/pfsense_fauxapi/PfsenseFauxapi.py", line 95, in gateway_status
return self._api_request('GET', 'gateway_status')
File "/config/custom_components/pfsense_fauxapi/PfsenseFauxapi.py", line 141, in _api_request
raise PfsenseFauxapiException('Unable to complete {}() request'.format(action), json.loads(res.text))
PfsenseFauxapi.PfsenseFauxapiException: ('Unable to complete gateway_status() request', {'callid': '60d520bc375a2', 'message': 'action authorization failed'})
2021-06-24 20:18:04 ERROR (SyncWorker_24) [homeassistant.components.command_line] Command failed: python3 /config/custom_components/pfsense_fauxapi/function-iterate.py 192.168.2.1:4343 PFFAcredential1 3jmtdkbfvp3kndq5wswavbq4spakj6pmc82dno4sfc
Traceback (most recent call last):
File "/config/custom_components/pfsense_fauxapi/function-iterate.py", line 26, in
gw_status = FauxapiLib.gateway_status()
File "/config/custom_components/pfsense_fauxapi/PfsenseFauxapi.py", line 95, in gateway_status
return self._api_request('GET', 'gateway_status')
File "/config/custom_components/pfsense_fauxapi/PfsenseFauxapi.py", line 141, in _api_request
raise PfsenseFauxapiException('Unable to complete {}() request'.format(action), json.loads(res.text))
PfsenseFauxapi.PfsenseFauxapiException: ('Unable to complete gateway_status() request', {'callid': '60d520bc3d358', 'message': 'action authorization failed'})
2021-06-24 20:18:04 ERROR (SyncWorker_16) [homeassistant.components.command_line] Command failed: python3 /config/custom_components/pfsense_fauxapi/function-iterate.py 192.168.2.1:4343 PFFAcredential1 3jmtdkbfvp3kndq5wswavbq4spakj6pmc82dno4sfc
Traceback (most recent call last):
File "/config/custom_components/pfsense_fauxapi/function-iterate.py", line 26, in
gw_status = FauxapiLib.gateway_status()
File "/config/custom_components/pfsense_fauxapi/PfsenseFauxapi.py", line 95, in gateway_status
return self._api_request('GET', 'gateway_status')
File "/config/custom_components/pfsense_fauxapi/PfsenseFauxapi.py", line 141, in _api_request
raise PfsenseFauxapiException('Unable to complete {}() request'.format(action), json.loads(res.text))
PfsenseFauxapi.PfsenseFauxapiException: ('Unable to complete gateway_status() request', {'callid': '60d520bcf0495', 'message': 'action authorization failed'})
2021-06-24 20:18:05 ERROR (SyncWorker_24) [homeassistant.components.command_line] Command failed: python3 /config/custom_components/pfsense_fauxapi/function-iterate.py 192.168.2.1:4343 PFFAcredential1 3jmtdkbfvp3kndq5wswavbq4spakj6pmc82dno4sfc
Traceback (most recent call last):
File "/config/custom_components/pfsense_fauxapi/function-iterate.py", line 26, in
gw_status = FauxapiLib.gateway_status()
File "/config/custom_components/pfsense_fauxapi/PfsenseFauxapi.py", line 95, in gateway_status
return self._api_request('GET', 'gateway_status')
File "/config/custom_components/pfsense_fauxapi/PfsenseFauxapi.py", line 141, in _api_request
raise PfsenseFauxapiException('Unable to complete {}() request'.format(action), json.loads(res.text))
PfsenseFauxapi.PfsenseFauxapiException: ('Unable to complete gateway_status() request', {'callid': '60d520bd02736', 'message': 'action authorization failed'})
2021-06-24 20:18:05 ERROR (SyncWorker_13) [homeassistant.components.command_line] Command failed: python3 /config/custom_components/pfsense_fauxapi/function-iterate.py 192.168.2.1:4343 PFFAcredential1 3jmtdkbfvp3kndq5wswavbq4spakj6pmc82dno4sfc
Traceback (most recent call last):
File "/config/custom_components/pfsense_fauxapi/function-iterate.py", line 26, in
gw_status = FauxapiLib.gateway_status()
File "/config/custom_components/pfsense_fauxapi/PfsenseFauxapi.py", line 95, in gateway_status
return self._api_request('GET', 'gateway_status')
File "/config/custom_components/pfsense_fauxapi/PfsenseFauxapi.py", line 141, in _api_request
raise PfsenseFauxapiException('Unable to complete {}() request'.format(action), json.loads(res.text))
PfsenseFauxapi.PfsenseFauxapiException: ('Unable to complete gateway_status() request', {'callid': '60d520bdae6bd', 'message': 'action authorization failed'})
2021-06-24 20:18:05 ERROR (SyncWorker_4) [homeassistant.components.command_line] Command failed: python3 /config/custom_components/pfsense_fauxapi/function-iterate.py 192.168.2.1:4343 PFFAcredential1 3jmtdkbfvp3kndq5wswavbq4spakj6pmc82dno4sfc

2021-06-24 20:19:11 ERROR (SyncWorker_6) [custom_components.pfsense_fauxapi.switch] Problem getting rule set from pfSense host: 192.168.2.1. Likely due to API key or secret. More Info:HTTPSConnectionPool(host='192.168.2.1', port=443): Max retries exceeded with url: /fauxapi/v1/?action=config_get&__debug=true (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fb73b382460>: Failed to establish a new connection: [Errno 110] Operation timed out'))
`

#Question: Can I get hostnames of clients connected to each interface?

I want to setup a presence detection that uses hostnames instead of IP. How would i accomplish that. I already have the basic sensors working

**Is your feature request related to a problem?no]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Instruction Update

I spent multiple days trying to figure out why I couldn't get this working. Only to find out that I had PFSense setup as HTTP access, when FauxAPI requires HTTPS. Could you add a note to the installation instructions to prevent some other n00b from making my same mistake?

How to use python3 command in HomeAssistant

Thanks for this great repo.
My Problem is that i dont get it how to activate in HomeAssistant to use python3 from the command line.
There are a bunch of intergrations but they seem not to work the way it should with this addon here.

Can you tell how you have done this.

Thanks and have a nice day

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.