Mqtt
chad at holeinthewoodsfarm.com
chad at holeinthewoodsfarm.com
Sun Feb 20 17:33:58 EST 2022
So, I’ve actually been moving a lot of the simpler bits of my setup to home assistant, while keeping most of the more complex stuff and things that need to interact with other applications in XTension. One major driver of this is espresense. https://espresense.com/
Espresense is the epitome of elegance for a lot of what I want to do. Basically, it runs on esp32’s, which before the chip shortage were readily available for just a few bucks. A bit more less inexpensive now, and you have to mix and match versions/brands a bit…. But the esp32 basically provides a small microprocessor, WiFi, and Bluetooth, and a few Io pins on a chip about the size of a quarter.
Espresense is firmware you can install (via an incredibly easy browser-based flasher, no need to even open the arduino ide or equivalent) on esp32’s which will track ble beacons, such as tile trackers, little keychain trackers, and phones and the like. I’m currently tracking the things my wife always looses (iPad, iPhone, keys, travel mug), the thing I always loose (water bottle), and a couple of things for fun (my iPhone, my garmin watch, the new puppy, Paislee). My phone and watch are actually probably pretty useful for presence of me detection in rooms, though I’m not using it that way (yet). Alas, the wife doesn’t do anything routine, weather that’s bedtime or carrying a device…. One useful automation is the announcement “Paislee is waiting at the front door.” ‘Cause we might be asleep and not notice her asking to go potty, and even at only 5 months, Great Dane potty is not good in the house!
The espresence sensors report the distance of any in-range tracker, be it a tile tracker, phone, or whatever. You configure how close that distance is. It’s quite trivial to track objects to a room - basically, by default, espresence/home asssistant reports the location as whichever sensor the tracker is closest to. In theory, if you can map out the locations of the sensors and multiple sensors are picking up the tracker, it can triangulate the exact location and plot the location on a floor plan, but I have neither plotted their locations nor made a scale Floorplan. For now, “where are my keys?” -> “they were last seen in the kitchen 3 seconds ago” is pretty nifty.
But, it’s a little clunky getting between espresense and XTension. Espresense talks mqtt. I’m using the mosquito mqtt broker that, while technically a different service, just integrates with home assistant with a click and a reboot. Home assistant then sends useful stuff to XTension via the json interface. But that’s a bit of (slow, irritating) extra overhead.
If XTension had a more fully fledged mqtt broker, and/or - probably more or, because mosquito is easy and open source - could work as a mqtt client, it would seem likely that it would be trivial to integrate a boatload of different things into XTension, to include espresense.
Anyone else have thoughts along these lines? Because back in august, James added a limited mqtt broker - https://machomeautomation.com/doku.php/supported_hardware/mqttbroker - and indicated he might be able to do a client plugin. For me, an mqtt interface would need to do more than numeric values, and the client would be more useful than the broker. But if not many others are thinking in a similar path, what I’m doing sorts works (except I was running home assistant in a virtualbox on the same Mac mini that runs XTension, and it ended up crashing regularly. Couldn’t figure out why, but it seems to be virtualbox and/or the Debian variant running in it, not home assistant that was crashing. So I moved it to a raspberry pi, which is stable and faster. But i had other plans for the pi).
Oh, and if XTension spoke mqtt, esp home might also become a big integration. I’m not using it at present, because I’m out of esp’s, but it runs on either esp32 or esp8266, and interfaces with a boatload of different sensors, from inexpensive (pins on the esp can be used as capacitive touch sensors, so free, but dht22s, onewire sensors, etc) to very expensive (there was a $500 radon sensor I saw listed) and everything in between. It seems that opening up an mqtt interface in XTension would allow a lot more fun and inexpensive ways to get input into our systems with only one plugin. Killing hundreds of birds with one pebble…
Sent from my iPhone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.machomeautomation.com/pipermail/xtensionlist/attachments/20220220/b62ebad0/attachment.html>
More information about the XTensionList
mailing list