Blinds with Home Assistant

Notes to automate 25mm blinds motors in Home Assistant.

Insert the blinds in the tube and mount on the window as per instructions. Set-up the Broadlink as per the instructions. Onboard the Broadlink as an integration in Home Assistant (I’ve named mine simply Broadlink RM4pro, which may influence the entity_id in the commands below — please adjust as per the naming you use).

In Home assistant, go to Developer Tools -> Services and run:

In copy-pasteable format:

service: remote.learn_command
entity_id: remote.broadlink_rm4pro_remote
  device: roller_blinds
  command: down
  command_type: rf

After which to test:

service: remote.send_command
entity_id: remote.broadlink_rm4pro_remote
  device: roller_blinds
  command: up
  hold_secs: 1

And repeat for commands up and stop.

Then in Node-RED inside Home Assistant, you can configure the triggering of these services (so without using the Broadlink functions that are native in Node-RED). For this use a service call with contents:

In copy-pasteable format:

    "device": "roller_blinds",
    "command": "down",
    "hold_secs": 1

You can then make it look like this:

In this example, you see both a button trigger as well as a time-based trigger.

Running two copies of Freelook

I’ve been playing with Freelook recently, and it is quite a nice (Electron-based) solution for Outlook on Linux.

I found that I wanted to run multiple copies of Freelook for multiple email addresses, and one hack to achieve this is:

Edit /src/main.js:

const { app } = require('electron')
app.setPath ('userData', '/home/[USERNAME]/.config/freelook2');
const MailWindowController = require('./controller/mail-window-controller')
const TrayController = require('./controller/tray-controller')
const MenuController = require('./controller/menu-controller')
const Store = require('electron-store')

Running npm run start in this directory will now launch a new copy of Freelook with its own cookies and settings so that you can login to a different email account. It’s on the todo list to convert this hack into a configurable setting upstream, but for my current use case it works.

Saving Adobe Lightroom catalogs to network drives on Windows

Adobe Lightroom will not allow you to save catalogs to network drives by design. The following commands allow you to circumvent this limitation on Windows:

C:\> mklink /D H_mapping \\your_server\hugo
symbolic link created for H_mapping <<===>> \\your_server\hugo

C:\>mklink /J H_mapping_junction  H_mapping
Junction created for H_mapping_junction <<===>> H_mapping

Then you can save your Lightroom catalog in C:\H_mapping_junction. You need to run these commands with Administrator rights.

Tune Emacs binding for beancount

For editing beancount files there is an Emacs minor mode available. I find it useful and a quicker interface to use than Fava (which is already great).

I did feel that the most important command is not fast enough to reach (beancount-insert-account; bound to C-c '). The following command can be used in your init or .spacemacs to bind the insertion of accounts to C-c C-c as well:

(eval-after-load 'beancount '(define-key beancount-mode-map (kbd "C-c C-c") 'beancount-insert-account))

Opening OneNote links in Org-Mode

When adding OneNote URLs in an Org file on Windows, Org-Mode doesn’t know how to open these links. Add the below to your Emacs config and you can click the links. (Based on an earlier online example on opening Outlook URLs.)

(org-add-link-type "onenote" 'org-onenote-open) (
  defun org-onenote-open (link) "Open the OneNote item identified by the unique OneNote URL." 
    (w32-shell-execute "open" "C:\\Program Files\\Microsoft Office\\root\\Office16\\ONENOTE.exe" (concat "/hyperlink " "onenote:" (shell-quote-argument link))