Author Topic: MQTT?  (Read 3506 times)

0 Members and 1 Guest are viewing this topic.

IKROWNI

  • $upporter
  • Sr. Member
  • *****
  • Posts: 146
  • Karma: 2
    • View Profile
MQTT?
« on: July 22, 2016, 02:52:54 AM »
Hello everyone I just received some "happy bubbles BLE detectors to check out and would like to get these working with voxcommando. I'm not sure if anyone has seen these before but basically put a small Bluetooth Beacon in one of my shoes and when I walk into a room the signal gets reported damn near instantly to the mqtt server the device reports to. The mqtt server has a topic that can be subscribed to for each room. The owner said he's about to add support for home assistant but I was wondering if anyone new a way to subscribe to the topics on the mqtt server with voxcommando? I'm entirely new to the use of mqtt and it took me a while to get everything setup using cloudmqtt. I will eventually just run one using a program called mosquito locally on my PC instead but for now I've just been using cloudmqtt to test the waters.

The implications I'm looking at for these devices is presence detection that is smart and knows who is in which room at all times. Having this would allow you to set a profile for when a certain person enters a room. Lights to certain levels, music follow you, lighting follow you, tvs turn on and switch to your Plex/xbmc account, etc, etc.

Thanks for any help with this I've been looking into it for the past week now.
« Last Edit: July 22, 2016, 05:45:50 AM by IKROWNI »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: MQTT?
« Reply #1 on: July 22, 2016, 12:46:18 PM »
I can probably create a plugin, but it would be more fun for me if I had some beacons or something to play with.

What's it worth to you(s) ?  :)
« Last Edit: July 22, 2016, 02:37:27 PM by nime5ter »

IKROWNI

  • $upporter
  • Sr. Member
  • *****
  • Posts: 146
  • Karma: 2
    • View Profile
Re: MQTT?
« Reply #2 on: July 23, 2016, 11:57:47 PM »
Well i have 2 of the beacon detectors that i received to test and review for the guy and i have a few bluetooth beacons. The beacons i have are kinda crappy by a company called sticknfind and i havent had much success getting the settings to save so they are kind of all stuck at whatever uuid major/minor and tx power that they are already set at. Ive tried multiple different apps to get them to change but no dice. Beacons are cheap though. I could send you one of the beacon detectors or the creator of them might wish for you to speak with him directly about implementing something to work with them. He is just getting up and started and i'm sure he would appreciate as much exposure as possible. Ill shoot him an email and see if he would be cool with that. Like i said i only have 2 of them. Also just FYI he open sourced the entire project so these can be built easily for those that wish to go that route. I priced it out though and the price hes charging isnt much more than it would cost to get all the parts from all the different sites and then go to the trouble of assembly.

Ive gotten the mqtt server and everything else setup on my end and can see the beacons coming in and out of range with pretty remarkable accuracy.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: MQTT?
« Reply #3 on: July 24, 2016, 09:03:47 AM »
That sounds good.  I'm sure that there are quite a few VC users that would be interested in an easy to use and affordable solution for location and presence detection of individuals.

Please let him know that I'm interested and tell him that I'd be happy to discuss it with him.  If I can get some sample equipment to play with that would be great, and I can put together a plugin that will make it really simple to use with VC (assuming you already have the MQTT stuff set up).  I can probably also build something but ordering parts from China takes forever to get to me in Canada, and getting parts imported from the US is expensive here.  I have a spare NodeMCU here (which I think he uses in his design) but nothing for the BLE stuff.  Also, I'm not sure which beacons I should use or where to get those.  I assume the beacons are not something one would try to DIY.

IKROWNI

  • $upporter
  • Sr. Member
  • *****
  • Posts: 146
  • Karma: 2
    • View Profile
Re: MQTT?
« Reply #4 on: July 24, 2016, 10:23:30 AM »
As for which beacons to get I'm really not sure I got burned on a 10 pack of beacons I paid $200 for from sticknfind (worse customer service ever!)  their own app fails to even connect with the beacons and now they don't answer any support requests. Happybubblestechnology@gmail.com did mention that he just ordered a bulk lot of beacons that are supposed to be pretty good so maybe you could order some from him or ask which ones he would suggest. I'm pretty sure most of them will work pretty much the same across the board with the only difference probably being battery size.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: MQTT?
« Reply #5 on: August 01, 2016, 07:01:01 PM »
I received my Happy bubbles and beacons today and have tested them with mosquitto and all seems good.  Now to figure out what to do to make these useful in VC!

Stay tuned.
« Last Edit: August 01, 2016, 07:11:34 PM by nime5ter »

IKROWNI

  • $upporter
  • Sr. Member
  • *****
  • Posts: 146
  • Karma: 2
    • View Profile
Re: MQTT?
« Reply #6 on: August 02, 2016, 10:14:58 AM »
SWEET! Cant wait to have these playing my royal introduction when i walk into the room!  :biglaugh

James did you just setup mosquito on windows or did you use a raspberry pi or something similar? I tried getting mosquito setup on windows and had a tough time with it.
« Last Edit: August 02, 2016, 10:17:07 AM by IKROWNI »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: MQTT?
« Reply #7 on: August 02, 2016, 11:25:53 AM »
Yes I set up Mosquitto.  Having a couple sensors and a couple beacons running = a constant stream of data (more than 8 messages out per second and the same number coming back to VC) so I was not comfortable with using the cloud service for an extended period of time.

I would prefer if there were some intelligence applied to all this data before it got sent to MQTT but I am new to all this.

It's a very silly installation process for Mosquitto.  I could not actually get it to run as a service but I got it working well enough for my purposes by running Mosquitto.exe

Also first had to "unblock" one of the dll files that you need to download directly too.

« Last Edit: August 02, 2016, 11:28:28 AM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: MQTT?
« Reply #8 on: August 02, 2016, 02:08:34 PM »
Did you set up the Happy Bubbles - Bluetooth Beacon Presence Detection Server yet?

If not, please do.  I think the first version of the plugin will require it.

https://github.com/happy-bubbles/presence/releases
« Last Edit: August 02, 2016, 02:16:35 PM by jitterjames »

IKROWNI

  • $upporter
  • Sr. Member
  • *****
  • Posts: 146
  • Karma: 2
    • View Profile
Re: MQTT?
« Reply #9 on: August 04, 2016, 10:45:24 AM »
I have the happy bubbles server setup properly and seeing my beacons.

I setup mosquito already on my PC and when I run netstat I see it started but from there I really don't know where to go. How do I set my username and password I don't see any type of configuration file to do any setup. On cloudmqtt there is way to setup the topics quick and easy but with mosquito as I said I just run the exe the server starts and then Idk what to do next.

I'll just use cloudmqtt to try it all out when you get the plugin running and then I'll figure out mosquito later.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: MQTT?
« Reply #10 on: August 04, 2016, 10:56:46 AM »
You can just run mosquito and use it. By default the username and password are not required. To connect to it you just need the ip of your machine running mosquito and the port (1883). It's actually easier than using cloudMqtt.
« Last Edit: August 04, 2016, 11:03:49 AM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: MQTT?
« Reply #11 on: August 04, 2016, 02:59:35 PM »
Do you happen to know if there is an option to disable the periodic flashing of the purple light?
« Last Edit: August 04, 2016, 05:50:08 PM by jitterjames »

IKROWNI

  • $upporter
  • Sr. Member
  • *****
  • Posts: 146
  • Karma: 2
    • View Profile
Re: MQTT?
« Reply #12 on: August 04, 2016, 09:49:05 PM »
Not sure it looks like you already have the option "blink leds"  turned off.

IKROWNI

  • $upporter
  • Sr. Member
  • *****
  • Posts: 146
  • Karma: 2
    • View Profile
Re: MQTT?
« Reply #13 on: August 07, 2016, 06:46:04 PM »
You can just run mosquito and use it. By default the username and password are not required. To connect to it you just need the ip of your machine running mosquito and the port (1883). It's actually easier than using cloudMqtt.

Sweet i just decided to give mosquito another shot and it worked as you said. I thought for sure i had to be subscribed to the correct topic to actually get the presence detection to send the message to the mqtt server. I also thought for sure i had to have a username and password for it as well.  The MQTT server and the presence server both running together only take like 11mb of ram so im pretty happy about that as well.