question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with MQTT topic / payload

See original GitHub issue

Describe the bug I used the assistant to integrate it into io.broker. I setup the MQTT connection. But I got two topics while sending updates. 1) homeassistant 2) room-assistent Under topic homeassistant is a JSON structure send. Under room-assistent I get the state and status. Next issue is when I get a new update then I will always received a “not_home”.

Relevant logs `


2020-04-30 09:35:13
Topic: room-assistant/sensor/ble-0dac8737d59b/status
Qos: 0
Retained
online
2020-04-30 09:35:13
Topic: room-assistant/sensor/ble-29cfc0d8ab0d/state
Qos: 0
Retained
not_home
2020-04-30 09:35:13
Topic: room-assistant/sensor/ble-29cfc0d8ab0d/status
Qos: 0
Retained
online
2020-04-30 09:35:13
Topic: room-assistant/sensor/ble-1b8ab8940985/state
Qos: 0
Retained
not_home
2020-04-30 09:35:13
Topic: room-assistant/sensor/ble-1b8ab8940985/status
Qos: 0
Retained
online
2020-04-30 09:35:13
Topic: room-assistant/sensor/ble-0df785719207/state
Qos: 0
Retained
not_home
2020-04-30 09:35:13
Topic: room-assistant/sensor/ble-0df785719207/status
Qos: 0
Retained
online
2020-04-30 09:35:13
Topic: room-assistant/sensor/ble-35b4361de881/state
Qos: 0
Retained
not_home
2020-04-30 09:35:13
Topic: room-assistant/sensor/ble-35b4361de881/status
Qos: 0
Retained
online
2020-04-30 09:35:13
Topic: room-assistant/sensor/ble-4c24980935c0/state
Qos: 0
Retained
not_home
2020-04-30 09:35:13
Topic: room-assistant/sensor/ble-4c24980935c0/status
Qos: 0
Retained
online
2020-04-30 09:35:13
Topic: room-assistant/sensor/ble-7e3ca0205b46/state
Qos: 0
Retained
not_home
2020-04-30 09:35:13
Topic: room-assistant/sensor/ble-7e3ca0205b46/status
Qos: 0
Retained
online
2020-04-30 09:35:13
Topic: room-assistant/sensor/ble-52a5734dfe7a/state
Qos: 0
Retained
not_home
2020-04-30 09:35:13
Topic: room-assistant/sensor/ble-52a5734dfe7a/status
Qos: 0
Retained
online

`

Relevant configuration Paste the relevant parts of your configuration below.

lobal:
  integrations:
    - homeAssistant
    - bluetoothLowEnergy
  instanceName: rpizero
  room: BeaconBLE
homeAssistant:
  mqttUrl: 'http://192.168.1.8:1883'
bluetoothLowEnergy:
  blacklist:
  - 000000000000
  updateFrequency: 8
  maxDistance: 8

Expected behavior Only one topic? If a device is online only publish “online”.

Environment

  • room-assistant version: 2.4.0.
  • installation type: NodeJS
  • hardware: Raspberry Pi Zero W
  • OS: Linux

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
paulrbeerscommented, May 1, 2020

You set a maxdistance of 8.

Use this API to determine what the distance calculation Room-assistant is coming up with… You aren’t specifying a 1 meter measurement for the devices, so it might be calculating the distance as greater than 8 meters…

http://xxx:xxx:xxx:xxx:6415/entities

Change the xxx:xxx:xxx:xxx part to your node IP otherwise that won’t work… 😃

Also, I don’t know what “room: BeaconBLE” is. Granted I haven’t looked through the code, but the room is reported as whatever the instanceID is (unless room was recently added as an extension…) It might be causing a problem with the reporting if room-assistant is fumbling over that setting.

0reactions
BigDicommented, May 6, 2020

Many thanks for your support!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[SOLVED][MQTT] Unable to read topic/payload in home ...
Here come the issues: I have tried defining a sensor in my configuration file, but I seems like it doesn't receive any data,...
Read more >
MQTT Topic and Payload Design Notes - Steve's internet Guide
Designing a topic naming and payload scheme will be an important part of any MQTT deployment. In this tutorial we look at possible...
Read more >
Monitor MQTT Errors - av - Sierra Wireless
The JSON payload is invalid because the timestamp is expected to be a JSON string (format described in AirVantage Reserved topics page). You...
Read more >
MQTT Topics, Wildcards, & Best Practices - HiveMQ
Never use a leading forward slash · Never use spaces in a topic · Keep the MQTT topic short and concise · Use...
Read more >
MQTT message payload - AWS IoT Core
The message payload that is sent in your MQTT messages isn't specified by AWS IoT, unless it's for one of the Reserved topics....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found