ble_monitor icon indicating copy to clipboard operation
ble_monitor copied to clipboard

has no attribute 'AF_BLUETOOTH'

Open oomichalekoo opened this issue 2 years ago • 21 comments

What happened?

How I can dissable this error?

`Ten błąd pochodzi z niestandardowej integracji.

Logger: root Source: custom_components/ble_monitor/init.py:597 Integration: Passive BLE monitor (documentation, issues) First occurred: 23:16:17 (10 occurrences) Last logged: 23:25:21

Uncaught thread exception Traceback (most recent call last): File "/data/data/com.termux/files/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/data/data/com.termux/files/home/AIS/custom_components/ble_monitor/init.py", line 597, in run mysocket[hci] = aiobs.create_bt_socket(hci) File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/aioblescan/aioblescan.py", line 1691, in create_bt_socket family=socket.AF_BLUETOOTH, type=socket.SOCK_RAW, proto=socket.BTPROTO_HCI AttributeError: module 'socket' has no attribute 'AF_BLUETOOTH' `

Sensor type

No response

Relevant log output

No response

oomichalekoo avatar Dec 14 '22 22:12 oomichalekoo

Please check the FAQ in the documentation. This error (and solution ) is described the faq.

Ernst79 avatar Dec 14 '22 22:12 Ernst79

I dont have bluetooth i am just using esp32

śr., 14 gru 2022, 23:30 użytkownik Ernst Klamer @.***> napisał:

Please check the FAQ in the documentation. This error (and solution ) is described the faq.

— Reply to this email directly, view it on GitHub https://github.com/custom-components/ble_monitor/issues/1070#issuecomment-1352308402, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARWZ7TRHQBVGG5M6K3YX7X3WNJDBVANCNFSM6AAAAAAS7AJYNQ . You are receiving this because you authored the thread.Message ID: @.***>

I just use this

esphome: name: esp32

esp32: board: esp32dev framework: type: arduino

wifi:

ssid: #ASUS_2.4 <- twoja nazwa sieci password: #klucz <- twój klucz do sieci

Enable fallback hotspot (captive portal) in case wifi connection fails

ap: ssid: "Esp32 BT Fallback Hotspot" password: "JdytF7dpLgSs"

captive_portal:

Enable logging

logger:

Enable Home Assistant API - integracja ESPHome

api:

password: !secret password

web_server: port: 80

ota: password: !secret ota_password

esp32_ble_tracker:
ble_gateway: devices: - mac_address: 01:23:45:67:89:AB # <-----------mac twojego inode on_ble_advertise: then: homeassistant.event: event: esphome.on_ble_advertise data: packet: !lambda return packet;

binary_sensor:

  • platform: homeassistant id: ble_gateway_discovery entity_id: binary_sensor.ble_gateway attribute: discovery on_state: then: lambda: id(blegateway).set_discovery(x); nastepnie usuwamy proxy esp komponent z AIS poniewaz jezeli mamy proxy to nie zobaczy nam INODED tak było w moim przypadku może w waszym bedzie inaczej

Dodajemy wpis do configuration.yaml

ble_monitor: discovery: false restore_state: true decimals: 1 period: 60 #<- czas w sekundach devices: - name: iNode mac: D0:F0:18:98:0B:C1 # twoj adres inode oraz wpis do automations.yaml

  • id: '75703755265' # twoja jakas nazwa alias: ESPHome BLE Advertise mode: queued trigger:
    • platform: event event_type: esphome.on_ble_advertise action:
    • service: ble_monitor.parse_data data: packet: '{{ trigger.event.data.packet }}'

oomichalekoo avatar Dec 14 '22 22:12 oomichalekoo

I think you need to disable the bluetooth interface (as you don't have it), with:

ble_monitor:
  bt_interface: "disable"

Ernst79 avatar Dec 18 '22 09:12 Ernst79

Invalid config for [ble_monitor]: value disable does not match regular expression (?i)^(?:[0-9A-F]{2}[:]){5}(?:[0-9A-F]{2})$ @ data['ble_monitor']['bt_interface'][0]. Got 'd'. (See /data/data/com.termux/files/home/AIS/configuration.yaml, line 43).

ble_monitor: bt_interface: disable discovery: false restore_state: true decimals: 1 period: 60 devices: - name: iNode mac: D0:60:58:78:07:C1

dont work i have error Invalid config for [ble_monitor]: value disable does not match regular expression (?i)^(?:[0-9A-F]{2}[:]){5}(?:[0-9A-F]{2})$ @ data['ble_monitor']['bt_interface'][0]. Got 'd'. (See /data/data/com.termux/files/home/AIS/configuration.yaml, line 43).

niedz., 18 gru 2022 o 10:21 Ernst Klamer @.***> napisał(a):

I think you need to disable the bluetooth interface (as you don't have it), with:

ble_monitor: bt_interface: "disable"

— Reply to this email directly, view it on GitHub https://github.com/custom-components/ble_monitor/issues/1070#issuecomment-1356750907, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARWZ7TRTV3IN6KHN5KLE6HLWN3JQRANCNFSM6AAAAAAS7AJYNQ . You are receiving this because you authored the thread.Message ID: @.***>

oomichalekoo avatar Dec 18 '22 09:12 oomichalekoo

You forgot the quote marks " " around disable.

ble_monitor:
  bt_interface: "disable"

Ernst79 avatar Dec 18 '22 09:12 Ernst79

Invalid config for [ble_monitor]: value disable does not match regular expression (?i)^(?:[0-9A-F]{2}[:]){5}(?:[0-9A-F]{2})$ @ data['ble_monitor']['bt_interface'][0]. Got 'd'. (See /data/data/com.termux/files/home/AIS/configuration.yaml, line 43). still dont works

niedz., 18 gru 2022 o 10:39 Ernst Klamer @.***> napisał(a):

You forgot the quote marks " " around disable.

ble_monitor: bt_interface: "disable"

— Reply to this email directly, view it on GitHub https://github.com/custom-components/ble_monitor/issues/1070#issuecomment-1356758527, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARWZ7TRXY5CRBJSNKYCMQGLWN3LWJANCNFSM6AAAAAAS7AJYNQ . You are receiving this because you authored the thread.Message ID: @.***>

oomichalekoo avatar Dec 18 '22 09:12 oomichalekoo

ble_monitor: bt_interface: "disable" discovery: false restore_state: true decimals: 1 period: 60 devices: - name: iNode mac: D0:54:18:58:07:C1

niedz., 18 gru 2022 o 10:44 Michał @.***> napisał(a):

Invalid config for [ble_monitor]: value disable does not match regular expression (?i)^(?:[0-9A-F]{2}[:]){5}(?:[0-9A-F]{2})$ @ data['ble_monitor']['bt_interface'][0]. Got 'd'. (See /data/data/com.termux/files/home/AIS/configuration.yaml, line 43). still dont works

niedz., 18 gru 2022 o 10:39 Ernst Klamer @.***> napisał(a):

You forgot the quote marks " " around disable.

ble_monitor: bt_interface: "disable"

— Reply to this email directly, view it on GitHub https://github.com/custom-components/ble_monitor/issues/1070#issuecomment-1356758527, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARWZ7TRXY5CRBJSNKYCMQGLWN3LWJANCNFSM6AAAAAAS7AJYNQ . You are receiving this because you authored the thread.Message ID: @.***>

oomichalekoo avatar Dec 18 '22 09:12 oomichalekoo

Are you 100% sure. It still says it sees a d (Got 'd'.). It should see a ".

Try it with only

ble_monitor:
  bt_interface: "disable"

first, and later, add the rest.

Ernst79 avatar Dec 18 '22 09:12 Ernst79

Od i tryb only this Inode energy stop working

niedz., 18 gru 2022, 10:51 użytkownik Ernst Klamer @.***> napisał:

Are you 100% sure. It still says it sees a d (Got 'd'.). It should see a ".

Try it with only

ble_monitor: bt_interface: "disable"

first, and later, add the rest.

— Reply to this email directly, view it on GitHub https://github.com/custom-components/ble_monitor/issues/1070#issuecomment-1356760624, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARWZ7TXTOAGE3JP37RSIBNLWN3NDPANCNFSM6AAAAAAS7AJYNQ . You are receiving this because you authored the thread.Message ID: @.***>

oomichalekoo avatar Dec 18 '22 09:12 oomichalekoo

So, no errors now,?

Next, add the full configuration back now.

ble_monitor:
  bt_interface: "disable"
  discovery: false
  restore_state: true
  decimals: 1
  period: 60
  devices:
    - name: iNode
      mac: D0:54:18:58:07:C1

Ernst79 avatar Dec 18 '22 09:12 Ernst79

Ok i wilk try

niedz., 18 gru 2022, 10:56 użytkownik Ernst Klamer @.***> napisał:

So, no errors now,

Next, add the full configuration back now.

ble_monitor: bt_interface: "disable" discovery: false restore_state: true decimals: 1 period: 60 devices: - name: iNode mac: D0:54:18:58:07:C1

— Reply to this email directly, view it on GitHub https://github.com/custom-components/ble_monitor/issues/1070#issuecomment-1356761451, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARWZ7TTJ6UPLHNGOYQFXQMTWN3NWJANCNFSM6AAAAAAS7AJYNQ . You are receiving this because you authored the thread.Message ID: @.***>

oomichalekoo avatar Dec 18 '22 10:12 oomichalekoo

still problem i add

ble_monitor: bt_interface: "disable"

restart HA

add

discovery: false restore_state: true decimals: 1 period: 60 devices: - name: iNode mac: D0:54:48:58:07:C1

and again get error

Invalid config for [ble_monitor]: value disable does not match regular expression (?i)^(?:[0-9A-F]{2}[:]){5}(?:[0-9A-F]{2})$ @ data['ble_monitor']['bt_interface'][0]. Got 'd'. (See /data/data/com.termux/files/home/AIS/configuration.yaml, line 43).

niedz., 18 gru 2022 o 11:08 Michał @.***> napisał(a):

Ok i wilk try

niedz., 18 gru 2022, 10:56 użytkownik Ernst Klamer < @.***> napisał:

So, no errors now,

Next, add the full configuration back now.

ble_monitor: bt_interface: "disable" discovery: false restore_state: true decimals: 1 period: 60 devices: - name: iNode mac: D0:54:18:58:07:C1

— Reply to this email directly, view it on GitHub https://github.com/custom-components/ble_monitor/issues/1070#issuecomment-1356761451, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARWZ7TTJ6UPLHNGOYQFXQMTWN3NWJANCNFSM6AAAAAAS7AJYNQ . You are receiving this because you authored the thread.Message ID: @.***>

oomichalekoo avatar Dec 18 '22 10:12 oomichalekoo

my version ble is 6.4

niedz., 18 gru 2022 o 11:31 Michał @.***> napisał(a):

still problem i add

ble_monitor: bt_interface: "disable"

restart HA

add

discovery: false restore_state: true decimals: 1 period: 60 devices: - name: iNode mac: D0:54:48:58:07:C1

and again get error

Invalid config for [ble_monitor]: value disable does not match regular expression (?i)^(?:[0-9A-F]{2}[:]){5}(?:[0-9A-F]{2})$ @ data['ble_monitor']['bt_interface'][0]. Got 'd'. (See /data/data/com.termux/files/home/AIS/configuration.yaml, line 43).

niedz., 18 gru 2022 o 11:08 Michał @.***> napisał(a):

Ok i wilk try

niedz., 18 gru 2022, 10:56 użytkownik Ernst Klamer < @.***> napisał:

So, no errors now,

Next, add the full configuration back now.

ble_monitor: bt_interface: "disable" discovery: false restore_state: true decimals: 1 period: 60 devices: - name: iNode mac: D0:54:18:58:07:C1

— Reply to this email directly, view it on GitHub https://github.com/custom-components/ble_monitor/issues/1070#issuecomment-1356761451, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARWZ7TTJ6UPLHNGOYQFXQMTWN3NWJANCNFSM6AAAAAAS7AJYNQ . You are receiving this because you authored the thread.Message ID: @.***>

oomichalekoo avatar Dec 18 '22 10:12 oomichalekoo

Version 6.4 of BLE monitor. That is really old. we are at 10.9.2 at the moment.

Anyway. you found a bug, I guess. I checked the code and I think it expects a list. Try the following:

ble_monitor:
  bt_interface:
    - "disable"
  discovery: false
  restore_state: true
  decimals: 1
  period: 60
  devices:
    - name: iNode
      mac: D0:54:48:58:07:C1

Ernst79 avatar Dec 18 '22 10:12 Ernst79

still problem but work with this

ble_monitor: bt_interface: - "disable" discovery: false restore_state: true decimals: 1 period: 60 devices: - name: iNode mac: D0:F0:1f:ff:ff:C1

Logger: root Source: custom_components/ble_monitor/init.py:597 Integration: Passive BLE monitor (documentation, issues) First occurred: 12:05:35 (1 occurrences) Last logged: 12:05:35

Uncaught thread exception Traceback (most recent call last): File "/data/data/com.termux/files/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/data/data/com.termux/files/home/AIS/custom_components/ble_monitor/init.py", line 597, in run mysocket[hci] = aiobs.create_bt_socket(hci) File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/aioblescan/aioblescan.py", line 1691, in create_bt_socket family=socket.AF_BLUETOOTH, type=socket.SOCK_RAW, proto=socket.BTPROTO_HCI AttributeError: module 'socket' has no attribute 'AF_BLUETOOTH'

niedz., 18 gru 2022 o 11:40 Ernst Klamer @.***> napisał(a):

Version 6.4 of BLE monitor. That is really old. we are at 10.9.2 at the moment.

Anyway. you found a bug, I guess. I checked the code and I think it expects a list. Try the following:

ble_monitor: bt_interface: - "disable"

— Reply to this email directly, view it on GitHub https://github.com/custom-components/ble_monitor/issues/1070#issuecomment-1356769951, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARWZ7TWER2WBMW2JORILFQTWN3SZZANCNFSM6AAAAAAS7AJYNQ . You are receiving this because you authored the thread.Message ID: @.***>

oomichalekoo avatar Dec 18 '22 11:12 oomichalekoo

now i check yaml and again get this error Invalid config for [ble_monitor]: value disable does not match regular expression (?i)^(?:[0-9A-F]{2}[:]){5}(?:[0-9A-F]{2})$ @ data['ble_monitor']['bt_interface'][0]. Got 'disable'. (See /data/data/com.termux/files/home/AIS/configuration.yaml, line 42).

niedz., 18 gru 2022 o 12:06 Michał @.***> napisał(a):

still problem but work with this

ble_monitor: bt_interface: - "disable" discovery: false restore_state: true decimals: 1 period: 60 devices: - name: iNode mac: D0:F0:1f:ff:ff:C1

Logger: root Source: custom_components/ble_monitor/init.py:597 Integration: Passive BLE monitor (documentation, issues) First occurred: 12:05:35 (1 occurrences) Last logged: 12:05:35

Uncaught thread exception Traceback (most recent call last): File "/data/data/com.termux/files/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/data/data/com.termux/files/home/AIS/custom_components/ble_monitor/init.py", line 597, in run mysocket[hci] = aiobs.create_bt_socket(hci) File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/aioblescan/aioblescan.py", line 1691, in create_bt_socket family=socket.AF_BLUETOOTH, type=socket.SOCK_RAW, proto=socket.BTPROTO_HCI AttributeError: module 'socket' has no attribute 'AF_BLUETOOTH'

niedz., 18 gru 2022 o 11:40 Ernst Klamer @.***> napisał(a):

Version 6.4 of BLE monitor. That is really old. we are at 10.9.2 at the moment.

Anyway. you found a bug, I guess. I checked the code and I think it expects a list. Try the following:

ble_monitor: bt_interface: - "disable"

— Reply to this email directly, view it on GitHub https://github.com/custom-components/ble_monitor/issues/1070#issuecomment-1356769951, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARWZ7TWER2WBMW2JORILFQTWN3SZZANCNFSM6AAAAAAS7AJYNQ . You are receiving this because you authored the thread.Message ID: @.***>

oomichalekoo avatar Dec 18 '22 11:12 oomichalekoo

hmm, sorry. I will try to create a yaml configuration myself after coming week to see what is wrong.

The only thing you could try is to not use yaml configuration, but use the UI to setup BLE monitor (just delete YAML configuration, and restart HA). You should than be able to configure BLE monitor from the UI. Make sure you disable the Bluetooth Interface.

I will get back to you after the coming week to see what is wrong with YAML

Ernst79 avatar Dec 18 '22 11:12 Ernst79

Ok i wait for your answer

niedz., 18 gru 2022, 12:18 użytkownik Ernst Klamer @.***> napisał:

hmm, sorry. I will try to create a yaml configuration myself after coming week to see what is wrong.

The only thing you could try is to not use yaml configuration, but use the UI to setup BLE monitor (just delete YAML configuration, and restart HA). You should than be able to configure BLE monitor from the UI. Make sure you disable the Bluetooth Interface.

I will get back to you after the coming week to see what is wrong with YAML

— Reply to this email directly, view it on GitHub https://github.com/custom-components/ble_monitor/issues/1070#issuecomment-1356776418, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARWZ7TTP5KRVDY5Q6AIWKKTWN3XHJANCNFSM6AAAAAAS7AJYNQ . You are receiving this because you authored the thread.Message ID: @.***>

oomichalekoo avatar Dec 18 '22 11:12 oomichalekoo

if i use gui i have bluetooth hci_interface: "00"00"00"00"00 <- mac adres i try everything and still have error

niedz., 18 gru 2022 o 12:27 Michał @.***> napisał(a):

Ok i wait for your answer

niedz., 18 gru 2022, 12:18 użytkownik Ernst Klamer < @.***> napisał:

hmm, sorry. I will try to create a yaml configuration myself after coming week to see what is wrong.

The only thing you could try is to not use yaml configuration, but use the UI to setup BLE monitor (just delete YAML configuration, and restart HA). You should than be able to configure BLE monitor from the UI. Make sure you disable the Bluetooth Interface.

I will get back to you after the coming week to see what is wrong with YAML

— Reply to this email directly, view it on GitHub https://github.com/custom-components/ble_monitor/issues/1070#issuecomment-1356776418, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARWZ7TTP5KRVDY5Q6AIWKKTWN3XHJANCNFSM6AAAAAAS7AJYNQ . You are receiving this because you authored the thread.Message ID: @.***>

oomichalekoo avatar Dec 18 '22 20:12 oomichalekoo

Hi are you check this configuration to disable BT ( only can use disable in 7.4 ) but this version dont work on me HA 2022.12.8

niedz., 18 gru 2022 o 21:53 Michał @.***> napisał(a):

if i use gui i have bluetooth hci_interface: "00"00"00"00"00 <- mac adres i try everything and still have error

niedz., 18 gru 2022 o 12:27 Michał @.***> napisał(a):

Ok i wait for your answer

niedz., 18 gru 2022, 12:18 użytkownik Ernst Klamer < @.***> napisał:

hmm, sorry. I will try to create a yaml configuration myself after coming week to see what is wrong.

The only thing you could try is to not use yaml configuration, but use the UI to setup BLE monitor (just delete YAML configuration, and restart HA). You should than be able to configure BLE monitor from the UI. Make sure you disable the Bluetooth Interface.

I will get back to you after the coming week to see what is wrong with YAML

— Reply to this email directly, view it on GitHub https://github.com/custom-components/ble_monitor/issues/1070#issuecomment-1356776418, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARWZ7TTP5KRVDY5Q6AIWKKTWN3XHJANCNFSM6AAAAAAS7AJYNQ . You are receiving this because you authored the thread.Message ID: @.***>

oomichalekoo avatar Jan 02 '23 12:01 oomichalekoo

Hi i instal version 7.5 dissable bluetooth and nie working But version 6.4 report inode every 1 minutę stats in version i have report randomly i have period 60 , reset timer 10 period inode 10 away home 1800 aby sugestion to raport inode every 1 minute

pon., 2 sty 2023, 14:44 użytkownik Michał @.***> napisał:

Ble monitor im version 6.4 dont have dissable BT in gui.Other wersjom font work for me idk why i have HA 2022.13.8

pon., 2 sty 2023, 14:01 użytkownik Michał @.***> napisał:

Or how i can dissable logs error BT

pon., 2 sty 2023, 13:37 użytkownik Michał @.***> napisał:

Hi are you check this configuration to disable BT

niedz., 18 gru 2022 o 21:53 Michał @.***> napisał(a):

if i use gui i have bluetooth hci_interface: "00"00"00"00"00 <- mac adres i try everything and still have error

niedz., 18 gru 2022 o 12:27 Michał @.***> napisał(a):

Ok i wait for your answer

niedz., 18 gru 2022, 12:18 użytkownik Ernst Klamer < @.***> napisał:

hmm, sorry. I will try to create a yaml configuration myself after coming week to see what is wrong.

The only thing you could try is to not use yaml configuration, but use the UI to setup BLE monitor (just delete YAML configuration, and restart HA). You should than be able to configure BLE monitor from the UI. Make sure you disable the Bluetooth Interface.

I will get back to you after the coming week to see what is wrong with YAML

— Reply to this email directly, view it on GitHub https://github.com/custom-components/ble_monitor/issues/1070#issuecomment-1356776418, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARWZ7TTP5KRVDY5Q6AIWKKTWN3XHJANCNFSM6AAAAAAS7AJYNQ . You are receiving this because you authored the thread.Message ID: @.***>

oomichalekoo avatar Jan 03 '23 08:01 oomichalekoo