Writing software is my passion. I’m a software engineer by trade and have been doing home automation, electronics and micro-controller programming for the last 2 years. This blog offers a way to share my experience and pass on knowledge aquired the hard way.
in Devops / Developer tools tagged Scripting,, Tools
When creating Docker files, writing blog posts, or working on my home automation server there are a number of repetitve tasks that you find yourself executing. Let’s define them in a script to speed up invocation and allow them to be version controlled!
I gave the “Don’t break the chain” methodology a try whereby you mark off consecutive days on which you accomplished a certain task with a red permanent marker on your calendar. Here is an important tip to increase the impact of this method and boost motivation.
As part of my never-ending search for the ultimate blog theme, I stumbled across other static site generators similar to Jekyll (which this blog uses). This new site generator is called MkDocs and it generates absolutely stunning project documentation.
in Home assistant / Home Automation tagged Smart home, Home automation, Hub, Development tool, Hass development
The ultimate development tool for the Home Assistant API. Connect to your hub, load in your entities and start exploring the capabilities of Home Assistant’s REST API. Edit entity states, trigger automations, send data and call services.
Let’s say we want to receive notifications when laundry cycles start and end. Since I don’t think its worth investing in smart appliances, I’ve figured out a way to use virtual sensors and Home Assistant instead.
The following sensor uses a power meter attached to my laundry appliances to determine the state of the cycle (whether a load is running or not).
The idea is that if it is washing a load of laundry, the power consumption will likely be more than 5 watt. I’ve added a delay_off such that the sensor does not flip to off when the washer drum is stationary for a few seconds.
Using this virtual sensor in an automation, we can send ourselves a notification:
I usually set up the laundry but use the machines delay start feature to schedule the start time such that the load finishes when im expected to come home from work the next day. The notifications keep me up to date on the program cycle and serve as a reminder.
I actually had a power meter hooked up to the laundry and TV already, so it was just a matter of defining the binary_sensor and automation in Home Assistant.
Applying a similar configuration, we can create a sensor telling us whether we left the TV on or not.
I am using this sensor in an automation that turns off all devices at night (in case I forget to turn off a light before going to bed.)
For determining whether someone is watching TV, I can use the media_player.cast component, which is more relable than basing a virtual sensor on TV power consumption. I don’t have cable TV hooked up to my TV as I watch Netflix and YouTube on Chromecast. If you have other inputs, then defining this tv_on sensor is a nifty way for you to check whether the TV is running. You might even be able to distinguish between different states using the power consumption for each state.
Say playing a movie consumes 40 to 40w, but just playing some music consumes 20watts. It’s not perfect, but you might be able to make it work.