spbrogan / sensor.mopeka_pro_check

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

Errors setting up sensor #27

Closed alexthoc closed 1 year ago

alexthoc commented 1 year ago

Hi there, I've recently setup my sensor in Home Assistant but I'm getting python errors in the logs:

Error while setting up mopeka_pro_check platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform await asyncio.shield(task) 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/mopeka_pro_check/sensor.py", line 245, in setup_platform service.Start() File "/usr/local/lib/python3.10/site-packages/mopeka_pro_check/service.py", line 151, in Start self._start() File "/usr/local/lib/python3.10/site-packages/mopeka_pro_check/service.py", line 165, in _start self._adapter = get_provider().get_adapter(self._hci_index) File "/usr/local/lib/python3.10/site-packages/bleson/providers/linux/linux_provider.py", line 10, in get_adapter adapter.open() File "/usr/local/lib/python3.10/site-packages/bleson/providers/linux/linux_adapter.py", line 32, in open self._socket.bind((self.device_id,)) OSError: [Errno 19] No such device

My configuration yaml I believe is setup correctly although I've not specified the hci_device as I believe that's optional?

  - platform: mopeka_pro_check
    mopeka_devices:
      - mac: mac_secret
        name: Gas Sensor

I can confirm my sensors are working on the mopeka mobile app. Any help would be appreciated. :)

spbrogan commented 1 year ago

This is a known issue. Basically since this integration was authored ble has been entirely redone in ha. That is great but I haven't yet updated. Many have found that esphome works well to get this info into ha. I authored a component there and it works well. https://esphome.io/components/sensor/mopeka_pro_check.html?highlight=mopeka

Anyway I do plan to rewrite and take advantage of all the recent ble and ble proxy work but no progress yet. See here :https://github.com/spbrogan/sensor.mopeka_pro_check/discussions/22

alexthoc commented 1 year ago

Great thanks @spbrogan I'll look into that. I've essentially bought the mopeka wifi bridge just for this integration, I'm assuming its some esp32 board at its core and that your espHome component would be able to use it? Or does this mean I need to get myself an ESP32 node?

spbrogan commented 1 year ago

I have never used the WiFi thing since that uses their cloud and their service and as far as I know it is running something proprietary. The esphome component basically listens to the ble advertisement and then decodes the message and sends it to ha. You just need an esp32.

alexthoc commented 1 year ago

Thanks @spbrogan, I ended up buying an esp32, loaded it with your component, works like a charm :)