Comments (10)
it works now, thanks.
It's awesom to be able to switch the firewall rules from inside home assistant :-)
from hass-pfsense.
What do you see in the hass logs?
from hass-pfsense.
2021-10-22 20:40:37 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140020065658912] 'tracker'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1491, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1526, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 658, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 830, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 695, in _handle_entity_call
await result
File "/config/custom_components/pfsense/switch.py", line 248, in async_turn_off
await self.hass.async_add_executor_job(client.disable_filter_rule_by_tracker, tracker)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/pfsense/pypfsense/init.py", line 153, in disable_filter_rule_by_tracker
if rule["tracker"] != tracker:
KeyError: 'tracker'
from hass-pfsense.
I'm a bit confused here, the screenshot seems to indicate the filter became unavailable (was it delete from pfsense?) which means it's odd you could try to toggle at all...I'll make the code more robust for turning on/off rules and we'll see what happens.
from hass-pfsense.
OK, pull the latest code and see what you get..
from hass-pfsense.
i pulled the latest code, deleted the integration and installed again the integration but i still get the error
2021-10-22 21:40:23 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140183731327376] 'tracker'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1491, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1526, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 658, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 830, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 695, in _handle_entity_call
await result
File "/config/custom_components/pfsense/switch.py", line 249, in async_turn_off
await self.coordinator.async_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 165, in async_refresh
await self._async_refresh(log_failures=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 265, in _async_refresh
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 325, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 456, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 489, in _async_write_ha_state
state = self._stringify_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 462, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 869, in state
return STATE_ON if self.is_on else STATE_OFF
File "/config/custom_components/pfsense/switch.py", line 223, in is_on
rule = self._pfsense_get_rule()
File "/config/custom_components/pfsense/switch.py", line 216, in _pfsense_get_rule
if rule["tracker"] == tracker:
KeyError: 'tracker'
from hass-pfsense.
What version of pfSense are you running? Do any of the rules not have a Tracking ID
value as show toward the bottom of the rule edit screen?
from hass-pfsense.
I've pushed another update to fix the most recent error, try again.
from hass-pfsense.
My PFSense version
The rules have a tracking id
I will pull agin the latest code
from hass-pfsense.
Super odd, you must have some rule that's missing the Tracking ID
. Glad we got to the bottom of it though and made the code more robust!
from hass-pfsense.
Related Issues (20)
- The Reported System Temperature Appears to be 9 - 10°C out HOT 1
- After renewing PfSense Certs, Unexpected error fetching PfSense Firewall pfSense state data: [SSL: CERTIFICATE_VERIFY_FAILED], error occurs
- Kill States for Interface HOT 5
- Feature request: Number of leases per interface
- XMLRPC calls makes pfSense php-fpm loop crash in 2.7.0 HOT 9
- Timeout potential fix HOT 2
- Feature request: Ability to adjust traffic shaper HOT 1
- [Bug] Deprecated constants which will be removed in HA Core 2025.1
- Password change HOT 3
- DHCP Count Stuck on 0 HOT 11
- Suggestion
- [feature req] Make storage information available. HOT 1
- Upstream component to Home Assistant HOT 1
- Wake On Lan not working with HA 2024.2.0 HOT 8
- Warnings in HA Logs HOT 2
- vlan dhcp visibility
- gateway group information
- Need help getting started HOT 1
- Opnsense Support? HOT 2
- FR: Add PPPoE Uptime Sensor
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hass-pfsense.