Add NATS publish support to Homemon

Quickest way to get some metrics data into NATS was to add a new raw data publisher to Homemon, my bespoke home monitoring system. Homemon now publishes raw sensor data to NATS subjects like “sensor.environmental.temperature”, “sensor.environmental.humidity”, etc.

NATS is configured to store the data in a stream called “environmental_sensors”.

 1nats stream add environmental_sensors \
 2  --subjects "sensor.environmental.*" \
 3  --storage file \
 4  --retention limits \
 5  --discard old \
 6  --dupe-window 2m \
 7  --max-msgs 1000 \
 8  --max-msgs-per-subject 800 \
 9  --max-age 15d \
10  --max-msg-size 1024 \
11  --defaults

So now, there is some actual sensor data flowing into the system. Need to get to building some form of an actuator to consume this data and do something useful with it. Problem is, I don’t have any real actuators in my home automation setup yet. Have a few smart plugs that control some lights, and that’s about it.

Perhaps the dehumidifier. It does have an on/off switch that’s separate from the power, but if the dehumidifier is on when I turn the power off, it does start up again automatically when the power is restored. Problem is, if it was in “off” state when the power was cut, it doesn’t start up again when the power is restored.

Another option is to use a human (me) as an actuator. The control system could send me a message when the humidity goes above a certain threshold, and I could go turn the dehumidifier on. Bit of a cop-out, but it’s a start.

#home-automation   #synapsteward   #nats   #homemon