hassio – Automation Fixation https://automation.moebius.site A site dedicated to home automation and technologies. Sun, 28 May 2023 07:12:51 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.4 156416546 Home Assistant: Cheap and Easy Sprinkler Automation https://automation.moebius.site/hassio-home-assistant-cheap-and-easy-sprinkler-automation/ Wed, 30 Jan 2019 12:10:10 +0000 http://automation.moebius.site/?p=278 What you will need:
  • Sonoff Switch – I’m using the Sonoff Wifi Smart Switch with Tasmota firmware installed. See my video on how to install the switches ($15.57)
  • 24V Solenoid Valve – A quick search on Amazon. will find something similar
  • 24V Power Supply (1A 24W) – This one from Amazon will work
  • Dual end hose connector
  • Optional items
    • Reducer
    • Metal adapters – I bought these from Bunnings ($10.31 x 2)
  • Assumed existing items
    • Existing pump/mains water supply with a tap head
    • Existing Sprinkler System and pipes
Total Cost: $72.01 (or $92.63 with optional parts) If you haven’t already seen my initial Hassio setup guide, please visit this link.

Step 1 – Connect the Hose parts

Note: I’ve tried to keep the connections as simple as possible to avoid failure of connectors and potentially draining your tank or wasting mains water.
  • Add a reducer between the brass tap adapter (optional) and the tap to limit the amount of water coming through and to prevent unnecessary pressure on the connectors
  • Screw the brass top adapters (brass is optional — but recommended to ensure hose parts do not break and waste water) to the tap and the solenoid value
  • Connect the solenoid valve together with the tap using the Dual end hose connector

Step 2 – Connect the power

  • Wire up the power plug adapter to the solenoid cable
  • Plug the Sonoff switch into the power point
  • Plug the power supply in the Sonoff Switch
  • Turn on the power and test that the solenoid valve is working as expected

Step 3 – Ensure everything is water safe

Given that you are working around water, ensure the power supply, switch and power plugs are protected from water. I have taped up the connectors and used a plastic container for the switch and keeping my electric components in my pump’s water safe housing.

Step 4 – Turn on the water supply and power

Turn on the water supply and power and test if the sprinklers are turning on as expected.

Step 5 (Optional) – Install Automations for automatic sprinkler shutoff

If you are as forgetful as I am, you might want to add an automation to automatically shut off the sprinkler after a set period of time. I’ve set the following to turn off the switch after 15 minutes:   That’s all it takes for a simple, cheap automated sprinkler system. If you have any comments or questions, please feel free to leave them below.]]>
278
Hassio/Home Assistant: Integration with Google Home https://automation.moebius.site/hassio-home-assistant-integration-with-google-home/ Tue, 15 Jan 2019 13:20:00 +0000 http://automation.moebius.site/?p=170 This post is to take you through how to integrate your Google Home with your Home Assistant/Hassio. The Home Assistant website has a detailed guide including links at the following link.

If you haven’t already seen my initial Hassio setup guide, please visit this link and video

Step 1 – Enable remote access

This has been covered in a separate post. Click here to follow the directions to enabling remote access.

Step 2 – Create an API Key and linked project

From the Google Cloud API Console you will need to create an API Key. This is required if you want to be able to say “Hey Google, resync my devices” to update any devices added to or removed from Home Assistant.

Click on Create

Select a unique project name and click create. If the project name is not unique, Google will automatically append additional characters.

Step 4 – Create a project in Actions on Google console

Go to Actions on Google console and click add/import to import the project you created in Step 3.

Select the project name and click ‘Import Project’

Click the ‘Home Control’ category and then click ‘Smart Home’

Step 4 – Configure the project

Click ‘Build your action’ and then ‘Add action(s)’

Click ‘Add your first action’

Under the ‘Add fulfilment URL’ add in the following and click done:

Example ‘Add fulfilment URL’

https://xxxxx.duckdns.org:8123/api/google_assistant

Go back to the ‘Overview’ page and click on ‘Setup account linking’.

Keep the account creation as “No, I only want to allow account creation on my website’ and click ‘Next’.

Under ‘Linking type’ enter the following and click ‘Next’

Under Client information enter in:

Example configuration

– Client ID issued by your Actions to Google: https://oauth-redirect.googleusercontent.com/
– Client secret: This can be any value
– Authorization URL: https://xxxxx.duckdns.org:8123/auth/authorize
– Token URL: https://xxxxx.duckdns.org:8123/auth/token

Under ‘Configure your client’, add the following:email

Under ‘Testing instructions’, add anything you want and click ‘Save’

Step 5 – Enable testing for project

Click ‘Simulator’ on the left navigation panel

Click ‘Start testing’ and then click ‘Done’.

The device will now be visible in the Google Home app when attempting to add devices. Do not add the device yet.

Step 6 – Add configuration details into your Home Assistant configuration file

Open up your configuration.yaml file and insert the following configuration:

Example Configuration.yaml entry

google_assistant:
project_id: YOUR_PROJECT_ID
api_key: YOUR_API_KEY
exposed_domains:
– switch
– light
– group

Project_id: You should reconfirm the project_id in Actions on Google under Settings cog > Project settings > Project ID. This may be different to the original name you selected as Google will add additional characters if it is not unique.

api_key: Back in the Google Cloud API Console, click on the Overview page and then click ‘Enable’ for HomeGraph API

Under ‘Credentials’, click ‘Create credentials’, ‘API key’

Copy and paste the API key generated into your configuration.yaml file (or secrets.yaml file if you are using this).

Rename the key to something logical so you know what it is for e.g. Hassio Key. Then click ‘Save’.

Save your configuration.yaml file and then restart the Home Assistant server from Configuration > General > Restart

Step 7 – Link your Google Home to your Hassio test project

From within the Google Home App, add a new device by click on the “+” symbol for ‘Add’, ‘Set up a device’, then ‘Have something already set up?’.

Your app should now be visible (e.g. [test] my test app)

After clicking on the device, you will be redirected to your Home Assistant login screen. You will need to enter in your user name and password.

If all goes well, you will be automatically returned to the device management screen and your app should now be linked. A message will appear noting ‘[app name] is linked.

You will automatically be redirected to assign rooms to all the newly added devices from hassio.

The device will now show as being linked in the manage accounts section.

You should now be able to control your devices with your Google home app or google home speaker.

]]>
170
Hassio/Home Assistant: Enabling Remote Access https://automation.moebius.site/hassio-enabling-remote-access/ Mon, 14 Jan 2019 13:10:01 +0000 http://automation.moebius.site/?p=99 In order to access your Hass.io instance from outside of your network, you will need to enable remote access. This is also a prerequisite for enabling the Google Home integration. More information is available on the Home Assistant website at this link.

If you haven’t already seen my initial Hassio setup guide, please visit this link.

Step 1 – Install DuckDNS

You will need to install the DuckDNS addon with Let’s Encrypt support to obtain a valid SSL certificate and domain name for encrypted traffic. From within Home Assistant, click on the Hass.io page on the left hand side navigation menu and click on the add-on store.

Find DuckDNS and click install.

Step 2 – Create a token and domain name

Click through to DuckDNS website and select a domain name and generate a token

Step 3 – Update the configuration in the DuckDNS addon

Copy the token and domain name generated and update the configuration in the DuckDNS addon. These details should match exactly as was generated in Step 2. Make sure you have changed the accept_terms to ‘true’.

Example Configuration

{
“lets_encrypt”: {
“accept_terms”: true,
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
},
“token”: “xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”,
“domains”: [
“xxxxxxxx.duckdns.org”
],
“seconds”: 300
}

Step 4 – Update the configuration in the configuration.yaml file

Within the configuration.yaml file, uncomment the http: section and add in the details per the example below:

Example configuration

http:
base_url: https://xxxxxxxxxx.duckdns.org:8123
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem

Step 5 – Forward Port 8123 to Home Assistant

Within your router, you will need to forward port 8123 to your home assistant IP. If you haven’t already made your Home Assistant to have a static IP address, check my initial video for details on how to upload the network configuration via a USB memory stick.

Step 6 – Restart the device

Restart your Home Assistant by going to Configuration > General > Restart.

Step 6 – Connect via the external address

Your Home Assistant instance should now be accessible from the external domain specified in the previous steps. e.g. https://xxxxxxx.duckdns.org:8123

]]>
99
Hassio/Home Assistant: Installing a Sonoff Switch (Tasmota Firmware) https://automation.moebius.site/hassio-installing-a-sonoff-switch-tasmota-firmware/ https://automation.moebius.site/hassio-installing-a-sonoff-switch-tasmota-firmware/#comments Sun, 06 Jan 2019 12:49:45 +0000 http://automation.moebius.site/?p=88 The Sonoff switches that have been flashed with Tasmota Firmware are compatible with Home Assistant/Hassio. The following guide will take you through the steps to install the required components to allow you to use the switches for automations.

What you will need:

If you haven’t already seen my initial Hassio setup guide, please visit this link.

Option 1 – Installing using Wemo Emulation

Step 1 – Enable Belkin Wemo Emulation

Open your Sonoff Switch interface

Navigate to Configuration > Configure Other, select “Belkin WeMo” and click Save.

Step 2 – Restart your device

Restart your device and your switch will automatically be detected by Home Assistant and visible in the Overview page.

Step 2 – Customize the switch name (optional)

You can customize the name through clicking on the device and clicking on the settings cog.

Change the name and click Save.

The new name will now be reflected in the Home Assistant Overview screen.

Option 2 – Installing through MQTT

While this option takes a bit more effort, I’ve found this to be more reliable than the emulation option.

Step 1 – Enable MQTT on the Switch

As per the Option 1 above, navigate to Configuration > Configure Other, ensure that MQTT is selected as enabled and click Save. If you have enabled the emulation above, you can change it back to “None” to avoid duplicate devices detected.

Step 2 – Add MQTT configurations to Home Assistant configuration.yaml file

For each of the switches to be added, add in the details of the MQTT topics that will be used. I have used the following configurations for a device:

configuration.yaml

mqtt:
password: !secret mqtt_password

switch:
– platform: mqtt
name: “sonoff1795”
state_topic: “stat/sonoff-1795/RESULT”
value_template: ‘{{ value_json[“POWER1”] }}’
command_topic: “cmnd/sonoff-1795/POWER1”
availability_topic: “tele/sonoff-1795/LWT”
qos: 1
payload_on: “ON”
payload_off: “OFF”
payload_available: “Online”
payload_not_available: “Offline”
retain: true

Note: Be sure to include your mqtt_password in your secrets.yaml file.

Step 3 – Restart your device

Within Home Assistant, restart under Configuration > General > Restart.

Step 4 – Configure MQTT on the Sonoff Switch

Navigate to your Sonoff switch’s interface and go to Configuration > Configure MQTT. The details here should match what you have put in your configuration.yaml and secrets.yaml file.

Step 5 – Restart your device

Per Step 3. The switch should now be visible within the Home Assistant Overview screen.

Step 6 – Customize the switch name (optional)

Within Home Assistant, navigate to Configuration > Customization and select the newly installed Switch. Edit the name and click Save.

The new name will now be reflected in the Home Assistant Overview screen.

]]>
https://automation.moebius.site/hassio-installing-a-sonoff-switch-tasmota-firmware/feed/ 2 88
Hassio/Home Assistant: Installing a Ring Doorbell and simple automations https://automation.moebius.site/hassio-home-assistant-installing-a-ring-doorbell-and-simple-automations/ Sun, 06 Jan 2019 12:20:35 +0000 http://automation.moebius.site/?p=65 The Ring doorbell system is compatible with Home Assistant/Hassio. The following guide will take you through the steps to install the Ring Doorbell component and sensors to allow you to use the Doorbell for automations.
Additional details are available under the Ring Component page at the Home Assistant website.

What you will need:

  • A Ring Doorbell
  • Lights for automation (optional) – I’m using the Xiaomi Yeelight Ⅱ RGBW 10W 
  • Switch for automation (optional) – I’m using the Sonoff Wifi Smart Switch

If you haven’t already seen my initial Hassio setup guide, please visit this link. Refer to my Instruction video here or follow the detailed instructions below:

Step 1 – Add Ring configurations to your configuration.yaml and secrets.yaml file

Configurations.yaml

Create a new section for all the ring related configurations.
You will likely already have a ‘sensor’ component, and so add the ring platform as a new line underneath.


If you have not already used camera and binary_sensor components, then add new ones. Otherwise, add the ring platform underneath the existing components.

secrets.yaml

Add in your Ring user name and password details.

Step 2 – Restart your device

Restart your device under Configuration > General > Restart

You should now be able to see the various sensors in your Home Assistant Home page.

Step 3 – Add an automation using the Ring Sensors

I’m currently using the following automations for my Ring Doorbell:

  • Doorbell Motion Light – When Motion is detected and it is dark, turn on my front lamp and garage light.
  • Doorbell Motion Light Auto Off – After motion has stopped, wait and then turn off the front lamp and garage light.
  • Doorbell Motion Notification (when light off) – When Motion detected, flash my kitchen light and play a ding on my Google Home.
  • Doorbell Motion Notification (when light on) –
    When Motion detected, flash my kitchen light and play a ding on my Google Home.
  • Doorbell Ring (when light off) – When doorbell rings, flash my kitchen light and play a ding on my Google Home.
  • Doorbell Ring (when light on) – When doorbell rings, flash my kitchen light and play a ding on my Google Home.

Note: I had some issues with lights staying on, so have made two versions for the notifications to ensure if the light was off before, it will stay off.

Doorbell Motion Light

Triggers:

Conditions:

Actions:

Doorbell Motion Light Auto Off

Triggers:

Conditions: N/A
Actions:

Doorbell Motion Notification (when light off)

Triggers:

Conditions:

Actions:

Doorbell Motion Notification (when light on)

Triggers:

Conditions:

Actions:

Doorbell Ring (when light off)

Triggers:

Conditions:

Actions:

Doorbell Ring (when light on)

Triggers:

Conditions:

Actions:

]]>
65
Hassio/Home Assistant: Initial Installation Guide https://automation.moebius.site/hassio-initial-installation-guide/ Sun, 06 Jan 2019 12:08:46 +0000 http://automation.moebius.site/?p=48

Home Assistant is an Open source home automation tool that is constantly being updated and enhanced through contributions from a large DIY community. Home Assistant is perfect to run on a Raspberry Pi or a local server to bring together various different technologies for a cohesive ecosystem, create automation and rules and integrate with your smart speaker.

This article is targeted to those who are planning to set up Home Assistant using Hassio for the first time. Refer to my Instruction video here or follow the detailed instructions below:

What will you need:

Step 1 – Determine which type of the Home Assistant build is correct for you.

Home Assistant is the program which we will be using and can pretty much be built to work on most key operating systems. However, there are a couple of different builds that are available depending on the technology and purpose for automation including:

  • Hass.io – Hass.io aka Hassio is an appliance (locked down) version of Home Assistant and is recommended for beginners.
  • Hassbian – Raspbian Linux flavor, Debian on Pi, preconfigured for HomeAssistant. This is recommended for advanced users or people who wish to do more on their Raspberry Pi.

For the purposes of this article, we will be using Hassio. The Hassio site has a detailed installation instructions within their webpage however, there are a few steps that are unclear which are further explained below.

Step 2 – Determine the correct image

Determine which device to which you will be deploying Hassio. For this guide, we will be installing onto a Raspberry Pi 3 Model B and have selected the Raspberry Pi 3 Model B and B+ 32bit image at the following link. Commence download of the file as it will take some time depending on your download speed.

Step 3 – Download and install flashing software

You will need software to install the Hassio image onto your MicroSD card. I recommend using Etcher which is a free, open source software to flash devices.

Step 4 – Flash Hassio image to MicroSD card

Use your preferred software to flash the image downloaded in Step 2 onto a MicroSD card.

Step 5 – Install the WiFi connectivity instructions

If you are planning to use WiFi on your Hassio build, then you will need to create a file on a USB memory stick and plug it into the Raspberry Pi before you boot it up.

  • Format the USB stick in FAT32 format
  • Create a folder called Network and a file called hassos-wifi within the Network folder (i.e. \network\hassos-wifi).
  • Edit the file and include your network configuration instructions and update the ‘address1’ to align to an IP address that is in the range of your router
  • Some people have noted that saving the file using Notepad is fine, however others have noted that a program such as Notepad++ is required to save the file with encoding as ANSI and line ending to UNIX

I’ve used the following config:

[connection]
id=my-network
uuid=72111c67-4a5d-4d5c-925e-f8ee26efb3c3
type=802-11-wireless
[wifi]
mode=infrastructure
ssid=**SSID Name**
[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=**WIFI Password**
[ipv4]
method=manual
address1=192.168.1.190/24,192.168.1.1
dns=8.8.8.8;8.8.4.4;

Where **SSID Name** and **WIFI Password** are your own network details

Step 6 – Start up the Raspberry Pi

After inserting the MicroSD memory card and the USB memory stick, power on your Raspberry Pi and connect to an HDMI monitor if you wish to view the boot up sequence.

Step 7 – Connect to your Hassio installation

If all has gone well, you should now be able to connect to your Hassio installation through your browser. If your router supports mDNS then it will be accessible through http://hassio.local:8123 or if you have used my configuration in Step 5, then it will be accessible through the static IP
http://192.168.1.190:8123.

The Hassio installation may still be setting up and you will see the following “Preparing Hass.io” screen.

Wait a while and then refresh until it is accessible to then allow you to create an initial account with a password.

You should then be presented with the initial state screen and potentially some devices that have automatically been detected on your network.

Step 8 – Install Samba share add-on

You may already have some devices discovered, however you will need to get access to the configuration files to add additional devices and sensors. An easy way to do this is to add the Samba share add-on.

  • Go to the Hass.io link in the left-hand side navigation panel
  • Click Add-on store in the tool-bar
  • Click Samba share and click Install
  • Edit the config and click Save and include the following details:

Config

{
“workgroup”: “WORKGROUP”,
“username”: “*****“,
“password”: “*****“,
“interface”: “wlan0”,
“allow_hosts”: [
“10.0.0.0/8”,
“172.16.0.0/12”,
“192.168.1.0/16”
]
}

Make sure you update the “username” and “password” to your required details and “interface” should be eth0 if you are using ethernet or wlan0 if you are using wifi and allow hosts to be updated to align to the IP range you selected in Step 5.

  • Click Start to enable Samba share
  • If you are having any issues, view the log at the bottom of the screen for more details. The log will say “Waiting for connections” when it is ready to access.

Step 9 – Edit your configuration files

Your configuration files should now be accessible through Windows Explorer e.g. \\192.168.1.190\config (depending on what static IP you selected in the config in Step 5.

The key configuration files are:

  • automations.yaml – Used to specify your automations and the underlying scripts that are executed. These can also be added from within the Hassio interface
  • configuration.yaml – The key configuration file which is where you will add your components and key configurations
  • customize.yaml – Used to add a friendly/custom name to the entity_id for supported entities. This will be updated if you customize names from within the Hassio interface
  • groups.yaml – Used to allow the user to combine multiple entities into one
  • scripts.yaml – Used to specify a sequence of actions to be executed by Home Assistant when turned on
  • secrets.yaml – Used to store your user names, passwords, APIs and other sensitive information to avoid disclosing via the configuration.yaml file

Additional Hints:

  • I use Visual Studio Code to edit my files as it helps maintain the strict formatting for the configurations and is free and open source.
  • If you make changes to your configuration files, you can run a validation over the files to check if you have made any errors. Go to Configuration > General.
  • You can map your network drive for easy access to your configuration files.
]]>
48