I can’t understand what’s going on—please help me.
I started investigating TheengsGateway using a local Python package. Everything worked fine: both BLE devices and the MQTT server were recognized, advertising data was received, and MQTT messages were sent.
Then, I ran TheengsGateway as a Docker container. Everything seemed to work: both BLE devices and the MQTT server were recognized, and advertising data was received…
But MQTT messages are not sent at all. The MQTT server receives the “active” event from the gateway, but that’s it.
I’m using the latest version of the Docker container. Running the pip list
command shows that package versions are the same in both the container and the local host.
I’ve double check container and local debug logs for the gateway parameters - they are the same.
What could be wrong?
Log from local host:
INFO:BLEGateway:Starting BLE scan
INFO:BLEGateway:Connected to MQTT broker
INFO:BLEGateway:Subscribed to home/+/BTtoMQTT/undecoded
.........
DEBUG:BLEGateway:F4:FC:00:00:13:1D:AdvertisementData(local_name='ThermoBeacon', manufacturer_data={16: b'\x00\x00\x1d\x13\x00\x00\xfc\xf4\xe0\x0b@\x01e\x04\x86D\x07\x00'}, service_uuids=['0000fff0-0000-10
INFO:BLEGateway:publishing device `{'name': 'ThermoBeacon', 'id': 'F4:FC:00:00:13:1D', 'rssi': -56, 'brand': 'GENERIC', 'model': 'ThermoBeacon', 'model_id': 'WS02/WS08', 'type': 'THB', 'tempc': 20, 'tempf76294, 'mac': 'F4:FC:00:00:13:1D'}`
DEBUG:BLEGateway:Sent `{"stat_t": "+/+/BTtoMQTT/F4FC0000131D", "dev_cla": "voltage", "unit_of_meas": "V", "state_class": "measurement", "name": "WS02/WS08-volt", "uniq_id": "F4FC0000131D-volt", "val_tpl":": {"ids": ["F4FC0000131D"], "cns": [["mac", "F4FC0000131D"]], "mf": "GENERIC", "mdl": "WS02/WS08", "name": "ThermoBeacon-00131D", "via_device": "TheengsGateway"}}` to topic `homeassistant/sensor/F4FC0000
DEBUG:BLEGateway:Sent `{"stat_t": "+/+/BTtoMQTT/F4FC0000131D", "dev_cla": "temperature", "unit_of_meas": "\u00b0C", "state_class": "measurement", "name": "WS02/WS08-tempc", "uniq_id": "F4FC0000131D-tempc" }}", "device": {"ids": ["F4FC0000131D"], "cns": [["mac", "F4FC0000131D"]], "mf": "GENERIC", "mdl": "WS02/WS08", "name": "ThermoBeacon-00131D", "via_device": "TheengsGateway"}}` to topic `homeassistant/se
DEBUG:BLEGateway:Sent `{"stat_t": "+/+/BTtoMQTT/F4FC0000131D", "dev_cla": "humidity", "unit_of_meas": "%", "state_class": "measurement", "name": "WS02/WS08-hum", "uniq_id": "F4FC0000131D-hum", "val_tpl": {"ids": ["F4FC0000131D"], "cns": [["mac", "F4FC0000131D"]], "mf": "GENERIC", "mdl": "WS02/WS08", "name": "ThermoBeacon-00131D", "via_device": "TheengsGateway"}}` to topic `homeassistant/sensor/F4FC000013
DEBUG:BLEGateway:Sent `{"stat_t": "+/+/BTtoMQTT/F4FC0000131D", "name": "WS02/WS08-time", "uniq_id": "F4FC0000131D-time", "val_tpl": "{{ value_json.time | is_defined }}", "device": {"ids": ["F4FC0000131D"]ERIC", "mdl": "WS02/WS08", "name": "ThermoBeacon-00131D", "via_device": "TheengsGateway"}}` to topic `homeassistant/sensor/F4FC0000131D-time/config`
DEBUG:BLEGateway:Sent `{"stat_t": "+/+/BTtoMQTT/F4FC0000131D", "dev_cla": "temperature", "unit_of_meas": "\u00b0C", "state_class": "measurement", "name": "WS02/WS08-tempc_max", "uniq_id": "F4FC0000131D-te| is_defined }}", "device": {"ids": ["F4FC0000131D"], "cns": [["mac", "F4FC0000131D"]], "mf": "GENERIC", "mdl": "WS02/WS08", "name": "ThermoBeacon-00131D", "via_device": "TheengsGateway"}}` to topic `home
.........
INFO:BLEGateway:Sent 15 messages to MQTT
Log from the docker container:
theengs-gateway | INFO:BLEGateway:Starting BLE scan
theengs-gateway | INFO:BLEGateway:Connected to MQTT broker
theengs-gateway | INFO:BLEGateway:Subscribed to home/TheengsGateway/commands
.........
theengs-gateway | DEBUG:BLEGateway:F4:FC:00:00:13:1D:AdvertisementData(local_name='ThermoBeacon', manufacturer_data={16: b'\x00\x00\x1d\x13\x00\x00\xfc\xf4l\x01\x9f\x00\x00\x00\x1e\x01^\xb3\x06\x00'}, 9b34fb'], tx_power=0, rssi=-64)
theengs-gateway | DEBUG:BLEGateway:4F:65:2C:7B:A9:F6:AdvertisementData(manufacturer_data={76: b'\x07\x19\x01\x0f +\x99\x8f\x00\x00\x08\xa0\xce\xee\xc5\x06\x10\x17\xafs\xce\x16V\xf4\x16I\n'}, rssi=-74)
theengs-gateway | DEBUG:BLEGateway:B4:0E:CF:4E:13:F2:AdvertisementData(local_name='TL-B40ECF4E13F1', manufacturer_data={256: b'@\x00'}, rssi=-84)
.........
INFO:BLEGateway:Sent 0 messages to MQTT