Warning: Declaration of Db::query($query) should be compatible with mysqli::query($query, $resultmode = NULL) in /var/www/u1300519/data/www/acoptex.com/_lib/class.Db.php on line 29

Deprecated: Function get_magic_quotes_runtime() is deprecated in /var/www/u1300519/data/www/acoptex.com/_lib/CacheLite/Lite.php on line 757

Deprecated: Function get_magic_quotes_runtime() is deprecated in /var/www/u1300519/data/www/acoptex.com/_lib/CacheLite/Lite.php on line 757

Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in /var/www/u1300519/data/www/acoptex.com/_lib/class.Db.php on line 64

Warning: mysqli_fetch_array() expects parameter 2 to be int, string given in /var/www/u1300519/data/www/acoptex.com/_lib/class.Db.php on line 64

Deprecated: Function get_magic_quotes_runtime() is deprecated in /var/www/u1300519/data/www/acoptex.com/_lib/CacheLite/Lite.php on line 757

Deprecated: Function get_magic_quotes_runtime() is deprecated in /var/www/u1300519/data/www/acoptex.com/_lib/CacheLite/Lite.php on line 757

Warning: Cannot modify header information - headers already sent by (output started at /var/www/u1300519/data/www/acoptex.com/_lib/class.Db.php:0) in /var/www/u1300519/data/www/acoptex.com/_config/config.php on line 168

Warning: session_start(): Cannot start session when headers already sent in /var/www/u1300519/data/www/acoptex.com/_config/config.php on line 169

Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in /var/www/u1300519/data/www/acoptex.com/_lib/class.Db.php on line 92

Warning: mysqli_fetch_array() expects parameter 2 to be int, string given in /var/www/u1300519/data/www/acoptex.com/_lib/class.Db.php on line 92

Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in /var/www/u1300519/data/www/acoptex.com/_lib/class.Db.php on line 64

Warning: mysqli_fetch_array() expects parameter 2 to be int, string given in /var/www/u1300519/data/www/acoptex.com/_lib/class.Db.php on line 64
jobs.html_title
0

members

Easy Raspberry basics: Project 29b Raspberry PI 3 model B board - Control of LEDs with Home assistant

of Acoptex.com in Raspberry Pi 3

Raspberry basics: Project 29b

Project name: Raspberry PI 3 model B board - Control of LEDs with Home assistant

Tags: Raspberry, Raspberry PI 3 model B board, vers 1.1, v 1.1, Home assistant, Control, LEDs with Home assistant, LED, home assistant version 0.95.4, GPIO

Attachments: copy_configuration.yaml

In this project, you needed these parts (Dear visitors. You can support our project buy clicking on the links of parts and buying them or donate us to keep this website alive. Thank you):

1.Raspberry PI 3 model B 1 pc

2. Micro SD card and SD card adapter 1 pc

3. Micro USB power supply (2.1 A, max 2.5 A) 1 pc

4. USB keyboard 1 pc

5. USB mouse 1 pc

6. TV or PC monitor 1 pc

7. HDMI cable 1 pc

8. Jumper cables M-M, F-M

9. Resistor 2 pc (220 Ohm)

10. LED 2 pcs (green and red)

11. Breadboard 1 pc

General

We will learn how to use Home Assistant with Raspberry Pi to control LEDs.

Understanding the Home Assistant

You can read more about it here.

Understanding the Raspberry PI 3 model B

The Raspberry Pi 3 is the third-generation Raspberry Pi. It replaced the Raspberry Pi 2 Model B in February 2016.

Specification:

  • Quad Core 1.2GHz Broadcom BCM2837 64bit CPU
  • 1GB RAM
  • BCM43438 wireless LAN and Bluetooth Low Energy (BLE) on board
  • 40-pin extended GPIO
  • 4 USB 2 ports
  • 4 Pole stereo output and composite video port
  • Full size HDMI
  • CSI camera port for connecting a Raspberry Pi camera
  • DSI display port for connecting a Raspberry Pi touchscreen display
  • Micro SD port for loading your operating system and storing data
  • Upgraded switched Micro USB power source up to 2.5A

Signals and connections of the Raspberry PI 3 model B


Wiring

Step by Step instruction

We recommend using a high-performance SD card for increased stability as well as plugging your device into an external display to see the default application booting up.

We assume that you have Windows 10 installed on your PC and empty micro SD card 32 GB with SD card adapter.

1. Do wiring

2. Installing Hass.io

It was explained in Raspberry basics: Project 29a Raspberry PI 3 model B board - Home assistant for beginners

3. Adding integration Raspberry Pi GPIO switch

  1. To add integration to the configuration.yaml file go here and search for the Raspberry Pi GPIO switch.
  2. Just type Rapsberry Pi GPIO.
  3. Click on Raspberry Pi GPIO switch.
  4. Copy the entry given to your configuration.yaml file.
    # Example configuration.yaml entry
    switch:
      - platform: rpi_gpio
        ports:
          11: Lamp Bedroom
          12: Lamp Kitchen
    Copy this entry to your configuration.yaml file. In this entry we are adding two buttons that will control the Raspberry Pi GPIOs 11 and 12. We are calling them Green LED and Red LED. You can call them in different way and select other GPIOs too.
  5. If you have Configurator installed in Home Assistant skip installation notes. Go to Hass.io -> ADD-ON STORE  and select Configurator.
  6. Click on Install.
  7. Click on Start.
  8. Click on Open Web GUI.
  9. The configurator GUI opens. Go to Browse FileSystem.
  10. Go to config folder and find the configuration.yaml file.
  11. Save your configuration.yaml file.
  12. In the Home Assistant User Interface, go to Configuration->General and click the CHECK CONFIG button. This will check the syntax of the configuration.yaml file. When, it’s done, you get a Valid! message if everything is good with the syntax.
  13. Go to Server Management field (Configuration->General) and click on RESTART.
  14. Wait for the system to restart. 
  15. Go to Overview.
  16. Click on dots in top right corner. Select Configure UI.
  17. Click on plus in orange circle to ADD CARD.
  18. Click on ENTITIES.
  19. Type the title, make sure that Show header toggle? deselected, select Entity from dropdown menu - Green LED and Red LED. Click on SAVE.
  20. If you want to EDIT the card click on EDIT. If you want to go back to normal mode click on X.
  21. You should see two new buttons on the interface called Green LED and Red LED. Click on those buttons to turn the LEDs on and off.

Summary

We have learnt how to use Home Assistant with Raspberry Pi to control LEDs.

Libraries in use

  • None

Resources

  • See on the begining of this project


Other projects of Acoptex.com
Medium Basics: Project 083w Sipeed Maixduino board - Using PlatformIO IDE of Acoptex.com in Sipeed Maixduino 08-08-2019
Medium Basics: Project 083e Sipeed Maixduino board - Uploading MaixPy of Acoptex.com in Sipeed Maixduino 04-08-2019
Medium Basics: Project 083f Sipeed Maixduino board - Using MycroPython of Acoptex.com in Sipeed Maixduino 04-08-2019

jobs.published_at
jobs.viewed