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.

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))

TikZ node positioning

Drawing nodes in TikZ above each other can be tricky. For example, if you want to draw several nodes above another node in an aligned way.

One way to achieve this is as follows.

\node[minimum width=5cm] (basis) {};
\node[above=of basis.north west, anchor=south west] (a) {A};
\node[above=of basis] (b) {B};
\node[above=of basis.north east, anchor=south east] (c) {C};


In this way, the left border of A and the right border of B do not extend beyond the basis node. Note that you need to have the positioning TikZ libary loaded.

To draw the edges in a vertical fashion, use the intersection shorthand for the nonstandard nodes:

\draw[->] (basis.north -| a) -- (a);
\draw[->] (basis) -- (b);
\draw[->] (basis.north -| c) -- (c);

TikZ node connector

In the series of TikZ tips, today we look at connectors between nodes.

TikZ comes with a variety of line types between nodes, such as straight, curved, and right-angled. In particular the last one, right-angled lines, can be very useful in diagrams. Right-angled lines are usually more appealing than direct point-to-point straight lines in diagrams.

Placing right-angled lines in diagrams in a visually appealing way is not always easy, however. Consider for example this diagram in which a chain of nodes have an outgoing arrow into an array.

connector needed

In this figure, the line marked B is well-suited for a right-angled line. On the other hand, the line marked with A is less-suited, since it needs two bends. For the ease of use, try using the following two macros for horizontal or vertical lines.

  \draw[#1] (#3) -| ($(#3) !#2! (#4)$) |- (#4);
  \draw[#1] (#3) |- ($(#3) !#2! (#4)$) -| (#4);

You can then use macros by specifying a value between 0 and 1 (where to ‘break’) and the source and destination node. For instance

\connectorH[->, red]{0.50}{a}{b}
\connectorH[->, blue]{0.75}{a}{c}

Results in:


Note that you need to have the calc TikZ libary loaded.

Disabling Office 2010 shared folder synchronization in a simple way

There are various posts on how to remove the Office 2010 “Shared Folder Synchronization” context menu using either the Windows registry modifications or the Office uninstaller. I prefer a cleaner solution which seems hard to find at Google, so it’s worthwhile mentioning it here.


The approach is to unload the DLL in question. The first step is to start a command prompt as administrator.

In this command prompt, type (assuming 64-bits Office — see comments for details):

regsvr32 /u "C:\Program Files\Microsoft Office\Office14\GROOVEEX.DLL"

Pasting is not good enough, since the command prompt will not swallow the quotes. Therefore, type it, or repair the line with the up-arrow after pasting. An example of how it looks like:

After executing the command, a dialog will inform you of the result. If you get an error, double check whether you opened the command prompt as administrator correctly.


Reloading can always be done by calling regsvr32 as shown above, but without the /u flag.

(Aside: in Office 2007 this feature was called Groove folder synchronization.)