Why can't pi w [monitor] talk to my mqtt hassio addon?

But what happens when you run your own broker OUTSIDE of hassio?

how will that help me resolve the add-on for mqtt in hassio?

Huh?

Have you tried hooking up a client to your broker like mqtt.fx to verify it works? There’s really nothing to an MQTT broker. It either works or it doesn’t. If you can connect a client to it, then the broker isn’t the problem.

So i tried cloudmqtt for shits, and it receives the mqtt topics, however home assistant is still not updating or retrieving information from cloudmqtt

Boggles my mind, why my server wont work, follows guide pricesely, and no connection

Anyways, this is what i have set up for sensors in home assistant

2019-01-06 05:01:39: New client connected from 108.XXX.XXX.XXX as 576aed29-4090-4746-8041-800175083ccf (c1, k60, u’dbcrhhws’).
2019-01-06 05:01:39: No will message specified.
2019-01-06 05:01:39: Sending CONNACK to 576aed29-4090-4746-8041-800175083ccf (0, 0)
2019-01-06 05:01:54: Received SUBSCRIBE from 576aed29-4090-4746-8041-800175083ccf
2019-01-06 05:01:54: monitor/media_room/E4:E4:AB:80:14:92 (QoS 0)
2019-01-06 05:01:54: Sending SUBACK to 576aed29-4090-4746-8041-800175083ccf
2019-01-06 05:02:09: Received PINGREQ from mosqsub|31442-raspberry
2019-01-06 05:02:09: Sending PINGRESP to mosqsub|31442-raspberry
2019-01-06 05:02:54: Received PINGREQ from 576aed29-4090-4746-8041-800175083ccf
2019-01-06 05:02:54: Sending PINGRESP to 576aed29-4090-4746-8041-800175083ccf
2019-01-06 05:03:09: Received PINGREQ from mosqsub|31442-raspberry
2019-01-06 05:03:09: Sending PINGRESP to mosqsub|31442-raspberry
2019-01-06 05:03:55: Received PINGREQ from 576aed29-4090-4746-8041-800175083ccf

  - platform: mqtt
    name: "Davids Iphone"
    state_topic: "monitor/media_room/E4:E4:AB:80:14:92"
    value_template: "{{ value_json.confidence }}"
    unit_of_measurement: '%'

  - platform: min_max
    name: 'Home Occupancy Confidence of E4:E4:AB:80:14:92'
    type: max
    round_digits: 0
    entity_ids:
      - sensor.media_room

Zero values for my sensor node

Please all stop posting drivel.

Do NOT rely on the internal home assistant mqtt broker, it is crap.

So (assuming your post is correct and you are using hassio as your home assistant install) use the hassio mosquitto addon. When you install the addon it requires you to add a username and password. These are not the same as the username and password you use to log in to home assistant.

Once you have that running, give the mosquitto username and password to the monitor program, via @andrewjfreyer’s instructions.

1 Like

And you completely ignored my suggestion.

[INFO] found myuser on local database
1546789533: New client connected from 192.168.1.214 as e4a53988-976a-4564-83b9-cff9989b3a89 (c1, k60, u’myuser’).
1546789540: Client mosqsub|18882-raspberry has exceeded timeout, disconnecting.
1546789540: Socket error on client mosqsub|18882-raspberry, disconnecting.
1546789589: New connection from 192.168.1.228 on port 1883.
[INFO] found myuser on local database
1546789589: New client connected from 192.168.1.228 as mosqpub|22768-raspberry (c1, k60, u’myuser’).
1546789594: Client mosqpub|22768-raspberry disconnected.
1546789594: New connection from 192.168.1.228 on port 1883.
[INFO] found myuser on local database
1546789594: New client connected from 192.168.1.228 as mosqpub|23306-raspberry (c1, k60, u’myuser’).
1546789594: New connection from 192.168.1.228 on port 1883.
[INFO] found myuser on local database
1546789594: New client connected from 192.168.1.228 as mosqsub|23431-raspberry (c1, k60, u’myuser’).
1546789594: Client mosqpub|23306-raspberry disconnected.

{
  "logins": [
    {
      "username": "myuser",
      "password": "passwordthatdoesnotmatchuseraccounts"
    }
  ],
  "anonymous": false,
  "customize": {
    "active": false,
    "folder": "mosquitto"
  },
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

updated mqtt_preferences to point to my homeassistant and still getting errors

i noticed i am getting this error in home assistant since trying to setup mqtt

Sun Jan 06 2019 07:46:17 GMT-0800 (Pacific Standard Time)

Unhandled exception
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py”, line 410, in start
await resp.prepare(request)
File “/usr/local/lib/python3.6/site-packages/aiohttp/web_response.py”, line 300, in prepare
return await self._start(request)
File “/usr/local/lib/python3.6/site-packages/aiohttp/web_response.py”, line 608, in _start
return await super()._start(request)
File “/usr/local/lib/python3.6/site-packages/aiohttp/web_response.py”, line 367, in _start
await writer.write_headers(status_line, headers)
File “/usr/local/lib/python3.6/site-packages/aiohttp/http_writer.py”, line 110, in write_headers
self._write(buf)
File “/usr/local/lib/python3.6/site-packages/aiohttp/http_writer.py”, line 67, in _write
raise ConnectionResetError(‘Cannot write to closing transport’)
ConnectionResetError: Cannot write to closing transport

My local server with mqtt installed on it works as expected

And what happens if you publish to this topic?

monitor/media_room/E4:E4:AB:80:14:92

What happens when you try to connect to your hassio mqtt add-on with mqtt.fx?

Nothing… not sure what to do from here, i can create a custom command with monitor/media_room/mac, but monitor isn’t connecting

this is my mqtt-preference file

# MOSQUITTO PREFERENCES
#
# ---------------------------

# IP ADDRESS OF MQTT BROKER
mqtt_address=192.168.1.226

# MQTT BROKER USERNAME (OR BLANK FOR NONE)
mqtt_user=user

# MQTT BROKER PASSWORD (OR BLANK FOR NONE)
mqtt_password=password

# MQTT PUBLISH TOPIC ROOT
mqtt_topicpath=monitor

# PUBLISHER IDENTITY
mqtt_publisher_identity='media_room'

# MQTT PORT
mqtt_port='1883'

# MQTT CERTIFICATE FILE (LEAVE BLANK IF NONE)

So, it works if you manually publish the topic, from a client app? But it doesn’t work from the monitor script? Seems like an issue with the monitor script, right? I mean logically if you can perform the same task manually from another client, and it works as expected, but it doesn’t work from the script, it would seem like a problem there…

thats all correct, guess i’ll open an issue on github, not sure why his isn’t working, thanks again for your help hopefully he doesn’t close the issue like the last one i created

Have you thought, maybe, taking it to the thread on these forums where he posted the script? Asking in that thread?

[monitor] Reliable, Multi-User, Distributed Bluetooth Occupancy/Presence Detection he doesn’t reply very often, looks like i’ll need to do a more detailed response

So it may not be monitor, could be the pi…, i setup the following on my server:
david@server1:~$ mosquitto_sub -d -h localhost -u user -P password -t dev/test

and on the rasberry pi w:
mosquitto_pub -d -h 192.168.1.226 -u user -P password -t /dev/test -m “hello”

the server did not get the message “hello”
what can i troubleshoot on the rasberry pi where monitor is installed on? I’ve installed all the correct packages per monitor instructions…

Make sure you specify that you can manually pass the publish command from a client app so it appears to only happen with the script

see updated response, Why can't pi w [monitor] talk to my mqtt hassio addon?

These 2 topics aren’t the same.

Fixed, it was sent over, thanks, communication does work from pi w to server

Oddly enough, i was able to incercept the message from monitor (pi w to my mqttserver), i didn’t use a username and password and it worked… seems to be a bug with username/password combo