1.7.10 • Published 4 months ago

bosch-smart-home-bridge v1.7.10

Weekly downloads
102
License
MIT
Repository
github
Last release
4 months ago

Logo

NPM version Downloads Main Known Vulnerabilities

NPM

bosch-smart-home-bridge

Allows communication to Bosch Smart Home Controller (BSHC)

Bosch Smart Home Controller

Bosch Smart Home Controller Local REST API.

Getting started

You need to create a new instance of BoschSmartHomeBridge (BSHB). Therefore, you need to use BoschSmartHomeBridgeBuilder. The builder will force you to set every mandatory properties:

  • host name / ip address of BSHC
  • client certificate (base64 encoded)
  • client private key (base64 encoded, 2048bit)
  • a logger which implements the interface which is defined in this library (optional)
const certificate = BshbUtils.generateClientCertificate();
const bshb = BoschSmartHomeBridgeBuilder.builder()
  .withHost("192.168.0.10")
  .withClientCert(certificate.cert)
  .withClientPrivateKey(certificate.private)
  .build();

Pairing

Then you need to start the pairing process. Therefore, you need:

  • name of the client
  • a unique identifier for the new client (uuid is ok but can be any string)
  • system password of BSHC
const identifier = BshbUtils.generateIdentifier();
bshb.pairIfNeeded("name", identifier, "systemPassword");

Communication

After that you can use BSHB to communicate with BSHC. Therefore, just use the provided client which provides some helpful methods:

bshb.getBshcClient();

Long Polling

If you are interested in updates from bshc you can use long polling. Therefore, you need to do the following:

bshb
  .getBshcClient()
  .subscribe()
  .subscribe((response) => {
    bshb
      .getBshcClient()
      .longPolling(response.parsedResponse.result)
      .subscribe((info) => {
        // do something with the information
        // also you need to call longPolling again after connection close
      });
  });

Do not forget to unsubscribe. E.g. in error case or on application end.

bshb
  .getBshcClient()
  .unsubscribe(response.parsedResponse.result)
  .subscribe(() => {});

Examples

You can find an example in test directory. Npm arguments must be set manually.

1.7.10

4 months ago

1.7.9

5 months ago

1.7.8

5 months ago

1.7.7

5 months ago

1.7.6

5 months ago

1.7.5

5 months ago

1.7.4

5 months ago

1.7.3

6 months ago

1.7.2

6 months ago

1.7.1

6 months ago

1.7.0

6 months ago

1.6.0

11 months ago

1.5.2

11 months ago

1.5.1

11 months ago

1.5.0

11 months ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.2-es2017

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.1

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.0

4 years ago

0.2.15

4 years ago

0.2.14

5 years ago

0.2.13

5 years ago

0.2.12

5 years ago

0.2.11

5 years ago

0.2.10

5 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.1.0

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago