Open aaburger85 opened 2 years ago
It was working previous to the upgrade and then after the upgrade it is now failing? Or it has simply never worked?
it was working on my other HA install prior to me upgrading to pfSense 22.05. This is effectively net new in that I created a new HA install, upgraded to 22.05 on pfSense, and then had the integration fail after configuration.
OK, are you sure something didn't change with the credentials? You may look into the pfsense webserver logs for any pointers as to why it doesn't like the request/user as well..
It isnt failing the credentials from what i can see. These are the only logs:
The failure is relatively low-level from what I can tell. If you can hack the code here: https://github.com/travisghansen/hass-pfsense/blob/main/custom_components/pfsense/pypfsense/__init__.py#L51 and set the value to True
and then restart hass
you should see the raw data. That may give us an indication of what's going on..
Ok will try that out here shortly!
Would i see the error logging in the Core Logs? I dont see a difference after setting the value and restarting:
This error originated from a custom integration.
Logger: custom_components.pfsense
Source: custom_components/pfsense/pypfsense/__init__.py:97
Integration: pfSense (documentation, issues)
First occurred: 9:48:30 AM (3 occurrences)
Last logged: 9:48:57 AM
Unexpected error fetching ww-pfsense pfSense state data: the JSON object must be str, bytes or bytearray, not bool
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh
self.data = await self._async_update_data()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data
return await self.update_method()
File "/config/custom_components/pfsense/__init__.py", line 96, in async_update_data
await hass.async_add_executor_job(lambda: data.update())
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/pfsense/__init__.py", line 96, in <lambda>
await hass.async_add_executor_job(lambda: data.update())
File "/config/custom_components/pfsense/__init__.py", line 333, in update
self._state["telemetry"] = self._get_telemetry()
File "/config/custom_components/pfsense/__init__.py", line 229, in inner
response = func(*args, **kwargs)
File "/config/custom_components/pfsense/__init__.py", line 260, in _get_telemetry
return self._client.get_telemetry()
File "/config/custom_components/pfsense/pypfsense/__init__.py", line 1104, in get_telemetry
data = self._exec_php(script)
File "/config/custom_components/pfsense/pypfsense/__init__.py", line 63, in inner
response = func(*args, **kwargs)
File "/config/custom_components/pfsense/pypfsense/__init__.py", line 97, in _exec_php
response = json.loads(response["real"])
File "/usr/local/lib/python3.10/json/__init__.py", line 339, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not bool
It would be in the raw logs for hass. Not sure where to find those in hassos :(
I think you just have to edit, configuration.yaml with:
logger:
logs:
custom_components.pfsense: debug
However, even with the debug level set, and setting verbose = True on the script im not getting any more context out of the logs.
Yeah, that does not use the logger but just pumps the logs to stdout/stderr of hass.
Is this still an issue?
Attempting to integrate a new home assistant install with my pfSense firewall that was upgraded to 22.05 is failing with the following captured below. I am no programmer so the level of detail provided here is about all I can provide without specific requests.