Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devices not added as entities #248

Closed
jonathanalmstrom opened this issue Sep 17, 2022 · 8 comments
Closed

Devices not added as entities #248

jonathanalmstrom opened this issue Sep 17, 2022 · 8 comments

Comments

@jonathanalmstrom
Copy link

jonathanalmstrom commented Sep 17, 2022

I have installed the plejd addon and everything seems to work with that part. It finds the plejd devices and is vissible in the logger but the entities are not added to the system and I can't use any of the lights or room commands.

Any idea what could be wrong, or what i'm missing?

LOGS:

Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[09:26:10] INFO: Starting the Plejd service...
[09:26:11] INFO: Verified permissions on startup script
[09:26:11] INFO: Executing startup script
[09:26:11] INFO: Running add-on
Config: {
site: 'Ruriksvag2',
username: '---scrubbed---',
password: '---scrubbed---',
mqttBroker: 'mqtt://192.168.50.68',
mqttUsername: 'plejd',
mqttPassword: '---scrubbed---',
includeRoomsAsLights: true,
preferCachedApiResponse: false,
updatePlejdClock: false,
logLevel: 'info',
connectionTimeout: 2,
writeQueueWaitTime: 400
}
2022-09-17 09:26:16 INF [plejd-main] Log level set to info
Starting Plejd addon and reading configuration...
2022-09-17 09:26:16 INF [plejd-main] Log level set to info
2022-09-17 09:26:16 INF [plejd-main] Plejd add-on, version 0.9.1
2022-09-17 09:26:16 INF [device-comm] Starting Plejd communication handler.
2022-09-17 09:26:16 INF [plejd-ble] Starting Plejd BLE Handler, resetting all device states.
2022-09-17 09:26:16 INF [plejd-main] Main Plejd addon init()...
2022-09-17 09:26:16 INF [plejd-api] init()
2022-09-17 09:26:16 INF [plejd-api] Getting cached api response from disk
2022-09-17 09:26:16 INF [plejd-api] login()
2022-09-17 09:26:16 INF [plejd-api] logging into Ruriksvag2
2022-09-17 09:26:17 INF [plejd-api] got session token response
2022-09-17 09:26:17 INF [plejd-api] Get all Plejd sites for account...
2022-09-17 09:26:17 INF [plejd-api] Got site list response with 1: Ruriksvag2
2022-09-17 09:26:17 INF [plejd-api] Site found matching configuration name Ruriksvag2
2022-09-17 09:26:17 INF [plejd-api] Get site details for 6901f2ed-9466-4f42-b752-acbe605f7993...
2022-09-17 09:26:18 INF [plejd-api] got site details response
2022-09-17 09:26:18 INF [plejd-api] Site details for site id 6901f2ed-9466-4f42-b752-acbe605f7993 found
2022-09-17 09:26:18 INF [plejd-api] Saving cached copy
2022-09-17 09:26:18 INF [plejd-api] Getting devices from site details response...
2022-09-17 09:26:18 INF [plejd-api] No Plejd gateway found on site
2022-09-17 09:26:18 INF [plejd-mqtt] Initializing MQTT connection for Plejd addon
2022-09-17 09:26:19 INF [plejd-ble] init()
2022-09-17 09:26:21 INF [plejd-mqtt] Connected to MQTT.
2022-09-17 09:26:21 INF [plejd-mqtt] Sending discovery for 25 Plejd output devices
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered DIM-01 (light) named Takspot (11 : DAA703BDE80C_0).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered DIM-01 (light) named Takspot (13 : C9CFD653ACDB_0).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered LED-10 (light) named Duschhylla (15 : F8E485A54581_0).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered DIM-01 (light) named Takspot vid glasparti (17 : E0E9082A9E11_0).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered CTR-01 (light) named Bel uteplats (19 : C0D6E03139E9_0).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered CTR-01 (light) named Entre (20 : CB3FBFA00AF2_0).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered DIM-01 (light) named Entre (21 : C2EEAFC89855_0).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered DIM-01 (light) named Takspot (23 : F3EDCB061B90_0).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered DIM-01 (light) named Takspot korridor (24 : D3124D8D76FB_0).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered DIM-01 (light) named Takspot (26 : D34B169B7CA9_0).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered LED-10 (light) named Duschhylla (27 : D87A87534AE6_0).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered DIM-01 (light) named Vardagsrum (34 : EF6E7FF09047_0).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered DIM-01 (light) named Köksbord (35 : FC13DF04CE08_0).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered DIM-01 (light) named Takbelysning (37 : C9A32FC368F0_0).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered DIM-01 (light) named Takbelysning (39 : F8150ED58A66_0).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered Room (light) named Kök (10 : 6ef1adbc-857c-46a4-9b77-25904c655fc4).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered Room (light) named Övrigt (12 : 94f16046-eeb6-4a5a-8eb3-6d3a383bdc84).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered Room (light) named Badrum (14 : 1360ad51-8488-4c13-b14a-b10483e576cd).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered Room (light) named Entré / Korridor (16 : 3e87b137-e88e-45ca-a5ea-1e7253731327).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered Room (light) named Utomhusbelysning (18 : 016288e7-02f2-4255-abf1-da0d5d206c6a).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered Room (light) named Tvättstuga (22 : bfb7291d-2220-4c96-820f-1030741a629e).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered Room (light) named Familjedusch (25 : 94d2b56d-0a55-4168-ad54-4eb8843ccb58).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered Room (light) named Vardagsrum (33 : 05cfbedb-2b2b-4da9-b463-cdbfe812a245).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered Room (light) named Heddas rum (36 : eebaaccc-e9b6-4d4c-bd32-304848c60465).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered Room (light) named Gästrum (38 : 29df8f24-3621-4d8b-9269-a0731bff99c2).
2022-09-17 09:26:21 INF [plejd-mqtt] Sending discovery for 0 Plejd input devices
2022-09-17 09:26:21 INF [plejd-mqtt] Sending discovery for 8 Plejd scene devices
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered Scene (scene) named Utebelysning (1 : c64d8941-ec07-4ed4-9e4c-678efc4d4a47).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered Scene (scene) named Släck allt (2 : b12f850f-0774-4913-a451-ef07d53f52fa).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered Scene (scene) named Tänd vardagsrum (3 : c00ea34d-f034-4213-9e03-67c8c1951f2b).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered Scene (scene) named Tänd korridor + entre (4 : 6ec0c337-c023-4675-90d6-2e6bc6f1bcc2).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered Scene (scene) named Bef. Badrum (5 : c17069b8-ec1a-422c-8942-954bf694df80).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered Scene (scene) named Tänd Nytt badrum (6 : 181fb805-e863-4394-8155-7e643877a1a0).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered Scene (scene) named Släck nytt badrum (7 : 72c42939-42b9-4591-b3c1-00089f0a19bf).
2022-09-17 09:26:21 INF [plejd-mqtt] Discovered Scene (scene) named Släck bef. Badrum (8 : 716477b2-8706-4bd7-8609-b9724883ebf2).
2022-09-17 09:26:25 INF [plejd-ble] BLE init done, waiting for devices.
2022-09-17 09:26:25 INF [plejd-main] Main init done
2022-09-17 09:26:25 INF [plejd-main] main() finished
2022-09-17 09:26:27 INF [plejd-ble] Device discovery done, found 1 Plejd devices
2022-09-17 09:26:27 INF [plejd-ble] Connecting to /org/bluez/hci0/dev_DA_A7_03_BD_E8_0C
2022-09-17 09:26:31 INF [plejd-ble] onDeviceConnected()
2022-09-17 09:26:31 INF [plejd-ble] Connected device is a Plejd device with the right characteristics.
2022-09-17 09:26:31 INF [plejd-ble] authenticate()
2022-09-17 09:26:31 INF [plejd-ble] BLE Connected to undefined
2022-09-17 09:26:31 INF [plejd-ble] Plejd clock updates disabled in configuration.
2022-09-17 09:26:31 INF [plejd-ble] startPing()
2022-09-17 09:26:31 INF [device-comm] Bluetooth connected. Plejd BLE up and running!
2022-09-17 09:26:31 INF [device-comm] startWriteQueue()

@jonaslorander
Copy link

I've got the same issue.
I only have one device for testing purposes (new to Plejd but want them to work in Home Assistant before buying more).

I have a WRT-01 dimmer remote, which get added as a device, but it has no entities.

This is the payload if I click the MQTT INFO button on the device info page:

{
  "automation_type": "trigger",
  "payload": "0",
  "qos": 1,
  "topic": "homeassistant/device_automation/plejd/E70F4734A89D/state",
  "type": "button_short_press",
  "subtype": "button_1",
  "device": {
    "identifiers": "E70F4734A89D",
    "manufacturer": "Plejd",
    "model": "WRT-01",
    "name": "Kök Bänk Fjärrkontroll"
  },
  "platform": "mqtt"
}

And here is the log from starting the addon:

Home Assistant Core: 2022.9.4
 Home Assistant Supervisor: 2022.08.6
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[20:21:44] INFO: Starting the Plejd service...
[20:21:44] INFO: Verified permissions on startup script
[20:21:44] INFO: Executing startup script
[20:21:44] INFO: Running add-on
Config: {
  site: 'Hemma',
  username: '---scrubbed---',
  password: '---scrubbed---',
  mqttBroker: 'mqtt://core-mosquitto:1883',
  mqttUsername: 'iothome',
  mqttPassword: '---scrubbed---',
  includeRoomsAsLights: false,
  preferCachedApiResponse: false,
  updatePlejdClock: false,
  logLevel: 'verbose',
  connectionTimeout: 2,
  writeQueueWaitTime: 400
}
2022-09-18 20:21:44 VRB [plejd-main] Log level set to verbose
Starting Plejd addon and reading configuration...
2022-09-18 20:21:44 VRB [plejd-main] Log level set to verbose
2022-09-18 20:21:44 INF [plejd-main] Plejd add-on, version 0.9.1
2022-09-18 20:21:44 VRB [plejd-main] Addon info: {"name":"Plejd","version":"0.9.1","slug":"plejd","description":"Adds support for the Swedish home automation devices from Plejd.","url":"https://github.com/icanos/hassio-plejd/","arch":["armhf","armv7","aarch64","amd64","i386"],"startup":"application","boot":"auto","host_network":true,"host_dbus":true,"apparmor":false}
2022-09-18 20:21:44 INF [device-comm] Starting Plejd communication handler.
2022-09-18 20:21:44 INF [plejd-ble] Starting Plejd BLE Handler, resetting all device states.
2022-09-18 20:21:44 INF [plejd-main] Main Plejd addon init()...
2022-09-18 20:21:44 INF [plejd-api] init()
2022-09-18 20:21:44 INF [plejd-api] Getting cached api response from disk
2022-09-18 20:21:44 DBG [plejd-api] Prefer cache? false
2022-09-18 20:21:44 DBG [plejd-api] Cache exists? Yes, created 2022-09-18T16:56:53.659Z
2022-09-18 20:21:44 INF [plejd-api] login()
2022-09-18 20:21:44 INF [plejd-api] logging into Hemma
2022-09-18 20:21:44 DBG [plejd-api] sending POST to https://cloud.plejd.com/parse/login
2022-09-18 20:21:45 INF [plejd-api] got session token response
2022-09-18 20:21:45 INF [plejd-api] Get all Plejd sites for account...
2022-09-18 20:21:45 DBG [plejd-api] sending POST to https://cloud.plejd.com/parse/functions/getSiteList
2022-09-18 20:21:45 INF [plejd-api] Got site list response with 1: Hemma
2022-09-18 20:21:45 INF [plejd-api] Site found matching configuration name Hemma
2022-09-18 20:21:45 INF [plejd-api] Get site details for 74e0e221-386e-4501-8855-a89cdee81c51...
2022-09-18 20:21:45 DBG [plejd-api] sending POST to https://cloud.plejd.com/parse/functions/getSiteById
2022-09-18 20:21:46 INF [plejd-api] got site details response
2022-09-18 20:21:46 INF [plejd-api] Site details for site id 74e0e221-386e-4501-8855-a89cdee81c51 found
2022-09-18 20:21:46 INF [plejd-api] Saving cached copy
2022-09-18 20:21:46 INF [plejd-api] Getting devices from site details response...
2022-09-18 20:21:46 INF [plejd-api] No Plejd gateway found on site
2022-09-18 20:21:46 VRB [plejd-api] No outputSettings found for Kök Bänk Fjärrkontroll (E70F4734A89D), assuming output 0
2022-09-18 20:21:46 VRB [plejd-api] Found input device (E70F4734A89D), with input 0 having BLE address (11)
2022-09-18 20:21:46 VRB [device-registry] Added/updated input device: {"bleInputAddress":11,"deviceId":"E70F4734A89D","name":"Kök Bänk Fjärrkontroll","input":0,"roomId":"9f9df30d-0468-485e-ad24-4937a9465478","type":"device_automation","typeName":"WRT-01","version":"0.3.5","uniqueId":"E70F4734A89D_I_0"}. 1 output devices in total.
2022-09-18 20:21:46 INF [plejd-mqtt] Initializing MQTT connection for Plejd addon
2022-09-18 20:21:46 VRB [plejd-ble] cleanup() - Clearing ping interval and clock update timer
2022-09-18 20:21:46 VRB [plejd-ble] Removing listeners to write events, bus events and objectManager...
2022-09-18 20:21:46 INF [plejd-ble] init()
2022-09-18 20:21:46 VRB [plejd-ble] Managed paths[
  "/org/bluez",
  "/org/bluez/hci0"
]
2022-09-18 20:21:46 DBG [plejd-ble] Found BLE interface 'org.bluez.Adapter1' at /org/bluez/hci0
2022-09-18 20:21:46 VRB [plejd-ble] Powering on BLE adapter and waiting 5 seconds
2022-09-18 20:21:46 INF [plejd-mqtt] Connected to MQTT.
2022-09-18 20:21:46 VRB [plejd-main] connected to mqtt.
2022-09-18 20:21:46 INF [plejd-mqtt] Sending discovery for 0 Plejd output devices
2022-09-18 20:21:46 INF [plejd-mqtt] Sending discovery for 1 Plejd input devices
2022-09-18 20:21:46 DBG [plejd-mqtt] Sending discovery for Kök Bänk Fjärrkontroll
2022-09-18 20:21:46 INF [plejd-mqtt] Discovered WRT-01 (device_automation) named Kök Bänk Fjärrkontroll (11 : E70F4734A89D_I_0).
2022-09-18 20:21:46 VRB [plejd-mqtt] Publishing  homeassistant/device_automation/plejd/E70F4734A89D_I_0/config with payload {"automation_type":"trigger","payload":"0","~":"homeassistant/device_automation/plejd/E70F4734A89D","qos":1,"topic":"~/state","type":"button_short_press","subtype":"button_1","device":{"identifiers":"E70F4734A89D","manufacturer":"Plejd","model":"WRT-01","name":"Kök Bänk Fjärrkontroll"}}
2022-09-18 20:21:46 INF [plejd-mqtt] Sending discovery for 0 Plejd scene devices
2022-09-18 20:21:46 VRB [plejd-mqtt] Received mqtt message on homeassistant/device_automation/plejd/EB4B0E5B26C1_I_0/config
2022-09-18 20:21:46 VRB [plejd-mqtt] Getting device EB4B0E5B26C1_I_0 from registry
2022-09-18 20:21:46 VRB [plejd-mqtt] Sent mqtt config command for device_automation,  (EB4B0E5B26C1_I_0). 
2022-09-18 20:21:46 VRB [plejd-mqtt] Received mqtt message on homeassistant/device_automation/plejd/E70F4734A89D_I_0/config
2022-09-18 20:21:46 VRB [plejd-mqtt] Getting device E70F4734A89D_I_0 from registry
2022-09-18 20:21:46 VRB [plejd-mqtt] Sent mqtt config command for device_automation,  (E70F4734A89D_I_0). 
2022-09-18 20:21:46 VRB [plejd-mqtt] Received mqtt message on homeassistant/device_automation/plejd/E70F4734A89D_I_0/config
2022-09-18 20:21:46 VRB [plejd-mqtt] Getting device E70F4734A89D_I_0 from registry
2022-09-18 20:21:46 VRB [plejd-mqtt] Sent mqtt config command for device_automation,  (E70F4734A89D_I_0). 
2022-09-18 20:21:51 VRB [plejd-ble] Iterating 2 BLE managedObjects looking for org.bluez.Device1
2022-09-18 20:21:51 VRB [plejd-ble] All active BLE device connections cleaned up.
2022-09-18 20:21:51 VRB [plejd-ble] Got adapter undefined
2022-09-18 20:21:51 VRB [plejd-ble] Setting up interfacesAdded subscription and discovery filter
2022-09-18 20:21:51 VRB [plejd-ble] Starting BLE discovery... This can take up to 180 seconds.
2022-09-18 20:21:51 VRB [plejd-ble] Started BLE discovery
2022-09-18 20:21:51 INF [plejd-ble] BLE init done, waiting for devices.
2022-09-18 20:21:51 INF [plejd-main] Main init done
2022-09-18 20:21:51 INF [plejd-main] main() finished
2022-09-18 20:21:52 DBG [plejd-ble] Found Plejd service on /org/bluez/hci0/dev_E7_0F_47_34_A8_9D
2022-09-18 20:21:52 DBG [plejd-ble] initDiscoveredPlejdDevice(). Got /org/bluez/hci0/dev_E7_0F_47_34_A8_9D device
2022-09-18 20:21:52 DBG [plejd-ble] Inspecting /org/bluez/hci0/dev_E7_0F_47_34_A8_9D
2022-09-18 20:21:52 DBG [plejd-ble] Discovered /org/bluez/hci0/dev_E7_0F_47_34_A8_9D with rssi -88 dBm, name undefined
2022-09-18 20:21:53 INF [plejd-ble] Device discovery done, found 1 Plejd devices
2022-09-18 20:21:53 VRB [plejd-ble] Inspecting /org/bluez/hci0/dev_E7_0F_47_34_A8_9D
2022-09-18 20:21:53 INF [plejd-ble] Connecting to /org/bluez/hci0/dev_E7_0F_47_34_A8_9D
2022-09-18 20:21:56 WRN [plejd-ble] Unable to connect.  le-connection-abort-by-local
DBusError: le-connection-abort-by-local
    at _methodReturnHandlers.<computed> (/plejd/node_modules/dbus-next/lib/bus.js:343:27)
    at handleMessage (/plejd/node_modules/dbus-next/lib/bus.js:101:11)
    at EventEmitter.<anonymous> (/plejd/node_modules/dbus-next/lib/bus.js:151:9)
    at EventEmitter.emit (events.js:314:20)
    at /plejd/node_modules/dbus-next/lib/connection.js:116:14
    at Socket.<anonymous> (/plejd/node_modules/dbus-next/lib/message.js:63:9)
    at Socket.emit (events.js:314:20)
    at emitReadable_ (_stream_readable.js:557:12)
    at processTicksAndRejections (internal/process/task_queues.js:83:21)
2022-09-18 20:21:56 VRB [plejd-ble] Stopping discovery...
2022-09-18 20:21:56 VRB [plejd-ble] Stopped BLE discovery
2022-09-18 20:21:56 ERR [plejd-ble] Could not connect to any Plejd device. Starting reconnect loop...
2022-09-18 20:21:56 DBG [plejd-ble] Starting reconnect loop due to Could not connect to any Plejd device
2022-09-18 20:21:56 INF [plejd-ble] Starting reconnect loop...
2022-09-18 20:21:56 VRB [plejd-ble] Starting internal reconnect loop...
2022-09-18 20:21:56 VRB [plejd-ble] Reconnect: Clean up, emit reconnect event, wait 5s and the re-init...
2022-09-18 20:21:56 VRB [plejd-ble] cleanup() - Clearing ping interval and clock update timer
2022-09-18 20:21:56 VRB [plejd-ble] Removing listeners to write events, bus events and objectManager...
2022-09-18 20:21:56 VRB [plejd-ble] Reconnect attempt 1 in a row. Will power cycle every 10th time.
2022-09-18 20:21:56 INF [device-comm] Bluetooth reconnecting...
2022-09-18 20:21:56 VRB [device-comm] Stopping writeQueue loop until connection is established. Write queue length: 0
2022-09-18 20:22:01 INF [plejd-ble] Reconnecting BLE...
2022-09-18 20:22:01 INF [plejd-ble] init()
2022-09-18 20:22:01 VRB [plejd-ble] Managed paths[
  "/org/bluez",
  "/org/bluez/hci0"
]
2022-09-18 20:22:01 DBG [plejd-ble] Found BLE interface 'org.bluez.Adapter1' at /org/bluez/hci0
2022-09-18 20:22:01 VRB [plejd-ble] Powering on BLE adapter and waiting 5 seconds
2022-09-18 20:22:06 VRB [plejd-ble] Iterating 2 BLE managedObjects looking for org.bluez.Device1
2022-09-18 20:22:06 VRB [plejd-ble] All active BLE device connections cleaned up.
2022-09-18 20:22:06 VRB [plejd-ble] Got adapter undefined
2022-09-18 20:22:06 VRB [plejd-ble] Setting up interfacesAdded subscription and discovery filter
2022-09-18 20:22:06 VRB [plejd-ble] Starting BLE discovery... This can take up to 180 seconds.
2022-09-18 20:22:06 VRB [plejd-ble] Started BLE discovery
2022-09-18 20:22:06 INF [plejd-ble] BLE init done, waiting for devices.
2022-09-18 20:22:08 ERR [plejd-ble] Discovery timeout elapsed, no devices found. Starting reconnect loop...
2022-09-18 20:22:08 DBG [plejd-ble] Starting reconnect loop due to Discovery timeout elapsed
2022-09-18 20:22:08 INF [plejd-ble] Starting reconnect loop...
2022-09-18 20:22:08 VRB [plejd-ble] Starting internal reconnect loop...
2022-09-18 20:22:08 VRB [plejd-ble] Reconnect: Clean up, emit reconnect event, wait 5s and the re-init...
2022-09-18 20:22:08 VRB [plejd-ble] cleanup() - Clearing ping interval and clock update timer
2022-09-18 20:22:08 VRB [plejd-ble] Removing listeners to write events, bus events and objectManager...
2022-09-18 20:22:08 VRB [plejd-ble] Reconnect attempt 2 in a row. Will power cycle every 10th time.
2022-09-18 20:22:08 INF [device-comm] Bluetooth reconnecting...
2022-09-18 20:22:08 VRB [device-comm] Stopping writeQueue loop until connection is established. Write queue length: 0
2022-09-18 20:22:13 INF [plejd-ble] Reconnecting BLE...
2022-09-18 20:22:13 INF [plejd-ble] init()
2022-09-18 20:22:13 VRB [plejd-ble] Managed paths[
  "/org/bluez",
  "/org/bluez/hci0",
  "/org/bluez/hci0/dev_E7_0F_47_34_A8_9D"
]
2022-09-18 20:22:13 DBG [plejd-ble] Found BLE interface 'org.bluez.Adapter1' at /org/bluez/hci0
2022-09-18 20:22:13 VRB [plejd-ble] Powering on BLE adapter and waiting 5 seconds
2022-09-18 20:22:18 VRB [plejd-ble] Iterating 3 BLE managedObjects looking for org.bluez.Device1
2022-09-18 20:22:18 VRB [plejd-ble] Found /org/bluez/hci0/dev_E7_0F_47_34_A8_9D
2022-09-18 20:22:18 VRB [plejd-ble] Removing /org/bluez/hci0/dev_E7_0F_47_34_A8_9D from adapter.
2022-09-18 20:22:18 VRB [plejd-ble] All active BLE device connections cleaned up.
2022-09-18 20:22:18 VRB [plejd-ble] Got adapter undefined
2022-09-18 20:22:18 VRB [plejd-ble] Setting up interfacesAdded subscription and discovery filter
2022-09-18 20:22:18 VRB [plejd-ble] Starting BLE discovery... This can take up to 180 seconds.
2022-09-18 20:22:18 ERR [plejd-ble] Failed to start discovery. Operation already in progress
DBusError: Operation already in progress
    at _methodReturnHandlers.<computed> (/plejd/node_modules/dbus-next/lib/bus.js:343:27)
    at handleMessage (/plejd/node_modules/dbus-next/lib/bus.js:101:11)
    at EventEmitter.<anonymous> (/plejd/node_modules/dbus-next/lib/bus.js:151:9)
    at EventEmitter.emit (events.js:314:20)
    at /plejd/node_modules/dbus-next/lib/connection.js:116:14
    at Socket.<anonymous> (/plejd/node_modules/dbus-next/lib/message.js:63:9)
    at Socket.emit (events.js:314:20)
    at emitReadable_ (_stream_readable.js:557:12)
    at processTicksAndRejections (internal/process/task_queues.js:83:21)
2022-09-18 20:22:18 INF [plejd-ble] If you continue to get "operation already in progress" error, you can try power cycling the bluetooth adapter. Get root console access, run "bluetoothctl" => "power off" => "power on" => "exit" => restart addon.
2022-09-18 20:22:18 WRN [plejd-ble] Failed reconnecting. Failed to start discovery. Make sure no other add-on is currently scanning.
Error: Failed to start discovery. Make sure no other add-on is currently scanning.
    at PlejBLEHandler._startGetPlejdDevice (/plejd/PlejdBLEHandler.js:436:13)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
2022-09-18 20:22:18 VRB [plejd-ble] Reconnect: Clean up, emit reconnect event, wait 5s and the re-init...
2022-09-18 20:22:18 VRB [plejd-ble] cleanup() - Clearing ping interval and clock update timer
2022-09-18 20:22:18 VRB [plejd-ble] Removing listeners to write events, bus events and objectManager...
2022-09-18 20:22:18 VRB [plejd-ble] Reconnect attempt 3 in a row. Will power cycle every 10th time.
2022-09-18 20:22:18 INF [device-comm] Bluetooth reconnecting...
2022-09-18 20:22:18 VRB [device-comm] Stopping writeQueue loop until connection is established. Write queue length: 0

I get a whole lot of "Failed to start discovery", not sure if that has something to do with it. I have no other Bluetooth devices added to Home Assistant. I have tried power on/off of the Bluetooth dongle (ASUS USB-BT500).

@jonathanalmstrom
Copy link
Author

I got mine working. I had disabled MQTT in integrations since i didn't use it or anything else.
I have problems with the scenes I have created in plejd.
If I turn on a scenario it visually turns off in HA right away, the lights stay on though. If I want to turn the sceario off I have to turn it on and then off quickly before it goes to "off state" again.

I dont have any update or feedback from the scenarios I use that are programmed in the plejd app.

@jonaslorander
Copy link

I use MQTT for Zigbee2mqtt so that is turned on and working. I do get the device under the MQTT integration, but no entities...

@SweVictor
Copy link
Collaborator

@jonathanalmstrom : Nice that it works.

@jonaslorander : It seems like your system only has/finds an input device. Example logs from your post:

2022-09-18 20:21:46 INF [plejd-api] Getting devices from site details response...
2022-09-18 20:21:46 INF [plejd-api] No Plejd gateway found on site
2022-09-18 20:21:46 VRB [plejd-api] No outputSettings found for Kök Bänk Fjärrkontroll (E70F4734A89D), assuming output 0
2022-09-18 20:21:46 VRB [plejd-api] Found input device (E70F4734A89D), with input 0 having BLE address (11)
2022-09-18 20:21:46 VRB [device-registry] Added/updated input device: {"bleInputAddress":11,"deviceId":"E70F4734A89D","name":"Kök Bänk Fjärrkontroll","input":0,"roomId":"9f9df30d-0468-485e-ad24-4937a9465478","type":"device_automation","typeName":"WRT-01","version":"0.3.5","uniqueId":"E70F4734A89D_I_0"}. 1 output devices in total.

...

Sending discovery for 0 Plejd output devices.

So - I would start looking there.

@jonaslorander
Copy link

Yeah, all I have is one input device. I was looking for a new dimmer and the only one that I found pleasing enough was this. So there is no other Plejd stuff. I thought that would be enough...

@SweVictor
Copy link
Collaborator

Hmm, tricky. With only input devices you won't get any controllable outputs or obvious things sent to/from HA/matt.

That said, the bigger problem with Plejd is that normally no BLE commands are sent it there are no devices listening. Meaning: a DIM-01 with an output connected directly won't send any BLE command from the input change, if it controls a device wirelessly it will.

I don't have any wireless buttons/dimmers but I think there are some issues discussing the details. From memory my guess is that you might need a second Plejd device and set the dinner to control that to be able to pick up the dim level, but i might be wrong.

From memory I think you should be able to trigger a Plejd scenario from f.ex. double click and pick that up in HS.

Either way you should be able to see all BLE commands picked up by the Plejd addon in verbose or silly log mode. If you don't see anything the device is simply not sending anything.

@jonaslorander
Copy link

I see, thanks for the info. I'll see if I'm able to solve it some other way.
It looks like BThome will support dimmers and switches soon. I might be able to write my own firmware for the Plejd dimmer. It is a nRF51 chip after all. I would still like to use the dimmer hardware , Plejd or not :)

@SweVictor
Copy link
Collaborator

I'll close this for now since the original issue seems to be solved. Feel free to open a new issue for new things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants