『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
楼主: meishild

[进阶教程] bt-mqtt-gateway 蓝牙网关,新增魅族、蓝牙信号强度

[复制链接]

2

主题

237

帖子

2378

积分

金牌会员

Rank: 6Rank: 6

积分
2378
金钱
2141
HASS币
0
发表于 2019-8-24 21:30:26 | 显示全部楼层
本人小白,这个真的是没法弄了。
回复

使用道具 举报

15

主题

636

帖子

2201

积分

金牌会员

Rank: 6Rank: 6

积分
2201
金钱
1565
HASS币
0
发表于 2019-8-27 15:12:02 | 显示全部楼层
现在用的N1原生蓝牙+小米蓝牙温湿度计,感觉隔了3米,关上门就没信号了。。。。
回复

使用道具 举报

12

主题

67

帖子

1063

积分

论坛技术达人

积分
1063
金钱
946
HASS币
200

教程狂人

 楼主| 发表于 2019-8-27 15:23:53 | 显示全部楼层
telanx 发表于 2019-8-27 15:12
现在用的N1原生蓝牙+小米蓝牙温湿度计,感觉隔了3米,关上门就没信号了。。。。 ...

蓝牙的问题,没办法 蓝牙的距离就是很近
回复

使用道具 举报

9

主题

787

帖子

3858

积分

论坛元老

Rank: 8Rank: 8

积分
3858
金钱
3071
HASS币
87
发表于 2019-9-20 00:38:03 | 显示全部楼层
telanx 发表于 2019-8-27 15:12
现在用的N1原生蓝牙+小米蓝牙温湿度计,感觉隔了3米,关上门就没信号了。。。。 ...

我用的usb蓝牙才惨,只能识别一个房间内
回复

使用道具 举报

1

主题

211

帖子

2295

积分

金牌会员

Rank: 6Rank: 6

积分
2295
金钱
2084
HASS币
0
发表于 2019-9-22 14:26:41 来自手机 | 显示全部楼层
牛,感谢分享
回复

使用道具 举报

2

主题

44

帖子

3106

积分

论坛元老

Rank: 8Rank: 8

积分
3106
金钱
3062
HASS币
0
发表于 2019-10-22 11:36:45 | 显示全部楼层
我的 Hassio addons 無法添加上面兩個地址
想请教一下各位该如何安装,请提点一下
回复

使用道具 举报

23

主题

287

帖子

1474

积分

金牌会员

Rank: 6Rank: 6

积分
1474
金钱
1187
HASS币
0
发表于 2019-10-24 14:34:08 | 显示全部楼层
求详细教程
回复

使用道具 举报

12

主题

262

帖子

1388

积分

金牌会员

Rank: 6Rank: 6

积分
1388
金钱
1126
HASS币
0
发表于 2019-12-28 09:07:00 | 显示全部楼层
meishild 发表于 2019-8-21 14:04
我现在是跑了一周了 没问题,丢数据没出现过,除非距离过远连不上。

请问usb蓝牙适配器用的什么硬件
回复

使用道具 举报

0

主题

68

帖子

246

积分

中级会员

Rank: 3Rank: 3

积分
246
金钱
178
HASS币
0
发表于 2019-12-29 08:55:09 来自手机 | 显示全部楼层
学习学习,看看怎么弄
回复

使用道具 举报

18

主题

704

帖子

4024

积分

元老级技术达人

积分
4024
金钱
3310
HASS币
60
发表于 2020-1-17 01:09:14 | 显示全部楼层
(.venv) root@aml:~/bt-mqtt-gateway# sudo ./gateway.py
01:07:33 Starting
01:07:34 AM Adding 1 mzbtir devices
01:07:34 AM Updating 1 mzbtir devices
01:07:37 AM Fatal error while executing worker command: AttributeError
Traceback (most recent call last):
  File "./gateway.py", line 91, in <module>
    raise e
  File "./gateway.py", line 73, in <module>
    mqtt.publish(_WORKERS_QUEUE.get(timeout=10).execute())
  File "/root/bt-mqtt-gateway/workers_manager.py", line 55, in execute
    for message in self._callback(*self._args):
  File "/root/bt-mqtt-gateway/workers/mzbtir.py", line 72, in status_update
    if self.fail_count > self.max_fail_count:
AttributeError: 'MzbtirWorker' object has no attribute 'max_fail_count'
(.venv) root@aml:~/bt-mqtt-gateway# sudo ./gateway.py -d
2020-01-17 01:07:48,801 INFO bt-mqtt-gw gateway.py:61:<module> - Starting
2020-01-17 01:07:48,803 DEBUG bt-mqtt-gw.mqtt mqtt.py:30:__init__ - Setting LWT to: hostname/lwt_topic
2020-01-17 01:07:49,555 INFO bt-mqtt-gw.workers.mzbtir mzbtir.py:16:_setup - Adding 1 mzbtir devices
2020-01-17 01:07:49,555 DEBUG bt-mqtt-gw.workers.mzbtir mzbtir.py:18:_setup - Adding mzbtir device 'name' (68:3E:34:CC:D3:44)
2020-01-17 01:07:49,556 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:96:register_workers - Added mzbtir config with a 2 seconds timeout
2020-01-17 01:07:49,557 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:106:register_workers - Added mzbtir worker with 300 seconds interval and a 35 seconds timeout
2020-01-17 01:07:49,568 DEBUG bt-mqtt-gw.mqtt mqtt.py:116:callbacks_subscription - Subscribing to: hostname/mzbtir/update_interval
2020-01-17 01:07:49,570 DEBUG bt-mqtt-gw.mqtt mqtt.py:116:callbacks_subscription - Subscribing to: hostname/homeassistant/status
2020-01-17 01:07:49,574 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:67:execute - Execution result of command MzbtirWorker.config: [{'topic': 'sensor/68-3E-34-CC-D3-44/mzbtir_name_temperature/config', 'payload': '{"unique_id": "bt-mqtt-gateway/68-3E-34-CC-D3-44/mzbtir_name_temperature", "name": "mzbtir_68:3E:34:CC:D3:44_temperature", "state_topic": "hostname/mzbtir/name/temperature", "availability_topic": "hostname/mzbtir/name/availability", "device_class": "temperature", "device": {"identifiers": ["68:3E:34:CC:D3:44", "bt-mqtt-gateway/68-3E-34-CC-D3-44/mzbtir_name"], "manufacturer": "Meizu", "model": "btir", "name": "mzbtir_68:3E:34:CC:D3:44"}, "unit_of_measurement": "\\u00b0C"}'}, {'topic': 'sensor/68-3E-34-CC-D3-44/mzbtir_name_humidity/config', 'payload': '{"unique_id": "bt-mqtt-gateway/68-3E-34-CC-D3-44/mzbtir_name_humidity", "name": "mzbtir_68:3E:34:CC:D3:44_humidity", "state_topic": "hostname/mzbtir/name/humidity", "availability_topic": "hostname/mzbtir/name/availability", "device_class": "humidity", "device": {"identifiers": ["68:3E:34:CC:D3:44", "bt-mqtt-gateway/68-3E-34-CC-D3-44/mzbtir_name"], "manufacturer": "Meizu", "model": "btir", "name": "mzbtir_68:3E:34:CC:D3:44"}, "unit_of_measurement": "%"}'}, {'topic': 'sensor/68-3E-34-CC-D3-44/mzbtir_name_battery/config', 'payload': '{"unique_id": "bt-mqtt-gateway/68-3E-34-CC-D3-44/mzbtir_name_battery", "name": "mzbtir_68:3E:34:CC:D3:44_battery", "state_topic": "hostname/mzbtir/name/battery", "availability_topic": "hostname/mzbtir/name/availability", "device_class": "battery", "device": {"identifiers": ["68:3E:34:CC:D3:44", "bt-mqtt-gateway/68-3E-34-CC-D3-44/mzbtir_name"], "manufacturer": "Meizu", "model": "btir", "name": "mzbtir_68:3E:34:CC:D3:44"}, "unit_of_measurement": "%"}'}]
2020-01-17 01:07:49,587 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:174:update_all - Updating all workers
2020-01-17 01:07:49,589 INFO bt-mqtt-gw.workers.mzbtir mzbtir.py:58:status_update - Updating 1 mzbtir devices
2020-01-17 01:07:49,589 DEBUG bt-mqtt-gw.workers.mzbtir mzbtir.py:62:status_update - Updating mzbtir device 'name' (68:3E:34:CC:D3:44)
2020-01-17 01:07:53,353 ERROR bt-mqtt-gw logger.py:50:log_exception - Fatal error while executing worker command: AttributeError
Traceback (most recent call last):
  File "./gateway.py", line 73, in <module>
    mqtt.publish(_WORKERS_QUEUE.get(timeout=10).execute())
  File "/root/bt-mqtt-gateway/workers_manager.py", line 55, in execute
    for message in self._callback(*self._args):
  File "/root/bt-mqtt-gateway/workers/mzbtir.py", line 72, in status_update
    if self.fail_count > self.max_fail_count:
AttributeError: 'MzbtirWorker' object has no attribute 'max_fail_count'
Traceback (most recent call last):
  File "./gateway.py", line 91, in <module>
    raise e
  File "./gateway.py", line 73, in <module>
    mqtt.publish(_WORKERS_QUEUE.get(timeout=10).execute())
  File "/root/bt-mqtt-gateway/workers_manager.py", line 55, in execute
    for message in self._callback(*self._args):
  File "/root/bt-mqtt-gateway/workers/mzbtir.py", line 72, in status_update
    if self.fail_count > self.max_fail_count:
AttributeError: 'MzbtirWorker' object has no attribute 'max_fail_count'
(.venv) root@aml:~/bt-mqtt-gateway# 



这是哪里问题呢?

  workers:
    mzbtir:
      args:
        devices:
          name: 68:3E:34:CC:D3:44
        topic_prefix: mzbtir
      update_interval: 300
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-23 23:32 , Processed in 0.068811 second(s), 31 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表