offset \ˈȯf-ˌset\ noun

a force or influence that makes an opposing force ineffective or less effective

Mortgage Redemption

So we bought an apartment in Dublin. That is a fairly old piece of news. Just recently (mid last month) we paid off the mortgage so the place is finally fully ours. There was some more work involved in paying it off sooner than the expiry of the loan.

When we felt we were ready, we contacted our solicitor's office and indeed there were a few bits and pieces left to complete: signing our home declaration and confirming we were married. The office dealt with it very promptly. What was left then was actually clearing the mortgage.

The last month we got our financial picture complete so we went to the bank, consolidated our accounts, added what little was left from the bank of mom and dad (essentially getting rid of the cash on our hands) and poured everything into repaying the loan. In the process leaving just enough for us to live till the next paycheck, but we knew we would recover quickly.

It was difficult to find information on what was involved in closing a mortgage because all the banks are about opening them instead. Customer support on Twitter was unsurprisingly useless. All we got from them was a number to call which we already had. One phone call later and what we got, among other things, was that the whole process was called mortgage redemption (which is a phrase to look up online). After we gave them enough info, they sent us a letter few days later with the official sum we owed at the time (which we already knew from the online mortgage account), what the interest per day was since the day the letter was issued (so already the official sum was behind) and the closing fee (60€).

With that letter we went to the bank and, while the staff was patient and helpful, in the end it came down to manually calculating the real amount as we had to take that daily interest into account. There was some overall confusion on how to approach it and the bank had to call their own support to ask for clarification. It's not every day that someone comes to redeem a mortgage.

We were told that whatever we overpaid, the bank would give back to us, but that was a slight problem. We didn't have enough for the next rate so if there was an automatic attempt to deduct it from our account it would have bounced. We canceled the direct debit and hoped for the best. Everything was in order in the end.

It took a few days for the paid amount to be processed, we got refunded a few cents and eventually they closed the mortgage account, which disappeared from our app. A few more days later, another letter appeared in the mailbox with a confirmation that everything was OK and reiterating what they did.

We were also told we would be informed when the deeds were ready, but this notice wasn't coming so we sent them an email. Apparently, they had arrived just the day before and were ready for pickup. This was a few days ago before writing this, and, aside from canceling or changing life insurance, the last piece of the puzzle.

"We're gonna frame them!" turned into "Nope" very fast. It was around 3 kg of paper that we will keep somewhere safe instead.


/media/images/mortgage_redemption.jpg

What happened is that because of the pandemic, we saved some money faster. We didn't go anywhere so that was a big plus, but we were still equipping the apartment, so a minuscule minus. I still remember sleeping on the floor for some weeks, and then on the couch for some more months until the bed arrived. It was a journey well worth the wait. Still some things missing, but we're getting there. Just last month we got the lights installed in our storage room. Something we were missing and had to illuminate the place with the torches when we were taking out things.

Usually people have a nice party, but we made a nice meal and had it on the balcony with a glass of wine overlooking the trees across the street with our weak morning glory flowering above us. Idyllic setting comes and goes with the weather here. Not like we wouldn't have done it otherwise, but I guess it called for a celebration.

With variants all over the place, we're still staying put. At least for a bit more.

Home Assistant Icecast Radio Alarm and Syncthing

Usually when you listen to a radio online, chances are that the stream is coming from the Icecast server. Icecast is an open source project and I've set it up to run on our Raspberry PI in a Docker container.

To generate the music for the Icecast, I use Liquidsoap (also in a separate Docker container like Icecast) and it takes files from a certain folder on the external drive (passing it in the container as a volume via host folder).

The inspiration partially came from Silent Protest talk and then their repo containing Docker images.

Some music is not available on Spotify so I resort to this method as well. Just like the Spotify alarm was set up, the automation for this is done in the Home Assistant in a similar way, but much simpler. You need to call media_player.play_media service and give it the target of the speakers with the source being that music stream from Icecast. It's bound to the local network as well because I am not comfortable exposing the service to the world.

Now here's the kicker. That same folder that is the music source for the Icecast stream is synced among other PCs in the household using Syncthing (also in a separate Docker container). This means we can update the folder with new files and Liquidsoap's configuration periodically scans the changes in the folder and updates the streaming playlist. This is the reload parameter from the Liquidsoap cookbook. I am really happy with how it's all brought together.

Syncthing pierces the local network. It also creates a mesh from the connected instances. I use it to back-up my database on the external server and replicate the file among other synced devices. It involves some terminal commands and an edit of the crontab, as well as having a .pgpass file ready to execute the pg_dump command without a prompt. Remember to have that file owned by the user executing the commands and that the permissions are 600.

# have this in the crontab, for instance as a daily job
# this dumps Postgres database to a certain file with
# a timestamp as a part of the filename, Windows compatible
pg_dump -U {db-user} {db-name} -f /folder/for/syncthing/Sync/{project-name}_`date +\%Y-\%m-\%d_\%H-\%M-\%S`.sql
# to restore, use: $ psql -U {db-user} {db-name} < {dump-filename-from-above}.sql

# to remove backups, also a daily cron job
# this lists all the files in the folder, then
# filters out first 13 entries and
# removes them from the system
ls -t /folder/for/syncthing/Sync/*.sql | sed -e '1,13d' | xargs -d '\n' rm

Because I have an external drive locally and a big enough one on the network, I can sync between devices, cheaply backing-up photos and videos. When I take photos with the GoPro, I move them from the device to the cell phone app and then to the phone system. It ends up in the same folder ready for syncing, courtesy of Syncthing for Android. For now it only backs up the photos of the local parks and scenic spots. It can be sunny here. It's summer after all. We'll make use of this functionality even more once the pandemic passes.

Aside from the alarm radio in the Home Assistant, I also added a Syncthing card in it, using REST integration to say what the usage of it is. That works well, too, and it expands my Home Assistant dashboard with a new functionality. I shamelessly copied the instructions from the community forums.

We Don't Have a Rudder But We Have a Sail

There's still some momentum. In relation to the previous post, I'm continuing the foray into the apartment becoming a proper livable/workable place. I had fun again although we're still at the mercy of the great context we're in. That context has improved somewhat, though. Now the country allows us to move around it, but nothing's working and we still haven't gotten our jabs. Nevertheless, we're biding our time and doing things at home.

The curtain annoyed me for a time. It's a vertical blind that you have to pull two strings to get open. One is changing the angle of the vertical strips that make it up, the other is moving the strips to the side. I think it's a fairly standard one when it comes to vertical blinds. The blinds reach all the way to the floor.


/media/images/vertical-blinds.jpg

I spent some time researching the options to make it automated so I didn't need to pull the strings. Unfortunately, there's no one device for automating it. The most frequent is Aqara curtain controller usually coming from Xiaomi, but that one doesn't fit my use-case. The only option I could find that would do it was two devices, one for each string, coming from Zemismart. I opted for only one at this time to see if it would work. It took some weeks to arrive.

The problem is that during some of the weekday mornings, the robotic vacuum goes around the apartment and it needs to have the space cleared so it can do its thing. We do a little dance. The apartment comes to life and while the vacuum is going around the rooms, we're opening the curtains and moving chairs around. I thought that it would be great if the curtain could unroll in the morning before the robotic vacuum started its routine. I cannot do anything about the chairs except leave them as they are, but at least some of the manual work would be eliminated.

So on to the Zemismart. Assembling it was not a pain, but setting it up to join the Zigbee mesh was. Especially since the instructions are weird. Fortunately, it can (and does) work with an unbeaded cord and is strong enough to pull the curtains we have. The only trick is the tension of the string so I played with it a bit to get it right. I used double sided tape to stick it to the window frame, but it kept falling off as the tension of the string needed to be adjusted. Nevertheless, it enabled me to figure out where I needed to screw in the device's plate to maintain the right tension. Picking the right cog, charging and installing it in place turned out to be the easy part.

Getting the motor to turn on, to have it spin in the right direction, to set the limits for where the start, middle and end are, as well as connect it to the Zigbee mesh can bring about some trouble. It took some research to figure out what each thing was supposed to do. Motor off and on is mostly for safety reasons. Direction is for which way you want the mechanism to spin and it should work at the default, but you can override it. Think what up and down buttons mean to set the direction right. Limits are self-explanatory, but they're both using the same button to set (except the middle). Having it in pair mode is not difficult to engage, but the software support is patchy at best.

I have a Conbee 2 gateway for Zigbee coming from Phoscon. It usually comes with the computer app, but the app couldn't find the motor. What furter complicates things, over there everything is treated like a light instead of a device. In the end I didn't need the app and decided to remove it. After all, Conbee 2 is a Zigbee radio and can work with any library that is willing to support it. This proved great because Home Assistant has an integration with the Conbee 2 stick via zigpy library which is more up to date than the official app. I needed to expose the device path on Linux to the Docker instance of the Home Assistant.

This enabled me to have the device join the mesh with the controls and all, but the way this thing was made, there are hacks set up in place just to make it work. Luckily, they're setting it up in the library so I will avail of the new functionality. For now I can say that the device is at least connected to the mesh and it can be triggered by remote controller buttons, but rudimentary controls from the Home Assistant also work, like calling the services directly instead of using the controls in the card and instead of "close" or "open", it goes to the next limit. That's why my automation is doing "set_cover_position" instead.

I am tempted to get another one to control the angles of the blinds. I know it will be a pain to control two motors to get the natural light, but it's better than running to the living room to open the curtains.

Now, if only I could figure out what to do with the one in the bedroom...

Idle Hands are the Devil's Workshop

It's already April, we're still at home and still not traveling so in the past few months we've been ordering stuff online to get the apartment fully equipped. We've been procrastinating with finalizing some things and we're still missing some functional items in the apartment before we start decorating, or at least put in some effort to amend the current naked-wall aesthetic. We deliberately went for a smaller loan, but that didn't leave us with a lot of spending money so we've been catching up. In our minds, every little bit matters.

By the end of April the restrictions did loosen up a bit so we managed to move around the city. The outskirts can be beautiful in the right places.


/media/images/dalkey_hill.jpg

This month I was busy assembling flatpack furniture, screwing things in place, moving things and bringing everything together. Hopefully, in a few months' time, it will all be done. I keep saying that and we keep ordering new things, but progress can really be seen as the time passes. Our makeshift workroom (and the rest of the apartment) is starting to look like something.

This time we ordered some shelves and a motorized desk from Ikea (and it took them a month and a half to get the delivery ready because of the pandemic) and then some trinkets from various places online. We still had to do a quick run in the nearby hardware store to get whatever we missed.

We installed shelves in the storeroom and the workroom, which was long overdue. The new shelves let us use more vertical space to store the things that have just been lying about. We put several on top of our wall bed and it looks great. We're still missing some of the inserts for them, but they didn't have them available online so we'll have to wait again. One of them was also slightly bumped, but it's not noticeable. It's not really ideal when new purchases already have signs of wear and tear, but we really didn't want to go through the hassle of exchanging things.

Working from home is becoming a new normal and organizing the space can be challenging. We used the opportunity to move things about to economize the space, got a new extension cord and some fixings to deal with the cable chaos. My powered USB hub finally got a free dedicated outlet so I can use it for plugging in even more things.

The desk is from Ikea's Idåsen line, a motorized standing workdesk that is quite heavy as I soon found out. We managed to get it inside and assemble it and for three days everything hurt, but it was worth it. When it goes up, my posture changes so I can feel the effects almost immediately. My spine will reap the benefits and my future self will thank me later. The desk also has the bluetooth connection. I saw it the first time in one of Armin's tweets about automating his desk. I figured that it wouldn't hurt for me to automate it with the Home Assistant as well so I'm working on it. For now it only works while holding down the physical switch or the virtual one in the Android app.

The desk I had before was really a kids' desk and it would be an understatement to say that it wasn't really suitable for someone of my height. I had some 15 cm to move the mouse around and barely the space to place the keyboard. My desktop computer languished in this state for years. But now, with a bigger desk depth and no back on the desk it meant that I could install the monitor arm I had bought a year ago. This freed so much surface so I am looking forward into finally getting back to drawing again. My drawing equipment and the hardware now fits properly and the mouse sensitivity was adjusted accordingly.

Regarding the other trinkets that got delivered, one of them is a Broadlink RM4 pro S universal remote. It can replace all the remotes we have in the apartment so there's less space and batteries used. It also tracks temperature and humidity (although I don't need the temperature tracked because the thermostat takes care of that) and it can be connected to the local network. This means that I can also add it to the Home Assistant and write up some scripts to turn on multiple devices at the same time or automate the dehumidifier that we have in the apartment to turn on only when it needs to. It's useful because there are some devices that are not smart, but get smart when this is in play.

We also got some gardening equipment so I fully expect to write about it some time in the future when I get all the hardware assembled for it.

After well deserved rest and recovery, and getting into the daily routine with the new setup, I tackled the software side, which was easier, at least physically speaking, but there are still kinks to be ironed out.

I was playing a bit with Home Assistant, concretely the Spotify integration detailed in the previous post. I expanded that one with Spotify turning off after a few minutes just before the morning exercise. I've also supercharged the morning routine with four more things:

  1. a notification to do the exercise via Telegram, 15 minutes before
  2. sending Wake on LAN signal to the PC so I don't need to press the button in the morning
  3. a browser shortcut in the start-up folder to start the browser with the computer
  4. opening the tab in the browser with the YouTube video (with autoplay enabled for it) on doing the exercise

First two things are done with Home Assistant, the third is a straight-forward thing to do and the last one uses Push2Run which receives a command through Google Assistant routine functionality. It all works perfectly. If you want your Windows PC to do things on the Google Assistant voice command, I recommend that you explore Push2Run.

I also did the script in the Home Assistant for turning on all the hardware for when we want to watch our streaming services. For some reason, CEC is not working for me. I need to investigate it further. I had to go through Home Assistant for that because Broadlink cannot cover all of it. Namely, the gaming console had to be triggered separately with another service call where the console is set up as a media player device in the Home Assistant.

I mentioned the extension cord and the powered USB hub. This is connected to the brain of the whole thing, the Raspberry PI. I cannot thank my friend enough for giving it to me. It is an amazing moving in gift that I have so much fun with. There's Docker on it and I install services through it. Home Assistant is one of them. Others, well, for the next time.

Home Assistant Spotify Radio Alarm

I have a Home Assistant instance running in a Docker container on the Raspberry PI. The configuration is exposed on the Docker volume so I can access the file and change it. I followed the instructions to get the Spotify integration running in the Assistant and quickly turn this into an alarm radio.

Since I already own a Spotify account, it was not difficult to set this up:

  1. follow the links in the instructions and create an app on the developer side of Spotify
  2. edit the settings for the application and add a redirect URI and save
  3. copy the credentials for the configuration.yml of the Home Assistant
  4. edit the configuration.yml per the instructions and restart the Home Assistant server
  5. go to Home Assistant integrations section and add Spotify integration

Make a note of the integration name. You'll need it later. It's "Spotify MyUsername" on my end.

It pretty much gets added to the Home Assistant dashboard automatically. I went a step further and added an automation for this. My speaker system is connected to the Home Assistant from before so this turned out to be a perfect opportunity to go down this route. I wanted to have the "Liked Songs" as a playlist to run, but Spotify is not making it a playlist. Here's the entrance to the rabbit hole if you want to see how the "Liked Songs" was requested to be a playlist. For now, I opened it in a dedicated application on the computer, selected all songs with Ctrl+A and added them to a new custom playlist that I can work with.

In the automations section of the Home Assistant I did the following:

  1. added an automation and started with an empty automation
  2. added the name for the automation (I used "Spotify Alarm") and left the other options as they were
  3. for the trigger I used "Time" type and a fixed time, which can be whenever you want the automation to run (08:00 for example)
  4. conditions I didn't touch
  5. the next was the action subsection where I added several, starting with turning on the speakers, which means I set this action's type to "Call service", the service to "media_player.turn_on" and my speaker-set and the Spotify player as the targets
  6. there's an "add action" button bellow that lets you add more actions and my next one was "Delay" of 10 seconds as a quick and dirty way to give the speakers some time to turn on
  7. added new action: "Call service", "media_player.volume_set" as the service, with my speakers as the target and the volume percentage at 0.2 (this is 20% of the maximum volume of the speaker set)
  8. added new action: "Call service", "media_player.play_media" under service, but this time the target is the Spotify player, "Content type" is set to "playlist" and "Content ID" is the URL to the custom playlist
  9. added new action: "Call service", "media_player.shuffle_set" under service, the Spotify player as the target, and shuffling toggled
  10. added new action: "Call service", "media_player.media_next_track" under service, the Spotify player as the target
  11. added new action: "Call service", "media_player.select_source" under service, the speakers as the target and as the source I put the name of the device ("Spotify MyUsername")

/media/images/spotify_alarm_actions.png

Save and exit the automation. Run it to try if it works. There might be some tweaking involved from your end for the action "Delay" if it takes a long time to power on the system. I'm wondering if "Wait" would be appropriate. There's also a question of the Spotify integration with the speaker system. I didn't figure out where the source will end up, but I'm not complaining. It works.

I perceive home automation as a hobby at best. I'm still poking around that. The results of tinkering can be seen here. I'll probably need to publish the automation scripts in some public repo eventually.