Category: Tutorials

  • Adding IKEA Trådfri to Home Assistant

    Adding IKEA Trådfri to Home Assistant

    This is not a paid advertisement. Most of the stuff I have ever bought from IKEA has turned out being crap in the long run (some very shortly) and that is why I normally keep avoiding their products as long as there are any reasonable alternatives available. However, now I have been satisfied so far after buying a Trådfri smart lighting kit and a punch of smart light bulbs.

    I was inspired by this article. I recommend you to have a look at it. It explains the technology and gives some idea of the overall setup. It is also a good introduction to what we are going to do next in this post. In case you have no idea what is Home Assistant, have a look their web page and also read this article. The aim here is to integrate Trådfri devices into the Home Assistant system.

    Ok, let’s get the basics away. Setting up the Trådfri kit is straight forward, on a pseudo level it goes like this:

    1. Download and install the mobile app
    2. Plugin the gateway to LAN network and power supply
    3. Configure the gateway using the mobile app
    4. Couple the remote control with the gateway
    5. Couple the light bulbs with the remote control

    Coupling the remote control with the other device is easy, basically just keep the device near to each other and press long the button until a light blinking indicates it is ready. The mobile app will guide you through anyway and if you face any problems, look at the detailed Trådfri manuals.

    After you have everything linked together within the Trådfri platform, you may be happy to control the lights with the Trådfri mobile app. Or not, if you wish to get them utilized for more advanced automation. For that, let’s link them to Home Assistant. This naturally requires a properly working instance of Home Assistant software running on a device like raspberry Pi or any other computer constantly serving the software.

    If you followed my previous Home Assistant blog post and you already have hass.io or any other Home Assistant installation running, bear with me and follow along.

    So, open your Home Assistant GUI in your web browser. If everything went as supposed to, you should automatically see Configurator suggesting to configure your Trådri device. If not, try restarting the Home Assistant.

    Click configure and type the security code from the bottom of the hub device.

    Voilà! You should be able to see all your Trådfri light bulbs in the user interface and be able to fully control them!

    Great, now we have them on the same platform as our possible other home automation systems, which opens infinite possibilities what comes to automating them.

    Next you may want to check out some basic light automation tricks by reading this post.

  • Nextcloud Client for Linux

    Nextcloud Client for Linux

    If you have been following the open source cloud storage software scene lately, you may know the history of ownCloud and Nextcloud. In short, Nextcloud is a fork of ownCloud, an open source project that consists of client and server software for creating and running file hosting services for personal and enterprise use. I personally understood that the project split up after some key persons could not share a same vision  regarding the level of having close source code for the enterprise customers. Since I may have totally misunderstood what it was all about, have a look at yourself: Nextcloud’s introduction and ownCloud’s statement about it.

    I am a huge fan of the project, I liked the idea of former ownCloud and later I got along with Nextcloud. However, all the software were available for all kinds of platform very shortly after the split up. I still missed the Nextcloud branded desktop client for Linux. There was a some sort of theming repository available but it was not straight forward to install for a less advanced user. And even today the default client in the “app stores” of many Linux distributions for this service is the original ownCloud branded client software.

    In case you have also being looking forward the Linux Nextcloud client, here they are, you can download it for Ubuntu/Debian as a PPA (explanation). To do so, use command line (open Terminal) and type:

    sudo add-apt-repository ppa:nextcloud-devs/client
    sudo apt-get update
    sudo apt install nextcloud-client

    Happy Nextclouding!

  • Getting on with Hass.io

    Getting on with Hass.io

    The first time I tested Home Assistant software was couple of years ago and it was on Linux desktop. I liked the idea and the execution, and it made me think I would like to able to build my own custom kit for some random home automation. So I decided I will get back to this as soon as I have a suitable platform to constantly run the software on. Later on, I found myself having a spare piece of Raspberry Pi 2 mini computer. Since then I have happily run Home Assistant on my Raspy and used it mostly for some lighting adjustments etc. Back then I installed my Home Assistant as Hassbian, which is a customized operating system for the Raspberry Pi. It was so far the easiest to install and use but requires the traditional command line access for maintenance actions. And now this may have changed. Follow through this tutorial and become a Home Assistant user in no time! All you need is a Raspberry Pi and minimum 4 GB SD card.

    Hass.io is a dedicated operating system that takes care of installing and managing Home Assistant software on Raspberry Pi. It was introduced in H0me Assistant blog post at the end of July 2017.

    Installation

    Let’s dive in. You may start the installation by looking at these instructions. Choose and download the software package depending on which device you are going to install Hass.io on. I went with Raspberry Pi 2. Extract the resinos-hassio-1.0-raspberrypix.img.bz2 file and flask it to your SD card using Etcher. Flashing may take up to 5-10 minutes. At this point we could setup the WiFi or static IP as the instructions suggest as an optional step. However, we go now without it. Since I will be are using an Ethernet connection with a router there should be no configuration required and it should work out of the box. Also, one could consider setting up a static address being not necessary – or even recommended at all. All right, let’s insert the SD card into Raspberry Pi and switch on the device.

    You can open a new browser tab and navigate to http://hassio.local:8123/ and wait couple of minutes. After the reboot ResinOS downloads Home Assistant and starts the installation. You will be soon able to see the following view at your browser window:

    preparing hass.io

    For me it took around 15 minutes Hass.io being setup and running. You will see the default Home Assistant welcome screen in your browser:

    welcome screen

     

    Getting Started

    Nice. Now we have a fresh Home Assistant installation properly running. Obviously the next actions are setting up configurations and automations. To do so, we still need to do some adjustments. The design philosophy of Hass.io seems to be making the management of Home Assistant via web browser GUI as easy as possible. However, as far I know it does not yet support full control over the configuration files. Hence, we need to build some kind of access to the file base. There are couple of options for this but for sake of simplicity we deside not to prefer any command line tool for this but go with Samba add-on, which gives us a way to handle the files on our local desktop environment.

    To install Samba follow these step on your Home Assistant instant opened in browser windows:

    1. On the left hand side menu click on Hass.io tab
    2. You will be noted there are no add-on installed, click on the link to add-on store
    3. Add-on store opens in the same view
    4. Scroll down to Samba Share and select it
    5. Click install
    6. It shows Info and Options but go with the defaults and click Start
    7. On the left menu again, select the first icon (Services) under Developer Tools
    8. Select the Domain as homeassistant and as Service set restart
    9. Then click on Call Service
    10. You will see a notification Connection lost. Reconnecting…
    11. After a minute or two Home Assistant is rebooted and Samba Sharing should be enabled

    Now you are able to find your Hass.io files from your desktop computer that is using the same WiFi network as the Rasbperry Pi. You can browse in the file system Network folder and find HASSIO directory. On Ubuntu it looks like this:

    windows sharing

    There you can find configuration.yaml and automations.yaml-files, which allow you to freely tweak and customized your Home Assistant installation as normally. Look at the tutorial and example resources at Home Assistant website to get started. Also, come back to check my next Home Assistant post I will make for introducing some of the basic and most useful setups. Good luck!

  • Joomla! Installation on Remote Server

    Joomla! Installation on Remote Server

    To install Joomla! -publishing platform on remote server follow the these steps:

    1. Login to you server account via ssh: ssh username@service.com and enter your credentials.
    2. cd to the right directory you are intended to serve your web site from (public_html, www or similar)
    3. Download Joomla! installation package: wget https://downloads.joomla.org/cms/joomla3/3-7-3/Joomla_3.7.3-Stable-Full_Package.tar.gz You can check the latest version at: https://downloads.joomla.org/ but see the note at the end of this post!
    4. Extract the package: tar -xzvf Joomla_3.7.3-Stable-Full_Package.tar.gz
    5. Open browser and navigate to website.service.com
    6. Joomla! web installer opens up
    7. Define Site Name, Description and Super User Account Details
    8. Input Database details
    9. See the summary that all the system requirements are fulfilled and press install
    10. Installation is run in seconds
    11. After the installation is ready you may download language packages right away if needed or continue by logging into the site as administrator.

    Note: At the time of writing the latest stable version of Joomla! was Joomla_3-7.4-Stable-Full_Package. However, while trying to install that version I run into problems. The installation got stuck in the first step. It seemed that it was a bug that many people had faced and based on the this discussion on github it will be fixed for the next version. Until then I recommed installing 3.7.3 as done above and updating the software right after the process. The previous full packages of Joomla! can be found at https://downloads.joomla.org/cms. Click on Downloads to display the official series of Joomla! releases.

  • WordPressin asennus Kapsille

    WordPressin asennus Kapsille

    This tutorial is in Finnish language because it concerns a highly local service.

    WordPress -julkaisualustan asennus on helppoa. Näitä ohjeita seuraamalla asennat julkaisualustan Kapsin tai vastaavan palvelun serverille. Ohje toimii sellaisenaan Linux -käyttöjärjestelmällä, kuten Ubuntu tms. Windowsilla komentoja täytyy soveltaa ja esim. ssh:n sijasta käyttää Putty-ohjelmaa tai vastaavaa.

    1. Aluksi tarkista, että sinulta löytyy tarvittavat tiedot tulevia toimenpiteitä varten. Tarvitset tunnukset palvelimelle, jossa kotisivuhakemistosi sijaitsee sekä tunnukset ja salasanan tietokannan määrittämistä varten. Kapsilta tietokannan (MySQL) saa käyttöön ylläpidolta pyytämällä.  Mikäli haluat uuden alidomainin WP-sivustolle (esim. sivusto.kapsi.fi), myös näitä saa Kapsin ylläpidolta pyytämällä .
    2. Avaa ssh-yhteys palvelimelle. Linuxilla komennolla:
      ssh username@kapsi.fi
    3. Syötä palvelun salasana
    4. Navigoi oikeaan sivustohakemiston www-kansioon komennolla:
      cd sites/sivusto.kapsi.fi/www
      Vinkki: komentorivin kautta navigointia helpottaa jos esim cd sites -komennolla yhden hakemistoportaan siirtymisen jälkeen tarkistaa alikansiot komennolla ls.
    5. Lataa WordPressin asennuspaketti komennolla:
      wget https://wordpress.org/latest.tar.gz
    6. Pura pakattu asennuspaketti komennolla: tar -xzvf latest.tar.gz Tiedostot purkautuvat wordpress -nimiseen kansioon.
    7. Mikäli haluat että WP toimii sivuston juuressa, siirrä kansion sisältö yhden hakemistotason ylemmäs ja poista wordpress -hakemisto. Tai jos haluat käyttää WP -julkaisuja nykyisen kotivun alisivustona uudelleennimeä tämä uusi hakemisto esim. blog -nimiseksi, jolloin sen URL on sivusto.kapsi.fi/blog
    8. Siirry selaimella osoitteeseen sivusto.kapsi.fi tai sivusto.kapsi.fi/blog sen mukaan mikä polku asennukselle valittiin.
    9. Selaimeen aukeaa WP-asennuksen viimeistelyikkuna
    10. Ensimmäiseksi määritetään tietokanta: tietokannan nimi, käyttäjätunnus, salasana, tietokantapalvelin (db1.kapsi.fi) ja tietokantataulujen etuliite (wp_), eli prefix. Prefix mahdollistaa saman tietokannan käytön useammalle ohjelmalle (esim. OwnCloudin etuliitteksi oc_ jne).
    11. Tämän jälkeen asetetaan sivuston nimi, sivuston ylläpitäjän käyttäjätunnus ja salasana sekä sähköpostiosoite. Sivuston nimen voi vaihtaa myöhemmin, mutta käyttäjän tiedot kannattaa asettaa huolellisesti, jotta sivustolle pääsee heti ongelmitta kirjautumaan.
    12. Kirjaudu sisään. WP on valmis uusien julkaisujen tekemistä varten!