JackJPowell / hass-unfoldedcircle

Home Assistant Integration for the Unfolded Circle Remote Two
MIT License
46 stars 3 forks source link
hass home-assistant unfolded-circle

Discord GitHub Release GitHub Downloads (all assets, all releases) Buy Me A Coffee

hass-unfoldedcircle

Unfolded Circle logo

Unfolded Circle for Home Assistant

Home Assistant integration for Unfolde Circle Remote Two.

Installation

There are two main ways to install this custom component within your Home Assistant instance:

  1. Using HACS (see https://hacs.xyz/ for installation instructions if you do not already have it installed):

    Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

    Or

    1. From within Home Assistant, click on the link to HACS
    2. Click on Integrations
    3. Click on the vertical ellipsis in the top right and select Custom repositories
    4. Enter the URL for this repository in the section that says Add custom repository URL and select Integration in the Category dropdown list
    5. Click the ADD button
    6. Close the Custom repositories window
    7. You should now be able to see the Unfolde Circle card on the HACS Integrations page. Click on INSTALL and proceed with the installation instructions.

    Restart your Home Assistant instance and then proceed to the Configuration section below.

  2. Manual Installation:

    1. Download or clone this repository
    2. Copy the contents of the folder custom_components/unfoldedcircle into the same file structure on your Home Assistant instance
    3. Restart your Home Assistant instance and then proceed to the Configuration section below.

While the manual installation above seems like less steps, it's important to note that you will not be able to see updates to this custom component unless you are subscribed to the watch list. You will then have to repeat each step in the process. By using HACS, you'll be able to see that an update is available and easily update the custom component. Trust me, HACS is the worth the small upfront investment to get it setup.

Configuration

There is a config flow for this integration. After installing the custom component and restarting:

  1. You should receive a notification that a new device was discovered.
  2. Navigate to Settings -> Devices & Services and click Configure on the newly discovered Remote Two Device.
  3. You will now begin the configuration flow process
  4. PIN can be found on the remote by enabling the web configurator
    1. Enable the web configurator by tapping in the upper right on your profile icon
    2. Make sure the toggle is 'ON' and a PIN will be displayed. If not, click the refresh button
    3. The PIN is only required during initial setup. You are free to change it immediately after
  5. Click Submit and select your device area.

Alternatively, if you do not have zeroconf discovery enabled, or your remote was not automatically discovered:

  1. Go to Settings -> Devices & Services -> Integrations
  2. Click + ADD INTEGRATION to setup a new integration
  3. Search for Unfolded Circle and select it
  4. You will now begin the configuration flow process
  5. PIN can be found on the remote by enabling the web configurator
    1. Enable the web configurator by tapping in the upper right on your profile icon
    2. Make sure the toggle is 'ON' and a PIN will be displayed. If not, click the refresh button
    3. The PIN is only required during initial setup. You are free to change it immediately after
  6. Host is the IP address or hostname of your remote
    1. (Optional) If you have a custom api url, you can pass in the full endpoint address

Usage

After the device is configured, the integration will expose 22 entities plus the number of activities you have defined on your remote. These are grouped by device. Four of these entities will be disabled by default. These are all diagnostic in nature and report the device stats and if polling of the remote is enabled. (This is only true if any of the three device stat entities are enabled.)

Dock Support

Dock support has now been added. If you have an existing remote configured, you will be prompted with a repair for each dock associated with your remote. You can also add docks via a configuration flow when adding a remote. Each Dock exposes 4 entities:

During a config flow, if you are unsure of your password, you can skip adding that dock for the moment by submitting the form without a password supplied. This will cause a repair to be created so you can set it at your leasure.

If you are unsure of the password you set, you can change it via the web configurator. Click on the Integrations and Dock menu and then select the dock you need to change the password for. Once changed, come back to the repair and let home assistant know what you set it to.

IR Remote Commands

How to interact with the Remote Service: The remote entity supports sending IR commands using the remote.send_command service.

service: remote.send_command
data:
  device: Receiver
  command: Power
target:
  entity_id: remote.remote_two_remote

[!TIP] > device: will match the case-sensitive name of your remote defined in the web configurator on the remote page. command will match the case-senstitive name of the pre-defined (custom or codeset) command defined for that remote. num_repeats is optional.

Additional Actions

There is now an action to update defined activities. This will be initially released with the option to enable/disable the 'prevent sleep' option within the selected activity.

service: unfoldedcircle.update_activity
target:
  entity_id: switch.remote_two_control_projector
data:
  prevent_sleep: true

IR Learning

BETA: This will be available in the wide release soon

You can now rapidly learn IR commands through your dock. To get started, go to your developer tools and then to the services tab and recreate the example below with your data. Start by providing a remote entity of the dock you want to learn through. Then add information about the remote to be created in the Unfolded Circle Software (name, icon, and description). Follow that with your IR dataset. Give it a name and a list of commands you would like to learn.

service: unfoldedcircle.learn_ir_command
target:
  entity_id: remote.remote_dock_remote
data:
  remote:
    name: Sony TV
    icon: uc:tv
    description: My Sony TV Remote
  ir_dataset:
    name: Sony A95L
    command:
      - direction_up
      - direction_right
      - direction_down
      - direction_left
      - menu
      - back
      - home

Finally, run this by clicking call service. This will start the dock listening for your commands. If you check your home assistant notifications, you'll get feedback on which step you are on. Continue by clicking the button on your remote that is shown in the notification while pointing at your dock.

Screenshot 2024-08-02 at 6 44 12 PM

If you run the above you will end up with the following in your Unfolded Circle Remote's web configurator that you can then assign to virtual or physical buttons:

Screenshot 2024-08-02 at 6 27 48 PM

Screenshot 2024-08-02 at 6 34 13 PM

Options

Additional options have been added to the intergration for further customization:

Zeroconf

Your Remote Two will now be automatically discovered on the network. Zeroconf handling has been significantly improved and should now properly detect when a device has already been configured.

Future Ideas

Notes

About This Project

I am not associated with Unfolded Circle, and provide this custom component purely for your own enjoyment and home automation needs. Those guys are awesome though!