6
.forgejo/workflows/build.yaml
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: docker
|
||||||
|
steps:
|
||||||
|
- run: echo All good!
|
||||||
BIN
posts/adding-sonoff-tx-t1-eu-wallswitches-to-esphome/attach1.jpg
Normal file
|
After Width: | Height: | Size: 4.6 MiB |
|
After Width: | Height: | Size: 4.6 MiB |
|
After Width: | Height: | Size: 4.3 MiB |
|
After Width: | Height: | Size: 4.8 MiB |
|
After Width: | Height: | Size: 4.3 MiB |
|
After Width: | Height: | Size: 74 KiB |
BIN
posts/adding-sonoff-tx-t1-eu-wallswitches-to-esphome/attach2.jpg
Normal file
|
After Width: | Height: | Size: 5.5 MiB |
BIN
posts/adding-sonoff-tx-t1-eu-wallswitches-to-esphome/attach3.jpg
Normal file
|
After Width: | Height: | Size: 4.6 MiB |
BIN
posts/adding-sonoff-tx-t1-eu-wallswitches-to-esphome/attach4.jpg
Normal file
|
After Width: | Height: | Size: 4.6 MiB |
BIN
posts/adding-sonoff-tx-t1-eu-wallswitches-to-esphome/attach5.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
posts/adding-sonoff-tx-t1-eu-wallswitches-to-esphome/attach6.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
posts/adding-sonoff-tx-t1-eu-wallswitches-to-esphome/attach7.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
posts/adding-sonoff-tx-t1-eu-wallswitches-to-esphome/attach8.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
posts/adding-sonoff-tx-t1-eu-wallswitches-to-esphome/attach9.png
Normal file
|
After Width: | Height: | Size: 100 KiB |
179
posts/adding-sonoff-tx-t1-eu-wallswitches-to-esphome/index.md
Normal file
|
|
@ -0,0 +1,179 @@
|
||||||
|
---
|
||||||
|
title: "Adding Sonoff TX/T1 EU Wallswitches to ESPHome"
|
||||||
|
slug: adding-sonoff-tx-t1-eu-wallswitches-to-esphome
|
||||||
|
date: 2020-06-03T21:27:06
|
||||||
|
categories: ["All", "Projects"]
|
||||||
|
tags: ["ESP8266", "ESPHome", "Home Assistant", "Home Automation", "Sonoff"]
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
For a while now if been annoyed with the old 1970's surface mounted wall switches in my home. I mean they work but stylistically I didn't like them much and I really wanted something more flush with the wall. After looking at some options I decided to go for the Sonoff TX series switches. They contain an ESP8266 which I am now a little more familiar with and should be easy to add to my growing Home Assistant setup and I really like the glass front. So I ordered a couple.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
The Sonoff TX T1EU1C I got.
|
||||||
|
|
||||||
|
## Taking it apart
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
First I removed the glass front from the main electronics by inserting a flat head screwdriver into the marked slots and lightly pressed the bottom away from the housing.
|
||||||
|
|
||||||
|
You would need to open the device the same way for normal installation. The guide I used for part of my changes shows you can also just put a flat head screwdriver in the slot in the middle and carfully twist the top off but I didn't have much luck with that. Either way, you will be greeted by a green PCB.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Next up, I lifted the PCB from the rest of the housing by putting one side of a plastic card under the side of the PCB and pressing down on the other side of the card. You can also do this with a flat head but look out for the traces on the PCB.
|
||||||
|
Now that the PCB with the ESP8266 chip is free of the rest we can continue with building the firmware, hooking it up and flashing it.
|
||||||
|
|
||||||
|
* * *
|
||||||
|
|
||||||
|
## Building the firmware
|
||||||
|
|
||||||
|
The original article I followed uses some command-line stuff to create the base firmware and I'm sure I could figure that out, but since my ESPHome is integrated with Home Assistant already I opted to go the GUI route.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Get started by pressing the big + icon to the right.
|
||||||
|
|
||||||
|
Then it is a question of filling out all the wizard steps, I didn't worry about the Wifi Settings just yet as I will be changing the config later anyway.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
After submitting the device shows up in the list.
|
||||||
|
|
||||||
|
Sometimes the clicking edit immediately after creation shows the config as 404 not found, but a refresh fixes that.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
This is the config generated by the wizard but I will paste in my own config next.
|
||||||
|
|
||||||
|
The configuration took me a little while, I had to look around a bit to figure out what everything did so I'll go though what the parts of my config do.
|
||||||
|
|
||||||
|
This is the basic part of the config, is sets the name, the chiptype (esp8266) and size (1mb). It also contains the on\_boot setting which tell the device to turn on the led on the touchpad, which I have on all the time, on boot. The blue\_led\_light it refers to will be set later in the config.
|
||||||
|
```yaml
|
||||||
|
esphome:
|
||||||
|
name: sonoffespwc
|
||||||
|
platform: ESP8266
|
||||||
|
board: esp01\_1m
|
||||||
|
on\_boot:
|
||||||
|
priority: -10
|
||||||
|
then:
|
||||||
|
- light.turn\_on: blue\_led\_light
|
||||||
|
```
|
||||||
|
Next up is the WiFi settings with some bonus parts.
|
||||||
|
|
||||||
|
ssid is the name of your WiFi network of course and the password is ... well you know. fast\_connect makes the WiFi try to connect without first scanning all channels, it's all basic stuff. Now the domain setting is there because I run my own DNS zone, so devices on my own network resolve the name of the ESP so I don't have to mess with static IP's. This device will be reachable on sonoffespwc.phiax.nl from inside the network but it will not exist outside of my network.
|
||||||
|
|
||||||
|
The ap and captive\_portal parts are really cool too, if for whatever reason the ESP cannot connect to the WiFi, it will create its own WiFi network, that when connected to show you a page where you can scan and change the WiFi settings and restart.
|
||||||
|
|
||||||
|
ota password is needed for reflashing from the network or **O**ver**T**he**A**ir update.
|
||||||
|
logger will enable logging (what it says on the tin I guess ;-) ) and api password is the password Home Assistant will need to import and create the components.
|
||||||
|
```yaml
|
||||||
|
wifi:
|
||||||
|
ssid: 'WIFI-24'
|
||||||
|
password: 'obviouslynotthis'
|
||||||
|
fast\_connect: on
|
||||||
|
domain: .phiax.nl
|
||||||
|
ap:
|
||||||
|
ssid: "Espslaapka2 Fallback Hotspot"
|
||||||
|
password: "obviouslynotthis"
|
||||||
|
|
||||||
|
captive\_portal:
|
||||||
|
|
||||||
|
ota:
|
||||||
|
password: "obviouslynotthis"
|
||||||
|
|
||||||
|
# Enable logging
|
||||||
|
logger:
|
||||||
|
|
||||||
|
# Enable Home Assistant API
|
||||||
|
api:
|
||||||
|
password: "obviouslynotthis"
|
||||||
|
```
|
||||||
|
Now comes the part the took me a while to figure out. The binary\_sensor component is the touchpad itself, it is a switch. So touching it has nothing to do with the relay toggling on or off. You could use the touchpad to switch on your oven but not the relay. Or you could not even use the touchpad and have the relay come on when you've got unread e-mail. You can really go nuts with it, but... We just want a light switch. So GPIO0 is the touchpad, we register it with the pin settings and tell it that if we touch it we want to toggle the relay (or turn on or off the light it connected to).
|
||||||
|
|
||||||
|
The output defines the led on the touchpad (GPIO13) and the actual relay part (GPIO12).
|
||||||
|
|
||||||
|
Lastly, the light component makes sure Home Assistant can make use of these outputs as lights. The source article registers them as switches, which do not work with Home Assistant groups like light.turn\_off (service call to turn off every light) without having to do other changes.
|
||||||
|
```yaml
|
||||||
|
binary\_sensor:
|
||||||
|
- platform: gpio
|
||||||
|
pin:
|
||||||
|
number: GPIO0
|
||||||
|
mode: INPUT\_PULLUP
|
||||||
|
inverted: True
|
||||||
|
name: "Touchpad"
|
||||||
|
on\_press:
|
||||||
|
- light.toggle: light\_switch
|
||||||
|
output:
|
||||||
|
- platform: esp8266\_pwm
|
||||||
|
id: blue\_led
|
||||||
|
pin: GPIO13
|
||||||
|
inverted: True
|
||||||
|
- platform: gpio
|
||||||
|
pin: GPIO12
|
||||||
|
id: relay
|
||||||
|
|
||||||
|
light:
|
||||||
|
- platform: monochromatic
|
||||||
|
name: "Wifi LED"
|
||||||
|
output: blue\_led
|
||||||
|
internal: true
|
||||||
|
id: blue\_led\_light
|
||||||
|
- platform: binary
|
||||||
|
name: "Light"
|
||||||
|
output: relay
|
||||||
|
id: light\_switch
|
||||||
|
```
|
||||||
|
Anyway, after this I clicked save, then validate.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
After validate returns successfully, click the 3 dots and click compile to build the binary.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
When compiling completes (it may take a while) you can click download binary to get the file needed for flashing.
|
||||||
|
|
||||||
|
## Connecting the UART
|
||||||
|
|
||||||
|
This part apparently used to be much easier because earlier version used to allow uploading custom firmware from the web interface. So you need a UART USB dongle for this that supports 3.3v (5v will fry the device).
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Luckily the process wasn't really hard apart from needing the UART USB thingu which I did not have prior the this. But the folks who made this were nice enough to silkscreen where the wires would need to go (I moved the yellow wire later because I found another ground point and decided keeping all the UART pins next to each other made more sense)
|
||||||
|
|
||||||
|
This is where I noticed the biggest change in board revision from the source article, because I connected my yellow wire (moved from before) to the ground ready to hold it against GPIO0 pin of the chip to put the device in flash mode but...
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
... my board revision comes with a extra pad to GPIO0. That takes the stress of accidentally hitting other pin away :-)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Now, with the UART hooked up and the chip in flash mode (by holding the GPIO0 point to ground for about 10sec while connecting the USB side) it's time to get flashing.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
After 10 seconds you can let go and it will stay in flash mode.
|
||||||
|
|
||||||
|
## Time to flash
|
||||||
|
|
||||||
|
Flashing requires a python program called esptool (available [here](https://github.com/espressif/esptool))
|
||||||
|
After getting that working the rest of the flashing part is just one line.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
sudo python esptool.py --port /dev/ttyUSB0 write_flash 0x00000 ../sonoffespwc.bin
|
||||||
|
```
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
I had TX and RX reversed the first time. But after swapping it was done before I knew it :-)
|
||||||
|
|
||||||
|
That was it, now all that's left, install it into the wall.
|
||||||
|
|
||||||
|
## Sources used
|
||||||
|
|
||||||
|
[ESPHOME Documentation](https://esphome.io/devices/sonoff\_t1\_uk\_3gang\_v1.1.html)
|
||||||
79
posts/always-on-irc.md
Normal file
|
|
@ -0,0 +1,79 @@
|
||||||
|
---
|
||||||
|
title: "Always on IRC [Updated]"
|
||||||
|
slug: always-on-irc
|
||||||
|
date: 2018-03-07T21:00:14
|
||||||
|
categories: ["All", "Software Guides"]
|
||||||
|
tags: ["Cloud", "IRC", "Shout", "The Lounge", "VPS"]
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
After visiting 5 times earlier and thinking _This place is so cool, look at all these nerds!_ I became a participant [@revspace](https://www.revspace.nl) in The Hague last January. They have a IRC channel on [Freenode #revspace](https://webchat.freenode.net/?channels=revspace) and though to myself, wow... IRC, I haven't used that since playing counter-strike 1.4 with my friends and being on Quakenet with mIRC and NoNameScript. Oh no brain, you lie, I also used it again briefly when I was following the DailyTechNewsShow podcast live with HexChat.
|
||||||
|
But after getting used to cloud based IM solutions with scrollback abilities and the always online nature of things today I just couldn't shake the feeling I was missing out when HexChat was closed.
|
||||||
|
|
||||||
|
So I configured my VPS to run an always on IRC client and it all works beautifully.
|
||||||
|
|
||||||
|
## Shout Shout let it all Lounge
|
||||||
|
|
||||||
|
I found [Shout](http://shout-irc.com/), which seemed to do everything I wanted to achieve, only to find it has been deprecated. Well shit... Thankfully, a fork exists by the name of [The Lounge](https://thelounge.chat/) that seems actively maintained, so lets try that out instead.
|
||||||
|
|
||||||
|
Nodejs was already installed on my VPS because of a failed project of mine, so I wont be going over how to install node.
|
||||||
|
Installing The Lounge was a piece of cake and because I like living on the edge I want with the pre-release release by running the following command in the terminal.
|
||||||
|
|
||||||
|
npm -g install thelounge@next
|
||||||
|
|
||||||
|
NPM went ahead and downloaded all the dependencies and such and that was that. Easy...
|
||||||
|
Next step, running the thing. I typed
|
||||||
|
|
||||||
|
lounge start
|
||||||
|
|
||||||
|
like the documentation told me and was greeted instantly with a _command not found_.
|
||||||
|
Oopsie, what did I do wrong... nothing! As it turns out it should be:
|
||||||
|
|
||||||
|
thelounge start
|
||||||
|
|
||||||
|
After that I was greeted with the familiar output of a nodejs program and the message a config file had been created. Excellent! On the next line it was complaining that no users existed. So i created one using:
|
||||||
|
|
||||||
|
thelounge add phiax
|
||||||
|
|
||||||
|
And restarted. After logging in successfully, I quit again and changed the config file the reflect what I needed.
|
||||||
|
|
||||||
|
## Making it autostart
|
||||||
|
|
||||||
|
Create the a file /etc/systemd/system/thelounge.service and fill it:
|
||||||
|
```shell
|
||||||
|
\[Unit\]
|
||||||
|
Description=The Lounge IRC client
|
||||||
|
After=thelounge.service
|
||||||
|
|
||||||
|
\[Service\]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/usr/local/bin/thelounge start
|
||||||
|
User=phiax
|
||||||
|
Group=phiax
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=30
|
||||||
|
StartLimitInterval=60s
|
||||||
|
StartLimitBurst=3
|
||||||
|
|
||||||
|
\[Install\]
|
||||||
|
WantedBy=default.target
|
||||||
|
```
|
||||||
|
Then:
|
||||||
|
```shell
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl enable thelounge.service
|
||||||
|
sudo systemctl start thelounge.service
|
||||||
|
```
|
||||||
|
## Making the client
|
||||||
|
|
||||||
|
Normally you would use The Lounge by loading the client in the browser. I decided that I wanted more of a full application feel, cue [Nativefier](https://github.com/jiahaog/Nativefier) a piece of software that makes [Electron](https://electronjs.org/) browser packages out of websites. I'll not go into this in great detail but it should be as easy as running these commands and you'll end up with an executable that you can run.
|
||||||
|
|
||||||
|
npm install nativefier -g
|
||||||
|
nativefier "http://yourserverurl:9000" --tray
|
||||||
|
|
||||||
|
On my android device I let chrome do the honors by sending the page to to home button and enabling push notifications.
|
||||||
|
|
||||||
|
Now I have a clients that are separate from other browser processes that I can keep running in the background. Job done!
|
||||||
|
|
||||||
|
## Update March 8th
|
||||||
|
|
||||||
|
One day after writing this post The Lounge Project decided to overhaul the website, changed the URL and updated the docs to reflect the correct commands. So good job me for jumping on this train one day before a nice change ;-)
|
||||||
37
posts/homehub-history-part-1.md
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
---
|
||||||
|
title: "HomeHub: History part 1"
|
||||||
|
slug: project-update-homehub-history-part-1
|
||||||
|
date: 2014-05-19T13:37:15
|
||||||
|
categories: ["All", "Projects"]
|
||||||
|
tags: ["Domotiga", "Home Automation", "OpenTherm Gateway", "OTGW", "Raspberry Pi"]
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
|
||||||
|
## The beginning
|
||||||
|
|
||||||
|
Ever since moving into my first very own home I've been wanting to start working with home automation.
|
||||||
|
I didn't want to buy a off-the-shelf system (where's the fun in that?) and googled around a bit for possible setups. The first piece of software I came across was Domotiga, which seemed to support most of the things I wanted to achieve. However Domotiga is written in a programming language I had never heard of before (gambas) so changing things to suit my needs was going to be a challenge.
|
||||||
|
No matter, it had everything I wanted so I dusted of my old and broken (the screens gone) notebook and installed everything.
|
||||||
|
My first impression was good, the software had a nice GUI and all the options where there. Onward with the building of things!
|
||||||
|
|
||||||
|
<!--more-->
|
||||||
|
|
||||||
|
## Opentherm Control
|
||||||
|
|
||||||
|
Now that I had selected the software, the first thing I wanted to be able to do was controlling the thermostat. While I was checking out Domotiga, I found it supported something called Opentherm Gateway, so I decided to go and build that with the help of my [brother](http://www.pa3weg.nl "PA3WEG"). After all the parts arrived I went over to his house and we put together the gateway, with some minor adjustments to the design (something about an extra short-circuiting protection or whatever). We then hooked it up to his thermostat and heater system and fired up the supplied utility and set a new Opentherm setpoint and it WORKED, Hooray! :-)
|
||||||
|
With the working gateway in hand I headed home, eager to hook it up to the Domotiga system I had waiting.
|
||||||
|
Once home I hooked it up but nothing happened, the software didn't find the gateway, the utility I had used at my brothers house didn't find it either. So I went back to my brother and we tried it in the same setup as the first time... Nothing! Damn it. My brother got out his trusty diagnostic equipment and we found the one of the transistors was bad, so he replaced it and I took the gateway back home and tried again. This time the utility from the [gateway's website](http://otgw.tclcode.com/ "Opentherm Gateway") found it but Domotiga didn't, did some debugging and opened a topic for support and found that there was a bug in the software so that it didn't initialize the gateway correctly. Well, at least the gateway was working!
|
||||||
|
|
||||||
|
## Changing hardware
|
||||||
|
|
||||||
|
While waiting for a new version of Domotiga with a fix for the gateway I though about the next steps I wanted to do. The first thing that came to mind was that I wanted a low power solution, because it was going to be an always on system and that the system should be wall mounted next to the heater. The notebook Domotiga was installed on was not easily wall mountable and drew more power then I hoped. Then one day, when checking for a new version, I found out that some people also using Domotiga got it working on a Raspberry Pi.
|
||||||
|
Having heard a great deal about the R-Pi's low powered nature I put 2 and 2 together and ordered 2 R-Pi's (why 2? because at the same time I found [OpenElec XMBC](http://openelec.tv/ "Openelec") for R-Pi)
|
||||||
|
|
||||||
|
...And then I waited for the R-Pi's to be delivered. Which I think is a nice place to conclude this first part of the projects history.
|
||||||
|
|
||||||
|
[Read on in part 2](/2015/11/project-update-homehub-history-part-2/)
|
||||||
|
|
||||||
|
### Resources for this article:
|
||||||
|
|
||||||
|
Domotiga available @ [https://www.domotiga.nl/projects/domotiga/wiki/Home](https://www.domotiga.nl/projects/domotiga/wiki/Home)
|
||||||
|
OpenTherm Gateway @ [http://otgw.tclcode.com/](http://otgw.tclcode.com/)
|
||||||
32
posts/homehub-history-part-2.md
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
---
|
||||||
|
title: "HomeHub: History part 2"
|
||||||
|
slug: project-update-homehub-history-part-2
|
||||||
|
date: 2015-11-20T21:00:54
|
||||||
|
categories: ["All", "Projects"]
|
||||||
|
tags: ["433.92MHz", "Domotiga", "Heimcontrol.js", "Home Automation", "OpenTherm Gateway", "OTGW", "Raspberry Pi", "RFXCOM", "rfxtrx"]
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
## Continuing with pi's
|
||||||
|
|
||||||
|
So, I was waiting on the arrival of two Raspberry Pi's. One for XBMC and one for my Home Automation efforts. By now there was a better guide for installing Domotiga on Raspberry so I used that to get started on the new system. It wasn't as easy as I had hoped for with Gambas not wanting to play ball on the 'make install' stage. After a week of tinkering I got Gambas to build and installed Domotiga again. Then I found out Domotiga wasn't entirely made with server/client operation in mind so it took me a while to get it to run as a daemon and getting another install's GUI to connect. Still, I got it running. This time with a fix for the initialization issue. Hooray?!
|
||||||
|
|
||||||
|
## Bye Domotiga, Hello heimcontrol.js
|
||||||
|
|
||||||
|
While domotiga and the gateway where both working at this point in time, I started to dislike the 'hoops' I had to jump through the change the temperature. I needed to start a VM, launch the front-end and connect it to the pi, change the setpoint and logout. Domotiga did not have a good web-interface (maybe it does now) and since I don't know how to code in gambas I kinda decided I wanted something else. The search began for replacement software that I could customize just a bit more. You might have gathered from this paragraphs heading the replacement I found was heimcontrol.js. Now... if by change you already know heimcontrol.js you might just be saying: Heimcontrol.js cannot control a opentherm gateway, and if you said that, you would be right. But with heimcontrol being a node.js app and node.js being JavaScript, a language I'm much more familiar with than gambas, I wrote a little plug-in the control the gateway myself.
|
||||||
|
|
||||||
|
## You're not a programmer, harry?
|
||||||
|
|
||||||
|
I'll be honest, I'm by no means a 'good' programmer, maybe not even a decent one. But when you give me code I can understand it, most of the times I can make something else with it. I've never started coding anything from scratch and this was no exception. I found a plug-in for node.js that let's you read and write to serial ports and used the other parts already included in heimcontrol's arduino commands to make 2 functions that read and write to the gateway. It worked!
|
||||||
|
|
||||||
|
## Heimcontrol.js the epilogue
|
||||||
|
|
||||||
|
With the thermostat now controllable by smartphone it was time to move on to the next part in my setup, lighting. I had previously bought a set of 'Klik aan/Klik uit' 433.92MHz switches, time to hook those up to a free-standing light and off to the races! On wait! I need something to talk to those switches from heimcontrol.js. Queue the purchase of a RFXCOM rfxtrx 433.92MHz gateway, it had a library for node.js ready and waiting to be included in yet another heimcontrol.js plug-in. Well... to save time writing to much about stuff that is long gone from my memory (this article took far to long to publish) it didn't work out. I mean, I succeeded in getting it all the work short term, but when the rfxtrx picked up anything wrong or unknown, either from RF interference or the neighbors 433.92MHz weather station, it crashed, probably due to half read device ID's or something but I wasn't going to stick around to find out.
|
||||||
|
|
||||||
|
You can read why in the next part.
|
||||||
|
|
||||||
|
### Resources for this article:
|
||||||
|
|
||||||
|
Domotiga available @ [https://www.domotiga.nl/projects/domotiga/wiki/Home](https://www.domotiga.nl/projects/domotiga/wiki/Home)
|
||||||
|
Heimcontrol.js available @ [https://ni-c.github.io/heimcontrol.js/](https://ni-c.github.io/heimcontrol.js/)
|
||||||
|
RFXCOM node.js plug-in @ [https://github.com/rfxcom/node-rfxcom](https://github.com/rfxcom/node-rfxcom)
|
||||||
|
OpenTherm Gateway @ [http://otgw.tclcode.com/](http://otgw.tclcode.com/)
|
||||||
42
posts/homehub-moving-to-home-assistant.md
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
---
|
||||||
|
title: "HomeHub: moving to Home Assistant"
|
||||||
|
slug: homehub-moving-to-home-assistant
|
||||||
|
date: 2018-02-04T14:37:43
|
||||||
|
categories: ["All", "Projects"]
|
||||||
|
tags: ["Hass.io", "Home Assistant", "Home Automation"]
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
## Bye HomeHub
|
||||||
|
|
||||||
|
We left the HomeHub story running heimcontrol.js with home made plug-ins for the opentherm gateway and RFXcom. I say running but it was crashing all the time. Months passed without running anything, I couldn't be bothered resetting the node.js application every time it decided to quit on me. Frustrated and disappointed the whole thing was pushed on the I'll get to it when I feel like it track. In this case it took about a year to do anything else.
|
||||||
|
|
||||||
|
But revenge is a dish best served with good intentions ;-)
|
||||||
|
|
||||||
|
## Re-ignite
|
||||||
|
|
||||||
|
During a visit to the open door day [@revspace](https://www.revspace.nl) and walking around talking to people, there was one man typing on a notebook, editing a configuration file and checking a webpage. It suspiciously looked like home automation software due to all the things labeled with names like living-room, kitchen, curtains and lights. One inquiry later I had learned this piece of software was called home assistant and that it was an open source package for home automation with a solid userbase and lots of plug-ins ready to go. Color me intrigued! This might just be what I was trying to achieve with all that old shit at home.
|
||||||
|
|
||||||
|
## Everything's coming up (mil)house
|
||||||
|
|
||||||
|
Time to dust of that RFXcom and hook up that opentherm gateway, there's a new kid in town and he is very easy going.
|
||||||
|
Setting up my coco light switches with the RFXcom only took me 10 minutes, holy smokes, this system is awesome!
|
||||||
|
The opentherm gateway took a bit longer but ultimately with a little help from the community that also integrated well. My solution can be found [here](https://www.phiax.nl/2018/02/snippet-opentherm-gateway-for-home-assistant/).
|
||||||
|
|
||||||
|
That's 2 for 2, this was going well. Time to go full throttle and find out what else I can cook up.
|
||||||
|
|
||||||
|
How about automatically turning off all the lights whenever I leave home? Yep, that can be done. I needed to add some sort of presence detection for this. Following the [getting started guide](https://home-assistant.io/getting-started/presence-detection/) luckily already covers that topic so settings that up was also a breeze. I opted for the owntracks route. Setting up zones for my home, work, my moms, my sister's and my brother's place, because why not? :-)
|
||||||
|
Next I setup the automation:
|
||||||
|
|
||||||
|
\# Turn off lights when everybody leaves the house
|
||||||
|
- alias: 'Away Mode'
|
||||||
|
initial\_state: True
|
||||||
|
trigger:
|
||||||
|
- platform: state
|
||||||
|
entity\_id: group.all\_devices
|
||||||
|
from: 'home'
|
||||||
|
to: 'not\_home'
|
||||||
|
action:
|
||||||
|
service: light.turn\_off
|
||||||
|
entity\_id: group.all\_lights
|
||||||
|
|
||||||
|
After that I turned on all the lights and went to my mom, whiped out my phone, logged in and checked the states. All lights turned off!
|
||||||
BIN
posts/modifying-frostmourne/attach1.jpg
Normal file
|
After Width: | Height: | Size: 2.6 MiB |
BIN
posts/modifying-frostmourne/attach2.jpg
Normal file
|
After Width: | Height: | Size: 130 KiB |
32
posts/modifying-frostmourne/index.md
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
---
|
||||||
|
title: "Modifying frostmourne"
|
||||||
|
slug: modifying-frostmourne
|
||||||
|
date: 2018-01-29T12:46:24
|
||||||
|
categories: ["All", "Projects"]
|
||||||
|
tags: ["Arduino", "Hass.io", "Home Automation", "IKEA", "MQTT"]
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
## Light it up
|
||||||
|
|
||||||
|
Since getting my epic weapons replica Frostmourne, a sword from a small indie video game called World of Warcraft, I've been slightly annoyed by how little the Ice Shard base lights up. I decided then, some better lighting would spice things up a bit. A trip to IKEA and some double sided tape later, Frostmourne was illuminated by dioder RGB leds. Until the power supply failed...
|
||||||
|
|
||||||
|
## Going from control to ctrl
|
||||||
|
|
||||||
|
No better moment to seriously up the lighting game for this piece of video-game replica history then from a broken state. With the power supply gone, Frostmourne stood in darkness, asleep, waiting, until the time came to rise to power again. The RGB used to be controller by the dioder remote (if you can call it that, it's wired) but that just won't do anymore... Arduino powers activate!
|
||||||
|
|
||||||
|
### Bluetooth it!
|
||||||
|
|
||||||
|
How cool would it be to control the lights with my smartphone, I thought. Settling on Bluetooth as my choice for controlling the dioder after learning about a product called the RFduino, a small Arduino with build-in Bluetooth. I made an android app with a couple of sliders for the color selection based on a project I found on the RFduino forums (I tried finding it again but no dice). Modified the dioder control board to talk to the Arduino and called it a day. It worked, barely...
|
||||||
|
|
||||||
|
### ESP it!
|
||||||
|
|
||||||
|
The Bluetooth version kinda worked for a while but wasn't as successful as I had hoped. By this point I had abandoned both domotiga and heimcontrol.js as my home automation efforts. Let's do this the right way and make something new to could also be controlled by whatever home automation system I wanted. Did some research, came across the node-mcu ESP8266 board and the MQTT protocol and a choice was made. ESP it!
|
||||||
|
Reusing the board I made for the RFduino, now connected to the node-mcu, I loaded the firmware with MQTT support and stuck it all in a breadboard. Having chosen Home Assistant as my new home automation system I easily added the device and started testing. Hooray, it worked!
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Results
|
||||||
|
|
||||||
|
A video of the new ice shard will be inserted here shortly...
|
||||||
BIN
posts/my-3d-printer-setup/attach1.jpg
Normal file
|
After Width: | Height: | Size: 1.5 MiB |
BIN
posts/my-3d-printer-setup/attach2.jpg
Normal file
|
After Width: | Height: | Size: 5.7 MiB |
BIN
posts/my-3d-printer-setup/attach3.jpg
Normal file
|
After Width: | Height: | Size: 6.4 MiB |
42
posts/my-3d-printer-setup/index.md
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
---
|
||||||
|
title: "My 3D Printer setup"
|
||||||
|
slug: my-3d-printer-setup
|
||||||
|
date: 2018-01-16T22:25:17
|
||||||
|
categories: ["3D Printing"]
|
||||||
|
tags: ["3D printing", "Wanhao Duplicator i3 Plus"]
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
## TL;DR
|
||||||
|
|
||||||
|
Since last time I updated this blog (ie: a long time ago) I've bought and returned a Monoprice Maker Select Mini 3D printer, got a Wanhao Duplicator i3 Plus, build an enclosure with IKEA furniture and started printing all sorts of stuff!
|
||||||
|
|
||||||
|
Interested?
|
||||||
|
|
||||||
|
## False start
|
||||||
|
|
||||||
|
I'm not going to dwell on it too long, because the printer is already gone, but the Monoprice Maker Select Mini came recommended for starters. I was impressed by the print quality as it was better than I had expected, but when printing large objects things went badly. Turns out the buildplate was warped, but because the printer was not available here I bought this printer on amazon.com I had to ship it back to the USA, ouch! Later I learned that one week after I bought mine on amazon a local retailer started selling the bloody things!
|
||||||
|
|
||||||
|
Anyway, amazon gracefully refunded the cost of shipping as well as the rest of the order so other then i few lost hours nothing really lost with this false start.
|
||||||
|
|
||||||
|
## Upgrade, or second start?
|
||||||
|
|
||||||
|
I'm not sure if I can call what I did next an upgrade or a second start. With the refunded money and some extra splurging I decided that the local retailer I found was going not going to deliver a Maker Select Mini. Because even tho my time with 3D printing had been short, I had found enough stuff I wanted to make that would not fit the Select Minis build volume. Therefor, after reading some reviews, the printer I chose to get was the Wanhao Duplicator i3 Plus, a Prusa i3 style printer. With it's increased build volume, 200x200x180mm instead of 120x120x120mm the Select Mini had, and the loads of resources online for this printer including all sorts of modifications to make it even better, it seemed like a purchase as my next first 3D printer.
|
||||||
|
|
||||||
|
## Unboxing and enclosing
|
||||||
|
|
||||||
|
When the i3 Plus was delivered, the box I got was a bit bigger then the box the Select Mini came in, logical, it's a bigger printer. I had hoped it would fit on the shelf the Select Mini had stood on but alas. Damn, where am I going to leave this printer. Oh well, the dinner table will be just fine... for now.
|
||||||
|
|
||||||
|
I had spied an [IKEA LACK based enclosure](http://www.instructables.com/id/3d-Printer-Enclosure-from-Upcycled-Furniture/) earlier, but the aesthetic of this option wasn't really to my liking, then I found this [IKEA STUVA based enclosure](https://makerhacks.com/ikea-3dprinter-enclosure/) which I liked a lot more, however, I wasn't about to put that enclosure on my desk, it wouldn't fit. Then I thought, GO BIG OR GO HOME, went to IKEA and got a larger STUVA storage shelf, a clothes rod and two of those SINDVIK glass doors and the hinges to match. Build a enclosure out of that and thought: Shit, I don't like this, the enclosure is evenly split and I want a more proportional approach. So I went back to IKEA, got two extra shelfs, another SINDVIK glass door at half height and a solid half height door (or so i thought) to split the storage space in three.
|
||||||
|
|
||||||
|
I fitted the first 'half height' glass door, shelf and fitted the clothes rod. Yes, looking good. Proceeded to fit the full height glass door, shelf and put the printer on that. YES, looking just like I wanted! One door left! SHIT! it's too high.
|
||||||
|
Turns out I miscalculated the height of the shelf/doors so the last door would not fit. I still want to close this part off somehow but for now it's going to be fine.
|
||||||
|
|
||||||
|
## So...Yeah... 3D Printing!
|
||||||
|
|
||||||
|
I'm sure this will be just the start of my 3D printing adventures, I'm not entirely happy with how it turned out with the missing bottom door but for now it will definitely do. Hopefully I will fix that later but I think 3D printing experience is more important right now. I'm sure that the more I print, the more other changes I will think of.
|
||||||
|
|
||||||
|
[
|
||||||
|
|
||||||
|
[
|
||||||
|
|
||||||
|
[
|
||||||
BIN
posts/sensors-sensors-everywhere/attach1.jpg
Normal file
|
After Width: | Height: | Size: 2 MiB |
BIN
posts/sensors-sensors-everywhere/attach2.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
posts/sensors-sensors-everywhere/attach3.png
Normal file
|
After Width: | Height: | Size: 286 KiB |
BIN
posts/sensors-sensors-everywhere/attach4.jpg
Normal file
|
After Width: | Height: | Size: 1.8 MiB |
56
posts/sensors-sensors-everywhere/index.md
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
---
|
||||||
|
title: "Sensors, Sensors everywhere"
|
||||||
|
slug: sensors-sensors-everywhere
|
||||||
|
date: 2018-07-26T22:09:45
|
||||||
|
categories: ["3D Printing", "Projects"]
|
||||||
|
tags: ["3D printing", "BME280", "DHT22", "ESPEasy", "Hass.io", "Home Assistant", "Home Automation", "MH-Z19b", "MQTT", "Wemos"]
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
It's been a while since the last update, so I really need to get this update out there before I fall into the trap of not maintaining this website for 2 years again.
|
||||||
|
Luckily I have not been sitting idle the last months and have been making good progress on my Home Assistant installation (after needing to restart 5 times due to corrupt SD cards, dammit).
|
||||||
|
Nonetheless, I now have 3 ESPEasy powered sensor boxes.
|
||||||
|
|
||||||
|
In April in decided I wanted to keep track of the air quality in my home. I'm often in the same room for hours on end (in front of the PC) and I tend to forget to open the windows to let fresh air in.
|
||||||
|
It would be fun if my home could tell me that I really should open the window or air vents right? Indeed!
|
||||||
|
|
||||||
|
Some research later I settled on the DHT22 sensor connected to a Wemos D1 mini with ESPEasy as the [documentation](https://www.letscontrolit.com/wiki/index.php/DHT11_DHT22) for this was easy to understand and the sensors are cheap. But since that only does temperature and humidity I also opted to get the MH-Z19 for Co2 levels because there is [documentation](https://www.letscontrolit.com/wiki/index.php/%22CO2_Sensor_MH-Z19%22) for that sensor also.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Quickly after finishing this build on a breadboard I realized I did not like the results that the DHT22 gave me, they seemed off. Maybe the sensors I got where bad or something but whatever it was the temperature readings where a few degrees Celsius too high and rather then addressing that I went _ah fuck it_ and ordered 5 BME280 sensors, which are smaller and also measure air pressure because why not.
|
||||||
|
|
||||||
|
I also ordered a couple of triple bases for the Wemos D1's thinking that would make a huge difference in the ease of mounting it all in a 3D printed enclosure, but to be honest, those are probably not needed at all. Anyway, I wired it all up and got to work on the Home Assistant side of things. Luckily, pushing to HA from ESPEasy is really straightforward, so it was a breeze to setup.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
But then the BME280 did not return any values, the MH-Z19 was working fine so I knew the ESP was working as it should have. I had no clue how to check if the sensor was working correctly although as I'm writing this I figure I should have spend some more time diving into the inner workings of the BME280 but instead of that I just opted to replace the part, I had 5 of them anyway and I only plan to build 3 sensor boxes. The replacement worked like a charm.
|
||||||
|
|
||||||
|
## Next up, printing an enclosure
|
||||||
|
|
||||||
|
Thingiverse is a incredible place to start looking for anything you could think of. Search for Wemos enclosures produced [this](https://www.thingiverse.com/thing:2225204) handy case. While useful as is I wanted more sensors in one enclosure so I began modifying the design to be 3 times as wide and include holes for the sensors using Tinkercad. I had only used Autodesk 123d before this once and while I would have preferred to do this in open source software like Openscad the learning curb is just a bit to high for this instance, otherwise I would not have opted for Tinkercad because of the cloud based nature of the service.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Even in Tinkercad I had some difficulty getting the design I wanted, most edits I did left small lines and surface height differences as seen on the left here :-)
|
||||||
|
But I figured that with the resolution of my 3D printer that would just not matter and i was right about that.
|
||||||
|
|
||||||
|
After exporting the design I started up the 3D printer and got to printing, only I made a mistake with bottoming out the design so the print failed hilariously.
|
||||||
|
|
||||||
|
https://www.youtube.com/watch?v=ZnGaeXxAnfM
|
||||||
|
|
||||||
|
After quickly fixing that mistake I tried again, this time with more success.
|
||||||
|
|
||||||
|
https://www.youtube.com/watch?v=CCCDR7wXKbs
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Then all that was left was placing the sensors, connecting everything and closing the enclosure with 2 M6 bolts.
|
||||||
|
|
||||||
|
I used a hot-glue to make sure the sensors say in place for the first build but for the next two boxes the tension of the wires keeps them from going anywhere so I left the hot-glue off.
|
||||||
|
|
||||||
|
## Update:
|
||||||
|
|
||||||
|
I have not cleaned up the model or made a V2 yet as I wanted but i'm sharing the V1 files with the ugly lines anyway :-)
|
||||||
|
|
||||||
|
[Thingiverse link](https://www.thingiverse.com/thing:4262670)
|
||||||
|
[Self-Hosted mirror](https://cloud.phiax.nl/index.php/s/HoRFjFNxJsWitDS)
|
||||||
BIN
posts/snippet-opentherm-gateway-for-home-assistant/attach1.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
65
posts/snippet-opentherm-gateway-for-home-assistant/index.md
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
---
|
||||||
|
title: "Snippet: OpenTherm Gateway for Home Assistant"
|
||||||
|
slug: snippet-opentherm-gateway-for-home-assistant
|
||||||
|
date: 2018-02-04T15:18:12
|
||||||
|
categories: ["All", "Snippets"]
|
||||||
|
tags: ["Home Assistant", "Home Automation", "MQTT", "OpenTherm Gateway", "OTGW"]
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
## Adding the OpenTherm Gateway to Home Assistant
|
||||||
|
|
||||||
|
These are the steps I took to add my own opentherm gateway to home assistant. May this example help you add yours.
|
||||||
|
|
||||||
|
Assumptions: You have a working home assistant installation, you have a working MQTT broker on the same machine or enabled the embedded MQTT broker (which is what i'm using) and you have connected the OTGW via serial or FTDI usb.
|
||||||
|
Firstly follow the installation instructions available on [py-otgw-mqtt's](https://github.com/martenjacobs/py-otgw-mqtt) github page.
|
||||||
|
|
||||||
|
On step 4 of those instructions you make your configuration settings. These are mine.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"otgw" : {
|
||||||
|
"type": "serial",
|
||||||
|
"device": "/dev/ttyS0",
|
||||||
|
"baudrate": 9600
|
||||||
|
},
|
||||||
|
"mqtt" : {
|
||||||
|
"client_id": "otgw",
|
||||||
|
"host": "127.0.0.1",
|
||||||
|
"port": 1883,
|
||||||
|
"keepalive": 60,
|
||||||
|
"bind_address": "",
|
||||||
|
"username": "username",
|
||||||
|
"password": "password",
|
||||||
|
"qos": 0,
|
||||||
|
"pub_topic_namespace": "value/otgw",
|
||||||
|
"sub_topic_namespace": "set/otgw",
|
||||||
|
"retain": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Then edit your configuration.yaml file, I'm not very familiar with this syntax yet but spacing seems very important.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
climate otgw:
|
||||||
|
- platform: mqtt
|
||||||
|
name: "Thermostaat"
|
||||||
|
modes:
|
||||||
|
- auto
|
||||||
|
current_temperature_topic: "value/otgw/room_temperature"
|
||||||
|
temperature_command_topic: "set/otgw/room_setpoint/temporary"
|
||||||
|
temperature_state_topic: "value/otgw/room_setpoint"
|
||||||
|
```
|
||||||
|
|
||||||
|
And that's it. If all went well you should see a new section on reloading your configuration.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Edit 2019-03-22: Shortly after writing this snippet a proper [HA OpenTherm component](https://www.home-assistant.io/components/opentherm_gw/) was added, I would advice the use of that over this snippet.
|
||||||
|
|
||||||
|
Just to address one thing I left out originally, you can change the step amount by adding the following entry to you customization. (it might also work in the main config but i'm not sure about that)
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
climate.thermostaat:
|
||||||
|
target_temp_step: 0.5
|
||||||
|
```
|
||||||
BIN
posts/surface-mount-spacers/attach1.jpg
Normal file
|
After Width: | Height: | Size: 799 KiB |
BIN
posts/surface-mount-spacers/attach10.jpg
Normal file
|
After Width: | Height: | Size: 774 KiB |
BIN
posts/surface-mount-spacers/attach2.jpg
Normal file
|
After Width: | Height: | Size: 2.5 MiB |
BIN
posts/surface-mount-spacers/attach3.jpg
Normal file
|
After Width: | Height: | Size: 858 KiB |
BIN
posts/surface-mount-spacers/attach4.jpg
Normal file
|
After Width: | Height: | Size: 867 KiB |
BIN
posts/surface-mount-spacers/attach5.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
posts/surface-mount-spacers/attach6.jpg
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
posts/surface-mount-spacers/attach7.jpg
Normal file
|
After Width: | Height: | Size: 2 MiB |
BIN
posts/surface-mount-spacers/attach8.jpg
Normal file
|
After Width: | Height: | Size: 1,005 KiB |
BIN
posts/surface-mount-spacers/attach9.jpg
Normal file
|
After Width: | Height: | Size: 930 KiB |
57
posts/surface-mount-spacers/index.md
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
---
|
||||||
|
title: "Surface mount spacers"
|
||||||
|
slug: surface-mount-spacers
|
||||||
|
date: 2020-06-10T18:47:06
|
||||||
|
categories: ["3D Printing", "All", "Quicky"]
|
||||||
|
tags: ["3D printing", "DIY"]
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
_Well well well... The Sonoff TX switches where doing what they should do but another issue cropped up._
|
||||||
|
As i said in my last post my old light switches are of the surface mount kind. The wall socket or whatever it's called was not the right size for the new screwholes.
|
||||||
|
|
||||||
|
## The problem
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
It almost fit right but clearly there was a gap and the wiring was trying to push the switch away from the wall.
|
||||||
|
|
||||||
|
Which is even more noticeable when grabbing it. Clearly this wasn't going to work for longer term installation.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Then I looked at the old switches and low and behold, it had some kind of spacer plate to fit the surface mount stuff on it
|
||||||
|
|
||||||
|
This spacer gave me an idea.
|
||||||
|
|
||||||
|
Why not make a new spacer and 3d print it.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## The solution
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
This is the final version I cooked up in tinkercad.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
This was the first draft off the printer.
|
||||||
|
|
||||||
|
The first version I made did not have deep enough screw holes and was not wide enough so the Sonoff could not fit over it and stuck out.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
The second version fit a lot better and the bottom screw slot did wonders for aligning the spacer level. Jeez these boxes are crooked.
|
||||||
|
|
||||||
|
Here is the sonoff switch. You can see the screws in the wall on the top and bottom, and the switch to spacer screws left and right.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
While the switch is now sticking out a bit more but I like this much better. I'd say this was successful :-D
|
||||||
|
|
||||||
59
posts/using-hugo-with-docker.md
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
---
|
||||||
|
title: 'Using Hugo With Docker'
|
||||||
|
slug: using-hugo-with-docker
|
||||||
|
date: '2026-01-25T20:21:19Z'
|
||||||
|
categories: ["Web", "All"]
|
||||||
|
tags: ["Web", "HUGO", "Static Site"]
|
||||||
|
draft: true
|
||||||
|
---
|
||||||
|
|
||||||
|
Lately I've been going over the way I have things setup with my docker stacks and going over the stuff that I use and if that still makes sense for current me.
|
||||||
|
One of the things that stood out was my own homepage, the one you are reading this on. It was running on Wordpress before I started this article but hopefully will be made with [HUGO](https://www.gohugo.io/) from this point on.
|
||||||
|
|
||||||
|
In the ever changing landscape of the internet I was feeling less and less at home with Wordpress, it requires more upkeep then I would like, it's heavy, relies on lot's of third-party plugins with questionable security practices, and overall felt less of a good fit with how my views and skills have changed over time.
|
||||||
|
When looking around with what I wanted to use in it's place, [HUGO](https://www.gohugo.io/) came up again and again. I knew I wanted to go with a static site generator because of the security implications.
|
||||||
|
After all, I don't really need very much interactive features so just flat HTML + CSS makes sense and it makes it really hard to exploit with any PHP or SQL shenanigans.
|
||||||
|
|
||||||
|
Most other static site generator I found where still focused heavily on silicon valley concepts with massive amounts of mentions to tracking, interaction with cloud services, e-commerce ready, social media aware scale-out marketing bullshit.
|
||||||
|
All the stuff I hate about the modern web.
|
||||||
|
Sure [HUGO](https://www.gohugo.io/) has those options too, but it kept cropping up in all my searches, so I'm going to give it a go!
|
||||||
|
|
||||||
|
<!--more-->
|
||||||
|
|
||||||
|
## Okay, so it's going to be HUGO, now what?
|
||||||
|
|
||||||
|
HUGO's documentation on running with docker is a bit on the sparse side but I've managed to work it out enough to make a working deployment.
|
||||||
|
|
||||||
|
|
||||||
|
from project dir #/opt/hugo/
|
||||||
|
|
||||||
|
#### Test if container works version
|
||||||
|
```shell
|
||||||
|
docker run --rm -v .:/project -u $(id -u):$(id -g) ghcr.io/gohugoio/hugo:latest version
|
||||||
|
Expected:"hugo v0.154.5+extended+withdeploy linux/amd64 BuildDate=unknown VendorInfo=docker"
|
||||||
|
```
|
||||||
|
#### create new
|
||||||
|
```shell
|
||||||
|
docker run --rm -v .:/project -u $(id -u):$(id -g) ghcr.io/gohugoio/hugo:latest new site <NAME>
|
||||||
|
cd <NAME>
|
||||||
|
git init
|
||||||
|
#git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
|
||||||
|
echo "theme = 'phiaxnl'" >> hugo.toml
|
||||||
|
```
|
||||||
|
#### create content
|
||||||
|
```shell
|
||||||
|
docker run --rm -v .:/project -u $(id -u):$(id -g) ghcr.io/gohugoio/hugo:latest new content content/posts/my-first-post.md
|
||||||
|
```
|
||||||
|
#### run empty dev server
|
||||||
|
```shell
|
||||||
|
docker run --rm -v .:/project -u $(id -u):$(id -g) -p 80:1313 ghcr.io/gohugoio/hugo:latest server --bind="0.0.0.0" --noHTTPCache
|
||||||
|
```
|
||||||
|
#### build draft
|
||||||
|
```shell
|
||||||
|
docker run --rm -v .:/project -u $(id -u):$(id -g) -p 80:1313 ghcr.io/gohugoio/hugo:latest server --bind="0.0.0.0" --noHTTPCache --buildDrafts
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
#### Sources
|
||||||
|
https://gohugo.io/getting-started/quick-start/
|
||||||
|
https://github.com/gohugoio/hugo/pkgs/container/hugo
|
||||||