diff --git a/plejd/PlejdApi.js b/plejd/PlejdApi.js
index a338cba..9208b95 100644
--- a/plejd/PlejdApi.js
+++ b/plejd/PlejdApi.js
@@ -437,6 +437,7 @@ class PlejdApi {
}
const room = this.siteDetails.rooms.find((x) => x.roomId === device.roomId);
+ const roomTitle = room ? room.title : undefined;
/** @type {import('types/DeviceRegistry').OutputDevice} */
const outputDevice = {
@@ -448,7 +449,7 @@ class PlejdApi {
name: device.title,
output: deviceOutput,
roomId: device.roomId,
- roomName: room.title,
+ roomName: roomTitle,
state: undefined,
type: loadType,
typeName,
diff --git a/plejd/README.md b/plejd/README.md
index 0763eb8..1a7197e 100644
--- a/plejd/README.md
+++ b/plejd/README.md
@@ -4,29 +4,29 @@ Hass.io add-on for Plejd home automation devices. Gives you the ability to contr
It uses MQTT to communicate with Home Assistant and supports auto discovery of the devices in range. Changed made in the Plejd app are propagated to Home Assistant.
Plejd output devices typically appears as either lights or switches in Home Assistant depending on how they are configured.
-
-| Device | Plejd Configuration | Home Assistant Role | Comment |
-| CTR-01 | Relay, Light | Light | |
-| CTR-01 | Relay, Other | Switch | |
-| REL-01 | Relay, Light | Light | |
-| REL-01 | Relay, Other | Switch | |
-| REL-02 | Relay, Light | Light | |
-| REL-02 | Relay, Other | Switch | |
-| SPR-01 | Relay, Light | Light | Not tested, not released by Plejd |
-| SPR-01 | Relay, Other | Switch | Not tested, not released by Plejd |
-| DIM-01 | - | Light | |
-| DIM-02 | - | Light | |
-| LED-10 | - | Light | |
-| DAL-01 | - | - | Not supported, not released by Plejd |
-| WPH-01 | - | Device Automation | type:button_short_press, subtype:button_1, button_2,button_3,button_4 |
-| WRT-01 | - | Device Automation | type:button_short_press, subtype:button_1 |
-| GWY-01 | - | - | |
-| RTR-01 | - | - | |
-| Scene | - | Scene | |
-| Scene | - | Device Automation | type:scene, subtype:trigger |
-| Room | - | Area | Can be changed by Home Assistant |
-| Room | - | Light | If includeRoomsAsLights is set to true |
-
+
+| Device | Plejd Configuration | Home Assistant Role | Comment |
+| ------ | ------------------- | ------------------- | --------------------------------------------------------------------- |
+| CTR-01 | Relay, Light | Light | |
+| CTR-01 | Relay, Other | Switch | |
+| REL-01 | Relay, Light | Light | |
+| REL-01 | Relay, Other | Switch | |
+| REL-02 | Relay, Light | Light | |
+| REL-02 | Relay, Other | Switch | |
+| SPR-01 | Relay, Light | Light | Not tested, not supported |
+| SPR-01 | Relay, Other | Switch | Not tested, not supported |
+| DIM-01 | - | Light | |
+| DIM-02 | - | Light | |
+| LED-10 | - | Light | |
+| DAL-01 | - | - | Not supported, not released by Plejd |
+| WPH-01 | - | Device Automation | type:button_short_press, subtype:button_1, button_2,button_3,button_4 |
+| WRT-01 | - | Device Automation | type:button_short_press, subtype:button_1 |
+| GWY-01 | - | - | |
+| RTR-01 | - | - | |
+| Scene | - | Scene | |
+| Scene | - | Device Automation | type:scene, subtype:trigger |
+| Room | - | Area | Can be changed by Home Assistant |
+| Room | - | Light | If includeRoomsAsLights is set to true |
Thanks to [ha-plejd](https://github.com/klali/ha-plejd) for inspiration.
@@ -133,14 +133,17 @@ If you restore a backup from a 32bit system to a new 64bit system, use the Rebui
### Configuration
#### Simple MQTT Configurations
+
When you are using the official Mosquitto Broker from Home Assistant Add-on store, minimal configuration is required.
-
-| mqttBroker | mqtt://localhost |
-| mqttUsername | homeassistant |
-| mqttPassword | Mosquitto password, fetched via Configuration->Integrations->Mosquitto broker->Configure->RE-CONFIGURE->Password |
-
+
+| Parameter | Value |
+| ------------ | ---------------------------------------------------------------------------------------------------------------- |
+| mqttBroker | mqtt://localhost |
+| mqttUsername | homeassistant |
+| mqttPassword | Mosquitto password, fetched via Configuration->Integrations->Mosquitto broker->Configure->RE-CONFIGURE->Password |
#### Advanced MQTT Configurations
+
For more advanced instllations, you need to add the MQTT integration to Home Assistant either by going to Configuration -> Integrations and clicking the Add Integration button, or by adding the following to your `configuration.yaml` file:
```
diff --git a/plejd/types/DeviceRegistry.d.ts b/plejd/types/DeviceRegistry.d.ts
index 9e4d6ba..2d705cc 100644
--- a/plejd/types/DeviceRegistry.d.ts
+++ b/plejd/types/DeviceRegistry.d.ts
@@ -12,8 +12,8 @@ export interface OutputDevice {
hiddenFromSceneList?: boolean;
name: string;
output: number;
- roomId: string;
- roomName: string;
+ roomId: string | undefined;
+ roomName: string | undefined;
state: boolean | undefined;
type: string;
typeName: string;