Initial Installation - Resinchem/YouTube-to-HomeAssistant GitHub Wiki
Please follow these steps carefully for a successful install.
Currently, the install is a very manual process. It is expected to be simplified in later versions.
Requirements
- Properly installed Arduino IDE (or other software like PlatformIO that can load, compile and flash a .ino sketch file).
- A Wemos D1 Mini or other ESP8266-based development board, such as a NodeMCU. ESP32 boards should work, but you will need to update the libraries in the sketch file. Honestly, an ESP32 is overkill for this project.
- A USB-to-micro USB cable
You can download the Arduino IDE for free from the Arduino Web Site. Please see the information on that site if you need help with installation or basic use. This document assumes you have basic knowledge of using the IDE, including adding libraries, using the board manager, etc.
Installation steps
- Download the latest release from this repository, or download the project folder under the Arduino folder in this repository. Unzip and copy the entire \youtube_stats folder to your Arduino sketch location.
- If your install does not already have the ESP8266 board support installed, install via the Arduino --> Preferences --> Additional Board Manager. If you need assistance with this step, see the instructions on this page.
- You must now edit the Credentials.h and Settings.h file. This is specific for your particular enviroment and contains info like your wifi settings, MQTT broker log in and Tailwind device IP address. See the Credentials and Settings page for full details on each line of these files. You can edit these files in the IDE after opening the youtube_stats.ino file, or via any text editor.
- Assure you have installed all required libraries if they are not already installed in your environment. The bridge requires the following libraries:
- ESP8266WiFi
- ESP8266mDNS
- ESP8266WebServer.h
- WiFiUdp
- WiFiClientSecure.h
- ArduinoOTA
- PubSubClient
- YoutubeApi.h
- FS.h
- ArduinoJson.h
Install any missing libraries via the Library Manager
-
Connect your D1 Mini (or other board) to the computer via USB cable. Assure you have selected the proper board and COM port via the tools menu. Verify the sketch.
-
If no errors occur, you are ready to upload the sketch to your board. As soon as the upload completes and the board is reset, you may wish to display the serial monitor and assure successful connection to both your WiFi and MQTT broker. The serial monitor will also show you the IP address assigned to your bridge.
At this point, you can disconnect the bridge from the computer and move to any other location as long as the bridge can receive an adequate WiFi signal on the same SSID as your Home Assistant installation. You can power the bridge using a standard cell phone charger, or any other 5V DC power source. Any future uploads to the code can be performed over-the-air (See OTA Updates for more info).
The bridge should be fully operational. If Home Assistant Discovery is enabled in the Settings.h file, the new sensors should immediately be available in Home Assistant. Otherwise, you must manually create these sensors via YAML.