Skip to content

Commit

Permalink
docs: prepare for public release (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
zehnm authored Feb 26, 2023
1 parent a3b59ac commit befc20b
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 69 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Core-API Changelog
# Core-Simulator Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
Expand All @@ -10,6 +10,15 @@ _Changes in the next release_

---

## v0.21.1-alpha - 2023-02-26
### Added
- Enable activity & macro execution in simulator.
- Send `entity_change` events for all steps in an activity & macro sequence.

### Changed
- Public release of the simulator.
- Update web-configurator.

## v0.20.0-alpha - 2023-02-22
### Added
- Temporary, non-persistent UI access token to prevent lock-out when deleting user accounts or API tokens.
Expand Down
33 changes: 25 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Remote Two Core Simulator

The remote-core simulator is a dedicated binary containing a subset of features of the remote-core.
The remote-core simulator is a developer tool to simplify developing integration drivers for the [Remote Two](https://www.unfoldedcircle.com/).

It simulates the functionality of the core services running on the embedded device and provides the same Core-APIs
as a real device. The majority of the API functionality is identical (using the same code base) with most of the
hardware functions simulated.

The remote-core simulator is available as a Docker image and soon as a ready-made Linux VM.

**Please note that this is a preview version and work-in-progress!**

We will release more documentation and code examples on how to develop for the Remote Two.
The web-configurator, Home Assistant integration and remote-ui projects will be released as open-source projects once we ship the devices.

## Core-API

Expand All @@ -10,24 +21,23 @@ YAML format:
- [REST OpenAPI definition](core-api/rest/openapi.yaml)
- [WebSocket AsyncAPI definition](core-api/websocket/asyncapi.yaml)

The rendered html files are available from the built-in core-simulator webserver: <http://localhost:8080/docs>
The rendered html files are available from the built-in core-simulator webserver: <http://localhost:8080/doc>

Please see our [Core APIs](https://github.com/unfoldedcircle/core-api) repository for more information.
The Core-API definitions in this core-simulator repository will soon be migrated to the dedicated API repository.

⚠️ The Core-API definitions in this core-simulator repository will soon be migrated to the dedicated API repository.

## Docker Compose Demo Setup

See [docker](docker) directory for an all-in-one simulation setup using Docker Compose.

## Linux VM for Core-Simulator

See [linux-vm](linux-vm) for a prepared Linux virtual machine containing the full Remote-Core simulator setup including
See [linux-vm](linux-vm) for a prepared Linux virtual machine containing the full remote-core simulator setup including
a preview of the Qt based remote-ui application.

## Usage

Extract the archive, change into the extracted directory and run the `core-simulator` binary.

- Web page: <http://localhost:8080>
- Web-Configurator preview: <http://localhost:8080/configurator>
- Default REST API endpoints:
Expand All @@ -39,7 +49,7 @@ Extract the archive, change into the extracted directory and run the `core-simul

### User Accounts

The Remote-Core simulator has the following predefined administrator accounts:
The remote-core simulator has the following predefined administrator accounts:

#### REST API

Expand All @@ -50,10 +60,12 @@ endpoint for a session login with cookie.

##### User accounts

Web configurator account (with admin rights):
Web-configurator account (with admin rights):
- user: `web-configurator`
- password: `1234`

The web-configurator account can be enabled & disabled in the remote-ui application. It also allows to create a new pin.

Administrator account:
- user: `admin`
- password: `remote2`
Expand All @@ -73,6 +85,8 @@ The WebSocket API uses token based authentication sent in the header:

Alternatively, the session cookie can be used from the REST login.

Simple html test console: <http://localhost:8080/ws.html>

## License

The API specifications and documentations are published under the [CC-BY-AS-4.0](https://creativecommons.org/licenses/by-sa/4.0/)
Expand All @@ -82,4 +96,7 @@ Please see [LICENSE file in core-api repository](https://github.com/unfoldedcirc
All code examples in this repository are licensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).

Remote-core simulator and all graphics copyright © Unfolded Circle ApS 2022-2023.

The remote-core simulator is provided for development use only. It is prohibited to use the remote-core simulator
application as part of other products, services and like.

5 changes: 5 additions & 0 deletions core-api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Remote Two Core-APIs

Please see our [Core APIs](https://github.com/unfoldedcircle/core-api) repository for more information.

⚠️ The Core-API definitions in this core-simulator repository will soon be migrated to the dedicated API repository.
20 changes: 9 additions & 11 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
# Docker Compose Setup with Home-Assistant Demo Server

The pre-defined [docker-compose.yml](docker-compose.yml) is an all-in-one simulation setup including:
- RemoteTwo Core-Simulator: [unfoldedcircle/core-simulator](https://hub.docker.com/r/unfoldedcircle/core-simulator)
- Remote-core simulator: [unfoldedcircle/core-simulator](https://hub.docker.com/r/unfoldedcircle/core-simulator)
- RemoteTwo Home-Assistant integration: [unfoldedcircle/integration-hass](https://hub.docker.com/r/unfoldedcircle/integration-hass)
- [Home-Assistant server](https://www.home-assistant.io/): [ghcr.io/home-assistant/home-assistant:stable](https://github.com/home-assistant/core/pkgs/container/home-assistant)
- The Home-Assistant data is persisted on the host in the [`hass_config`](hass_config) directory and bind-mounted into the container.
- The core-simulator data is persisted in an anonymous Docker volume.
- The remote-core simulator data is persisted in a Docker volume.

Core-Simulator:
## User Accounts

- Web page: <http://localhost:8080>
- Web configurator user account (with admin rights):
- user: `web-configurator`
- password: `1234`
- Administrator user account:
- user: `admin`
- password: `remote2`
See [README in parent directory](../README.md) for the remote-core simulator API accounts.

Home-Assistant:

Expand Down Expand Up @@ -57,7 +51,11 @@ See [Docker Compose documentation](https://docs.docker.com/compose/) for more in

## Configuration

The Remote-Core simulator runs with pre-configured defaults and should not be changed.
The remote-core simulator runs with pre-configured defaults. Changing the configuration can have undesired effects and
we cannot support custom configurations.

⚠️ The remote-core simulator uses a very simple built-in webserver to serve the static pages and the web-configurator.
The real remote device runs a dedicated webserver as reverse-proxy for the APIs and performs SSL termination.

To change the web server ports, the following environment variables can be set:
```
Expand Down
38 changes: 4 additions & 34 deletions linux-vm/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Linux VM for Core-Simulator

Download link: <https://drive.google.com/drive/folders/1xIz2iwHZTM9RsKTXzhmAtTFlcb1iT7b2>
Download link: _updated version will be provided until the end of February 2023_
Note: downloading a full directory might not work, download the `.ova` & readme files one by one.
The `remote-ui` directory contains the UI binary only for manual updates of the ui app in `~/Remote-Two` without
downloading a full VM image.
Expand All @@ -23,7 +23,7 @@ Installed applications & tools:
- VirtualBox guest additions

Installed Remote Two applications:
- Remote-Core simulator
- Remote-core simulator with web-configurator
- Home-Assistant integration
- Remote-UI frontend

Expand All @@ -36,7 +36,7 @@ Web page: <http://localhost:8080> / <https://localhost:8443>
## Docker Compose Setup with Home-Assistant Demo Server

The pre-defined Docker Compose setup in `~/Remote-Two/docker-compose.yml` is an all-in-one simulation including:
- Remote-Core simulator
- Remote-core simulator
- Home-Assistant integration: integration-homeassistant
- [Home-Assistant server](https://www.home-assistant.io/)
- The Home-Assistant data is persisted on the host in the `~/Remote-Two/hass_config` directory and bind-mounted into the container.
Expand All @@ -50,37 +50,7 @@ The pre-defined Docker Compose setup in `~/Remote-Two/docker-compose.yml` is an
- user: `unfolded`
- password: `remotetwo`

The Remote-Core simulator has the following predefined administrator accounts:

#### REST API

Endpoint: <http://localhost:8080/api>

Web configurator account (with admin rights):
- user: `web-configurator`
- password: `1234`

Administrator account:
- user: `admin`
- password: `remote2`

Either use Basic Authentication for each request (when doing single tests or using OpenAPI), or use the `/api/pub/login`
endpoint for a session login with cookie.

ℹ️ Note: user account management will be added in a future release.

#### WebSocket API

Endpoint: <ws://localhost:8080/ws>

The WebSocket API uses token based authentication sent in the header:

- header: `API-KEY`
- admin key: `BtlCEne.OWU2YzBhZjMyNmI2NDQ5YWI3N2NmMGExYWU5ZTNlNDEuZmIzOTNkM2FhOGY2NDA1N2FjNzQzNDdlOWE1YTU0OTc`

Alternatively, the session cookie can be used from the REST login.

Simple html test console: <http://localhost:8080/ws.html>
See [README in parent directory](../README.md) for the remote-core simulator API accounts.

### Docker Compose Commands

Expand Down
17 changes: 2 additions & 15 deletions linux-vm/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,7 @@ sudo apt-get install docker-compose-plugin

Depending on distribution, add `/usr/libexec/docker/cli-plugins` to your path.

## Integrations

### Home Assistant

#### Container

#### Host

The remote-core simulator is a statically compiled binary with very little external dependencies:
```bash
sudo apt install libavahi-compat-libdnssd1
```

### Home Assistant Server
## Home Assistant Server

If you don't already have a [Home Assistant](https://www.home-assistant.io/) installation you can easily install one in
a container to get started with the UC home-assistant integration for Remote Two.
Expand All @@ -129,7 +116,7 @@ docker run -d \
--name homeassistant \
--privileged \
--restart=unless-stopped \
-e TZ=MY_TIME_ZONE \
-e TZ=$MY_TIME_ZONE \
-v ~/hass_config:/config \
--network=host \
ghcr.io/home-assistant/home-assistant:stable
Expand Down

0 comments on commit befc20b

Please sign in to comment.