spbrogan / sensor.mopeka_pro_check

Home Assistant custom component to support Mopeka Pro Check Tank Level Sensors
Other
21 stars 4 forks source link

PermissionError: [Errno 1] Operation not permitted #32

Closed kevinkey619 closed 1 year ago

kevinkey619 commented 1 year ago

Hi,

I'm getting the below errors on a fresh install of HA core on a RPi4.

Logger: homeassistant.components.sensor Source: custom_components/mopeka_pro_check/sensor.py:245 Integration: Sensor (documentation, issues) First occurred: 01:13:36 (1 occurrences) Last logged: 01:13:36

Error while setting up mopeka_pro_check platform for sensor Traceback (most recent call last): File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform await asyncio.shield(task) File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/home/homeassistant/.homeassistant/custom_components/mopeka_pro_check/sensor.py", line 245, in setup_platform service.Start() File "/srv/homeassistant/lib/python3.9/site-packages/mopeka_pro_check/service.py", line 151, in Start self._start() File "/srv/homeassistant/lib/python3.9/site-packages/mopeka_pro_check/service.py", line 165, in _start self._adapter = get_provider().get_adapter(self._hci_index) File "/srv/homeassistant/lib/python3.9/site-packages/bleson/providers/linux/linux_provider.py", line 11, in get_adapter adapter.off() File "/srv/homeassistant/lib/python3.9/site-packages/bleson/providers/linux/linux_adapter.py", line 103, in off self.send_cmd_value(HCIDEVDOWN, self.device_id) File "/srv/homeassistant/lib/python3.9/site-packages/bleson/providers/linux/linux_adapter.py", line 47, in send_cmd_value fcntl.ioctl(self._socket.fileno(), cmd, value) PermissionError: [Errno 1] Operation not permitted

spbrogan commented 1 year ago

Not sure your exact error. It looks like you might not have access your ble adapter. Regardless this integration doesn't work well with modern HA. In summer of 2022 HA finally added BLE support natively. When they did this they broke this integration. So there are two things.

  1. I have a esphome.io integration that works well with HA and an esp32 device is often a better solution anyway as you can put the device closer to LPG tank. https://esphome.io/components/sensor/mopeka_pro_check.html?highlight=mopeka
  2. Keep track of this discussion as I do have hopes to create a new integration for HA that can use both local ble and proxy ble. https://github.com/spbrogan/sensor.mopeka_pro_check/discussions/22