Python

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.

Solar Car Charging Dance In Software

After thinking about how to use the solar power my home generates in the most efficient way I realised that this is a generic problem. Effectively we have three types of devices in play :

  • Generation Sources. eg. my solar panels, the house battery, the grid.
  • Switchable Consuming Devices. eg. My car, a heat pump, the house battery. The load generated by these devices can be turned on/off.
  • Background Load. The overall usage at the site. eg. my house load.

This general abstraction is a way of trying to come up with a common interface for each type of device so that we can easily add new devices as households get more connected.

Maix2 Dock Camera Test

You can write a small amount of python to test that the image you have created works correctly.

The following is a tiny python script that takes an image from the camera and displays it on the built-in screen.

Connect to the device via the serial link or over ssh.

Create a test.py file with the

#!/usr/bin/env python
from maix import display, camera
while True:
	display.show(camera.capture())

Make the script executable via