# ¶ Enroll the CoFyBox in CoFyCloud

## ¶ Who is this guide for?

This guide is aimed at people involved in installing cofy-box in homes. You may be a community manager or installer/technician.

## ¶ Intro

Every time a CoFyBox starts up, it will try to connect to the CoFyCloud's Device Provisioning Service (DPS). If a device is enrolled and it provides certain information, the DPS will respond with a collection of endpoints (URL's) and credentials, that the CoFyBox can use to send and request data to/from the CoFyCloud.

Before performing the physical installation, you can already enroll the CoFyBox in the CoFyCloud ecosystem. You can also do it after installation remotely but this is not recommended.

## ¶ What you'll need

- A CoFyCloud account which has been granted community manager permissions. To create an account or access CoFyCloud goto: https://app.cofybox.io/
- The CoFyBox's Universal Unique Identifier (UUID). This is a code consisting of 32 hexadecimal characters, and can be found on the back of the CoFyBox in the form of a QR-code or supplied with the cofy-box in a spreadsheet.

## ¶ What to do

- Sign in on the Community Portal (app.cofybox.io (sandbox: app.sandbox.cofybox.io)).
- Go to Enrollments
- Click New Enrollment
- If you want to enroll a single CoFyBox:
  - Click Add individual enrollment
  - As Registration Token, enter the CoFyBox's UUID found from scanning the QR code or otherwise.
  - You may want to add an optional, human readable name as reference to the CoFyBox. The cofy-box comes with a 'friendly name' like 'happy-fox' which can be used.
  - Click Save
- If you want to enroll multiple CoFyBoxes:
  - Create a CSV or Excel file with two columns
  - The header or the first column should be named RegistrationToken, the header of the second column should be Reference
  - Under RegistrationToken, enter the CoFyBoxes UUID's
  - Under Reference, you may add an optional, human readable name as reference to the CoFyBox
  - Save your file
  - Back in the Community Portal, click Select a File
  - Select the file you previously created
  - Click Import
- You should now see the recently enrolled CoFyBoxes in the Enrollment list. Their status should be pending, and no DeviceID should be assigned yet.

# ¶ Install the CoFyBox

The CoFyBox needs to be installed in a location where it can make a wireless connection with any device that it needs to connect too by wifi as well as a wired connection to the router. A Powerline network adapter (ethernet over power line) can be used to create a wired connection to a suitable location. Note that the WiFi signal from some devices are stronger than from others - for example the range of a Shelly seems to be significantly better than that from an EmonEVSE.

- Plug an ethernet cable from the CoFyBox to the householder’s internet router.

- Plug the power supply into the CoFyBox and into a wall socket.

- Note the WiFi password on the back of the CoFyBox

- Ensure you can connect to the CoFyBox’s WiFi hotspot and can reach the internet whilst connected.

# ¶ Commissioning the CoFyBox

In order for the CoFyBox to connect succesffully to the CoFyCloud service (after it has been enrolled) certain information needs to be provided by the user or installer. We call this 'commissioning' of the cofy-box. At the current time the specific information that needs to be provided for the connection to work is:

- Time zone

A user interface has been provided for this purpose which is accessible either through the Home Assistant side bar (see below) or by navigating to port 8000 (http://<cofybox IP address>:8000) on the device. Once you have entered the information in the UI you need to click 'Submit'. The box should then be able to connect to the cloud and you should see its status as 'Available' or 'Online' in the community manager dashboard.