amc:ss2024:bird_feeder:ha_installation
Table of Contents
Home Assistant Installation
This guide was written using Home Assistant version 2024.5.x.
Raspberry Pi Setup
- Install Raspberry Pi imager https://www.raspberrypi.com/software/.
Fig. 1: Pick the operating system you are using
- Insert the Micro SD card to the SD card reader.
- Run the application.
- Choose Device (Raspberry Pi 4 in this case).
- Choose Operating System (“Other specific-purpose OS” → “Home assistants and home automation” → “Home Assistant” → “Home Assistant OS 12.x”).
- Click “Next” → “Yes”. (Ignore Microsoft Error messages).
- Remove the Micro SD card.
- Insert the Micro SD card into the Raspberry Pi’s Micro SD card slot.
- Connect Raspberry Pi to power via the USB-C (or Micro-USB depending on the model) port.
- Connect the Raspberry Pi to your network via the ethernet port on the Pi, make sure your computer is connected to the same network as well.
- Home Assistant Installation happens automatically if the Micro SD card is inserted and the Raspberry Pi is powered on. This might take a few minutes. If you want to monitor the installation, connect the Raspberry Pi through its mini-HDMI port to a display.
- Open a web explorer, navigate to http://homeassistant.local:8123/ and hit enter.
- Wait for the setup to finish and click on “Create My Smart Home”.
- Create a user using your preferred credentials.
HACS Installation
Home Assistant Community Store (HACS) is a third-party download manager for Home Assistant which contains various custom integrations. We need to install LocalTuya integration through HACS to locally control the pet feeder. This guide was written using HACS version 1.34.0.
- Go “Settings” → “Add-ons” → “Add-on store” → search “SSH” → Install “Terminal & SSH”.
- Navigate to “Terminal” on the sidebar, if it appears not to be running or if you are receiving error codes, refresh the instance.
- After the installation is completed, restart the home assistant (“Settings” → three dots on the top right → “Restart Home Assistant” → “Restart Home Assistant”).
- Home Assistant should automatically restart, if the browser crashes, refresh the browser page to access Home Assistant again.
- Navigate to “Settings” → “Devices & Services” → Click “Add Integration” on the bottom right corner.
- Create a github account if you don’t have one.
- Click on “Authorize” and exit github.
- If everything is set correctly you should have installed HACS on your Home Assistant. Do not pick an area on the pop-up and click on “finish”.
- Now HACS should show up on the sidebar of Home Assistant UI.
LocalTuya integration Installation
LocalTuya integration is what we need to control the pet feeder locally. This guide was written for LocalTuya version 5.2.1.
Adding Pet Feeder to Home Assistant
- Download the “Tuya Smart” app to your smartphone (version 5.13.0 was used for this guide).
- Press both buttons on the pet feeder at the same time.
- Run the “Tuya Smart” app, press “Add Device”, the Pet feeder should appear automatically, turn on your Bluetooth if it doesn’t. Insert the wireless credentials and press login. Make sure the pet feeder and the Home Assistant are in the same network.
- Navigate to Tuya IoT development platform and create an account.
Fig. 13
- Once the account is created, navigate to the developer platform on the top right corner of the page you were redirected to.
- A QR code will appear, open the “Tuya Smart” app on your phone, press on “Me” on the bottom right and then press on the scan icon on the top right, scan the QR code.
- Navigate back to the Home Assistant UI
- Once LocalTuya is installed, Cloud API configuration pop up will appear. Make sure API server region is EU. For the rest of the credentials, we need to navigate back to Tuya developer platform.
Fig. 23
- Insert the credentials back to Home Assistant. Use the previously mentioned “UID” from “Link Tuya App Account” tab and click on “Submit”.
- LocalTuya Integration is now linked with your Tuya Development Account. We still need to configure the pet feeder for local use.
- You will be redirected to LocalTuya integration page, if not, Navigate to “Settings” → “Devices & Integrations” → “LocalTuya”.
- Click on “Configure” on the same page → “Add a New Device” → “Pet Feeder” (which should be recognized automatically) and submit.
Fig. 25
Fig. 26
Fig. 27
Fig. 28
- On the API explorer, Navigate to “Query Devices in Project” on “Device Management”.
- Type “1” to “page_size” and click on “Submit Request”.
- The Host address can be obtained via your router’s web interface.
- After you submit, you will be met with the “Entity Type Selection” pop-up. The pet feeder has different functions such as dispensing food or turning the LED on the pet feeder on and off. Each of these functions has their own “Data Point ID” to communicate with the cloud. We need to intercept these Data Points and create separate entities to control the device via the Home Assistant.
Fig. 31
- On the device debugging page, under “Standard Instructions Set” are the functions of the device we can set new values for. Under “Standard Status Set” are the previously mentioned functions and the available sensors of the device.
- Turn the developer console on of your browser (CTRL+SHIFT+I or F12 for Google Chrome). Navigate to “Network” tab on the developer console.
- Notice the “Select DP ID” dropdown menu on the top left side of the page.
- While the Developer console is on, click on the DP ID dropdown menu and select “Manual Feed”, click on “Search”.
- The ID is our Data Point, which is 3.
- Navigate back to Home Assistant, last time, we were at the Entity Type Selection pop-up. “Settings” → “Devices & Services” → “LocalTuya” → “Configure” → “Add a new Device” → ”Submit” → “Submit”.
- Add more entities by repeating step 26 and beyond.
amc/ss2024/bird_feeder/ha_installation.txt · Last modified: 2024/06/03 14:26 by 24371_students.hsrw