
I am running Home Assistant at home. It kind of works, in a kind of haphazard way as if you had an old-school Lego set with no instructions and you just puttered around building things until you were bored or done. My dashboards are a bit of a mess, in the way that things are when you try them out to see if they work and then wander off to the next project once they do.
One of the limits of my exploration to date is that I really don't want
to have a haunted house, and so I'm really rather reluctant to outfit
every room with sensors and motors and automation that does things for
me. This could get out of control pretty easily. But I do want to explore,
and for that I want to have some data and devices (even simulated ones)
to use.
My previous successful tries at HA have involved logging the size of
my Gmail inbox, tracking how many spaces are free in the parking
structures around Ann Arbor, and watching radon levels in the basement
before and after remediation. My next round is going to be using MQTT,
a simple publish/subscribe system, to push some data into HA that I
can play with.
What kind of data? Well, the idea here is that if I don't want to buy
a whole bunch of sensors then I can periodically type in some numbers
with my fingers and send them in through mosquitto_pub
which will
publish them to a topic. They will show up in HA and then whateer
automation I care do to can be downstream of that.
Some useful hints on the journey:
Install Mosquitto on HA: https://github.com/home-assistant/addons/blob/master/mosquitto/DOCS.md
Add the MQTT integration: https://www.home-assistant.io/integrations/mqtt
Install an MQTT client locally; on my Mac I just use mosquitto as well, installed with Homebrew.
HA supports MQTT device auto-discovery which is great but also not great because there's an assumption that every channel you set up will have a bunch of configuration with it. This gets in the way of exploration when getting started because there are too many options. So I followed this advice:
https://community.home-assistant.io/t/how-to-use-mosquitto-pub-to-create-new-mqtt-device-with-answer/443286/1
where you can create a new MQTT entity from a command line invocation.
Proof of work at the top! This is a command to set a HA entity that updates happiness (in volts)
mosquitto_pub -h host -u user -P password -t mood/happy -m $1