Homeassistant

Replacing A Harmony Remote Using Home Assistant

For a long time I’ve been a fan of the Logitech harmony remote controls. They let you orchestrate the operations of lots of devices. I like to think of them as setting scenes. For example in the room we watch tv, we have a tv, soundbar, Apple TV, sky box, HDMI switch and a couple of games consoles. So to watch sky tv :

  • Power on the tv
  • Power on the soundbar
  • Power on the sky box
  • Set the tv to HDMI 3
  • Set the soundbar to HDMI 1(ARC)
  • Set the HDMI switch to 1

Switching to the Apple TV needs a similar sequence, the games console another etc.

An E-Ink Display - Icons And Basic Graphics

An E-Ink Display - Icons And Basic Graphics



We have previously shown how to display text on our E-Ink display, but to enhance the user experience, it’s crucial to be able to create basic icons and graphics.

ESPHome provides detailed documentation on this topic. As an example, here’s a simple code snippet from my lambda:



//
// center vertical line
//
it.line(max_x/2,row_indent, max_x/2, max_y-row_indent);

max_x and max_y are the max dimensions of my screen.

Icons are slightly more complex, but libraries like Material Design make life easier.

An E-Ink Display - HomeAssistant Data

The next focus is how can we present data that we are interested in onto our E-Ink display screen. One of the things I want to use the display for is to show information on the energy usage of our home. Within Home Assistant I have access to info like the current house battery level, energy imported from the grid, energy exported and the current costs.

So within ESPHome you can expose home assistant data by defining entries in the sensor section of the YAML file as follows :

Home Assistant Static Network Routes

I run home assistant using the pi docker image. My IOT devices live on different networks to devices in the home and I have a slightly weird network setup at this moment in time that means I can’t create static routes at a router level for a couple of these IOT subnets.

I can easily add the required static routes using ssh into the docker container

/sbin/route add -net 172.16.2.0 netmask 255.255.255.0 gw 172.16.0.153 
/sbin/route add -net 172.16.3.0 netmask 255.255.255.0 gw 172.16.0.153 

However I’ve struggled to get these saved in the traditional way to survive post boot. This may be a busybox issue, but I can’t crack it in any normal way. As such I’m documenting a quick way of sorting it if you are having the same issue.

Monitoring Anderssen Konnect A2

Home Assistant has an excellent system for monitoring energy usage/solar generation/grid usage/gas usage, etc.

One of the features is the ability to monitor specific devices, i.e., anything that can show electricity usage in kWh. We’ve been able to monitor many devices, like the fish tank, computers, etc., using plugs that can monitor power usage. However, many things are harder to measure, and it’s not economical to add monitors to everything in the house. This means that the gap between usage and monitored usage shows up as “Untracked consumption”.

Controlling Solis Inverters With Home Assistant

Our general setting for the house prioritises energy use as follows :

Solar » Battery » Grid

This means we minimise our usage of the grid when possible.

Given the cheap rate period of energy usage through the night, we had manually set the inverter to charge the battery from the grid during the core hours 23:30 - 05:30. This effectively stops the battery from being used to power the house in that period and we have no solar in that period bar the peak summer months.

More On Presence Automation - ESPresence

More On Presence Automation - ESPresence

It’s got to that time of year when the nights are drawing in and the central heating is back on. The shorter gloomier days also mean that the abundance of solar generation we had through the summer is over and my mind turns back to how to be as efficient as possible with what’s created.

Last year I discussed some of the automations I had created through Home Assistant to help reduce energy costs. The basic idea was to try to “turn down” electricity and gas usage in rooms that were not in use. This was achieved through a combination of motion sensors and examining light states. (No motion plus no lights on equals an empty room).