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

Include rooms as lights does not work in 0.6.1 #169

Closed
f00dagi opened this issue Feb 27, 2021 · 13 comments
Closed

Include rooms as lights does not work in 0.6.1 #169

f00dagi opened this issue Feb 27, 2021 · 13 comments

Comments

@f00dagi
Copy link

f00dagi commented Feb 27, 2021

Hi!

I upgraded from a working 0.5.1 to 0.6.1 and ended up with my lights being unavailable and the log stating 'catastrophic error'.

I have rebuilt, restarted add-on and host multiple times. Then also, uninstalled, installed, rebuilt, restarted add-on and host multiple times. Issue remains.

What can I do, please advice? Thanks.

[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: Plejd
 Adds support for the Swedish home automation devices from Plejd.
-----------------------------------------------------------
 Add-on version: 0.6.1
 You are running the latest version of this add-on.
parse error: Expected string key before ':' at line 1, column 4
[12:37:11] ERROR: Unknown HTTP error occured
 System:   (amd64 / qemux86-64)
 Home Assistant Core: 2021.2.3
 Home Assistant Supervisor: 2021.02.11
-----------------------------------------------------------
 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.
[12:37:12] INFO: Starting the Plejd service...
[12:37:12] INFO: Verified permissions on startup script
[12:37:12] INFO: Executing startup script
[12:37:12] INFO: Running add-on
Config: {
  site: 'Trädgårdsmästarens väg 26',
  username: '---scrubbed---',
  password: '---scrubbed---',
  mqttBroker: 'mqtt://192.168.1.57',
  mqttUsername: 'hassio',
  mqttPassword: '---scrubbed---',
  includeRoomsAsLights: true,
  preferCachedApiResponse: false,
  updatePlejdClock: false,
  logLevel: 'info',
  connectionTimeout: 2,
  writeQueueWaitTime: 400
}
2021-02-27 12:37:12 INF [plejd-main] Log level set to info
Starting Plejd addon and reading configuration...
2021-02-27 12:37:12 INF [plejd-main] Log level set to info
2021-02-27 12:37:12 INF [plejd-main] Plejd add-on, version 0.6.1
2021-02-27 12:37:12 INF [plejd-ble] Starting Plejd BLE Handler, resetting all device states.
2021-02-27 12:37:12 INF [plejd-main] Main Plejd addon init()...
2021-02-27 12:37:12 INF [plejd-api] init()
2021-02-27 12:37:12 INF [plejd-api] Getting cached api response from disk
2021-02-27 12:37:12 INF [plejd-api] login()
2021-02-27 12:37:12 INF [plejd-api] logging into Trädgårdsmästarens väg 26
2021-02-27 12:37:13 INF [plejd-api] got session token response
2021-02-27 12:37:13 INF [plejd-api] Get all Plejd sites for account...
2021-02-27 12:37:13 INF [plejd-api] Got site list response with 1: Trädgårdsmästarens väg 26
2021-02-27 12:37:13 INF [plejd-api] Site found matching configuration name Trädgårdsmästarens väg 26
2021-02-27 12:37:13 INF [plejd-api] Get site details for 5753a9f5-a53e-41dd-8942-bb7ae840a827...
2021-02-27 12:37:14 INF [plejd-api] got site details response
2021-02-27 12:37:14 INF [plejd-api] Site details for site id 5753a9f5-a53e-41dd-8942-bb7ae840a827 found
2021-02-27 12:37:14 INF [plejd-api] Saving cached copy
2021-02-27 12:37:14 INF [plejd-api] Getting devices from site details response...
Catastrophic error. Resetting entire addon in 1 minute TypeError: Cannot read property 'dade45a7-3015-4ff8-ab4f-9812641d760b' of undefined
    at /plejd/PlejdApi.js:340:41
    at Array.forEach (<anonymous>)
    at PlejdApi._getRoomDevices (/plejd/PlejdApi.js:331:30)
    at PlejdApi.getDevices (/plejd/PlejdApi.js:198:10)
    at PlejdApi.init (/plejd/PlejdApi.js:64:10)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async PlejdAddon.init (/plejd/PlejdAddon.js:38:5)
    at async main (/plejd/main.js:18:5)
@SweVictor
Copy link
Collaborator

Hi, sorry to hear that. Please set the log level to verbose and restart the addon. I'll look into the code mentioned in the meantime.

@f00dagi
Copy link
Author

f00dagi commented Feb 27, 2021

Thanks for your quick response. Below please find the log with verbose enabled.

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: Plejd
 Adds support for the Swedish home automation devices from Plejd.
-----------------------------------------------------------
 Add-on version: 0.6.1
 You are running the latest version of this add-on.
parse error: Expected string key before ':' at line 1, column 4
[13:49:40] ERROR: Unknown HTTP error occured
 System:   (amd64 / qemux86-64)
 Home Assistant Core: 2021.2.3
 Home Assistant Supervisor: 2021.02.11
-----------------------------------------------------------
 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.
[13:49:40] INFO: Starting the Plejd service...
[13:49:40] INFO: Verified permissions on startup script
[13:49:40] INFO: Executing startup script
[13:49:40] INFO: Running add-on
Config: {
  site: 'Trädgårdsmästarens väg 26',
  username: '---scrubbed---',
  password: '---scrubbed---',
  mqttBroker: 'mqtt://192.168.1.57',
  mqttUsername: 'hassio',
  mqttPassword: '---scrubbed---',
  includeRoomsAsLights: true,
  preferCachedApiResponse: false,
  updatePlejdClock: false,
  logLevel: 'verbose',
  connectionTimeout: 2,
  writeQueueWaitTime: 400
}
2021-02-27 13:49:41 VRB [plejd-main] Log level set to verbose
Starting Plejd addon and reading configuration...
2021-02-27 13:49:41 VRB [plejd-main] Log level set to verbose
2021-02-27 13:49:41 INF [plejd-main] Plejd add-on, version 0.6.1
2021-02-27 13:49:41 VRB [plejd-main] Addon info: {"name":"Plejd","version":"0.6.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}
2021-02-27 13:49:41 INF [plejd-ble] Starting Plejd BLE Handler, resetting all device states.
2021-02-27 13:49:41 INF [plejd-main] Main Plejd addon init()...
2021-02-27 13:49:41 INF [plejd-api] init()
2021-02-27 13:49:41 INF [plejd-api] Getting cached api response from disk
2021-02-27 13:49:41 DBG [plejd-api] Prefer cache? false
2021-02-27 13:49:41 DBG [plejd-api] Cache exists? Yes, created 2021-02-27T12:46:42.714Z
2021-02-27 13:49:41 INF [plejd-api] login()
2021-02-27 13:49:41 INF [plejd-api] logging into Trädgårdsmästarens väg 26
2021-02-27 13:49:41 DBG [plejd-api] sending POST to https://cloud.plejd.com/parse/login
2021-02-27 13:49:41 INF [plejd-api] got session token response
2021-02-27 13:49:41 INF [plejd-api] Get all Plejd sites for account...
2021-02-27 13:49:41 DBG [plejd-api] sending POST to https://cloud.plejd.com/parse/functions/getSiteList
2021-02-27 13:49:41 INF [plejd-api] Got site list response with 1: Trädgårdsmästarens väg 26
2021-02-27 13:49:41 INF [plejd-api] Site found matching configuration name Trädgårdsmästarens väg 26
2021-02-27 13:49:41 INF [plejd-api] Get site details for 5753a9f5-a53e-41dd-8942-bb7ae840a827...
2021-02-27 13:49:41 DBG [plejd-api] sending POST to https://cloud.plejd.com/parse/functions/getSiteById
2021-02-27 13:49:42 INF [plejd-api] got site details response
2021-02-27 13:49:42 INF [plejd-api] Site details for site id 5753a9f5-a53e-41dd-8942-bb7ae840a827 found
2021-02-27 13:49:42 INF [plejd-api] Saving cached copy
2021-02-27 13:49:42 INF [plejd-api] Getting devices from site details response...
2021-02-27 13:49:42 DBG [plejd-api] includeRoomsAsLights is set to true, adding rooms too.
Catastrophic error. Resetting entire addon in 1 minute TypeError: Cannot read property 'dade45a7-3015-4ff8-ab4f-9812641d760b' of undefined
    at /plejd/PlejdApi.js:340:41
    at Array.forEach (<anonymous>)
    at PlejdApi._getRoomDevices (/plejd/PlejdApi.js:331:30)
    at PlejdApi.getDevices (/plejd/PlejdApi.js:198:10)
    at PlejdApi.init (/plejd/PlejdApi.js:64:10)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async PlejdAddon.init (/plejd/PlejdAddon.js:38:5)
    at async main (/plejd/main.js:18:5)

@SweVictor
Copy link
Collaborator

The code relates to including room switches. You should be able to get it working by setting includeRooms.. to false

@SweVictor
Copy link
Collaborator

Do you possibly have rooms without devices in them?

@f00dagi
Copy link
Author

f00dagi commented Feb 27, 2021

Thanks ALOT! That solved the issue.

Are you referring to rooms in the Plejd app or in Home Assistant?

From my perspective you can close the issue if you want. Possibly you want to troubleshoot, I will provide input if I can.

@SweVictor
Copy link
Collaborator

Plejd rooms. Looking at the code it looks like Plejd rooms without devices in them could cause this issue.

@SweVictor SweVictor changed the title upgrade from 0.5.1 to 0.6.1: Catastrophic error Include rooms as lights does not work in 0.6.1 Feb 27, 2021
@f00dagi
Copy link
Author

f00dagi commented Feb 27, 2021

A1A2414E-C2D4-4C38-8B89-8A771E33ED8C

@SweVictor
Copy link
Collaborator

Thanks for that. I was barking up the wrong tree 😃
The error is due to internal refactors, I'll see if I can create a patch for this. I don't personally use room devices currently so had to fix around a bit to be able to reproduce.

@f00dagi
Copy link
Author

f00dagi commented Feb 27, 2021

Thanks for awesome support!

@SweVictor
Copy link
Collaborator

Patch out in the form of 0.6.2. Please check if room devices works better after upgrading if possible.

@f00dagi
Copy link
Author

f00dagi commented Feb 27, 2021

It now works also with includeRoomsAsLights enabled. Problem solved. I close the issue. Thanks!

@AndersHub
Copy link

Hi, I have seen your ambition regarding Greenely in another forum. Have you any success with your integration to show results from Greenely?

@SweVictor
Copy link
Collaborator

@AndersHub i think you’re in the wrong forum

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