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

DIM-02 only one entity per device detected #2

Closed
axlthorell opened this issue Dec 10, 2019 · 6 comments
Closed

DIM-02 only one entity per device detected #2

axlthorell opened this issue Dec 10, 2019 · 6 comments

Comments

@axlthorell
Copy link

Hi!
I have a few DIM-02 devices and I only get one entity per device.
Is there a way for me to activate debug logging and share what is happening?

I'm running Hass.IO on a RPI 4 with Hass.IO Mosquitto broker add-on.

This is my hassio-plejd log:

[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... 
-----------------------------------------------------------
 Hass.io Add-on: Plejd
 Adds support for the Swedish home automation devices from Plejd.
-----------------------------------------------------------
 Add-on version: 2
 You are running the latest version of this add-on.
parse error: Expected string key before ':' at line 1, column 4
[18:49:20] ERROR: Unknown HTTP error occured
 System:   (armv7 / raspberrypi4)
 Home Assistant version: 0.102.3
 Supervisor version: 192
-----------------------------------------------------------
 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.
[18:49:21] INFO: Starting the Plejd service...
plejd-mqtt: connected to mqtt.
connected to Plejd device with addr c4:1d:6a:2a:a8:c8
plejd: connected via bluetooth.
@icanos
Copy link
Owner

icanos commented Dec 10, 2019

Yes, you can by editing the plejd.js file, changing:
let debug = '';

to be:
let debug = 'console';

But I doubt that it will give you anything useful since I don't log that much around that, I basically just take the output from the Plejd API at the moment and returns a new device per device in the response. I need to rework the api.js a bit to include two separate devices when it detects a DIM-02.

Not sure yet how to select which channel to dim on the DIM-02 though, need to investigate a bit.

I will however add the ability to debug log the API output if changing that line in api.js.

@axlthorell
Copy link
Author

Ok, so it seems that the add-on chooses randomly what entity to add. After changing the plejd.js file and rebuilding the add-on one of the devices has now added the other light channel.
The log only shows this:

[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.
[19:17:56] INFO: Starting the Plejd service...
plejd-mqtt: connected to mqtt.
plejd ble state changed: poweredOn
plejd found P mesh with addr fe:5f:60:eb:7b:6d
plejd found P mesh with addr cf:4d:b6:94:65:5d
plejd found P mesh with addr d7:a4:4a:9e:c4:0f
plejd connecting to Plejd device
connected to Plejd device with addr fe:5f:60:eb:7b:6d
plejd discovering services and characteristics

Anything I can try to give you the information needed to make both channels work?

@axlthorell
Copy link
Author

Just realized that the names of the entities is random, however it seems as it's only channel 1 that is controlled.

@icanos
Copy link
Owner

icanos commented Dec 10, 2019

Could you maybe download the newest api.js, change the let debug = ''; to let debug = 'console'; line and rerun, copy the JSON output and send me the devices list, including the deviceAddress dictionary?

@axlthorell
Copy link
Author

It seems to be working now with your latest updates.
Thanks!

@icanos
Copy link
Owner

icanos commented Dec 10, 2019

Perfect! I’ll close this as fixed.

@icanos icanos closed this as completed Dec 10, 2019
SweVictor pushed a commit that referenced this issue May 8, 2021
Added support for WRT-10 as a Device Automation
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

2 participants