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

DEBUG environment variable producing 'cbus:level undefined' log output #104

Open
arrikhan opened this issue Aug 1, 2020 · 9 comments
Open

Comments

@arrikhan
Copy link

arrikhan commented Aug 1, 2020

I have recently turned off client_debug: true in the homebridge config in preference to see only level state changes in the homebridge console shown in the README using the environment variable (eg: DEBUG=cbus:level homebridge)

image

However, all I am seeing is the following ...

2020-08-01T15:16:12.784Z cbus:level undefined
2020-08-01T15:16:37.643Z cbus:level undefined, by External Temperature Sensor (SENTEMPB)
2020-08-01T15:16:57.737Z cbus:level undefined, by Lounge Temperature Sensor (SENTEMPB)
2020-08-01T15:17:37.642Z cbus:level undefined, by External Temperature Sensor (SENTEMPB)
2020-08-01T15:17:57.735Z cbus:level undefined, by Lounge Temperature Sensor (SENTEMPB)
2020-08-01T15:18:30.169Z cbus:level undefined, by NEWUNIT (SYS_SHAC)
2020-08-01T15:18:30.173Z cbus:level undefined, by NEWUNIT (SYS_SHAC)
2020-08-01T15:18:37.647Z cbus:level undefined, by External Temperature Sensor (SENTEMPB)
2020-08-01T15:18:57.752Z cbus:level undefined, by Lounge Temperature Sensor (SENTEMPB)

The first line is me turning a light on, the rest is pretty obvious.

CGATE is logging more informative data;

20200802-013648 730 ///254/56/3 34ded720-a7e7-1038-a9f4-e8798d1af2f4 new level=255 sourceunit=18 ramptime=0
20200802-011830 702 ///254/223 - [clock] date 2020-08-02 6 sourceUnit=51
20200802-011830 702 ///254/223 - [clock] time 01:22:08 0 sourceUnit=51
20200802-013037 702 //BCOLEMAN/254/228/35/1 - [measurement] data 117 -1 0 sourceUnit=35
20200802-013057 702 ///254/228/34/1 - [measurement] data 207 -1 0 sourceUnit=34

Are others seeing "cbus:level undefined" in homebridge console or something like the example?

@JasonY00
Copy link
Contributor

JasonY00 commented Aug 21, 2020

A silly question, but are the C-Bus group addresses defined in homebridge. i.e. does your config.json file include entries for "Entry PIR", "Verandah Step Lights", "Verandah" & "Entry PendantLG". Also, do they have a type? i.e. dimmer, light, motion, etc?

If a cbus accessory is undefined in homebridge-cbus and sends an event message over the network, it will be logged as "output = ${chalk.red.bold.italic(tag)} (not-registered) set to level ${message.level}%;" from the code, which seems to describe your logs above.

Your "Study Pendant" & "Study Wall" are both defined as type "dimmer" and seem happy in the log.

How have you configured your two c-bus single channel temperature sensors above in the config.json file?

Cheers

Jason

@arrikhan
Copy link
Author

arrikhan commented Aug 23, 2020

The coloured image is the example, not my logs.

Config in homebridge looks a little like this for the switch show in example ..

{
"platform": "homebridge-cbus.CBus",
"name": "CBus",
"client_ip_address": "127.0.0.1",
"client_controlport": ,
"client_cbusname": "
***",
"client_network": 254,
"client_application": 56,
"platform_export": "/homebridge/my-platform.json",
"accessories": [
{
"type": "dimmer",
"id": 3,
"name": "Bedroom 3 Lights",
"enabled": true
},
{
"type": "temperature",
"id": 35,
"application": 228,
"channel": 1,
"name": "Temperature Outside",
"enabled": true
},

@JasonY00
Copy link
Contributor

Sorry about my confusion re the logs.

Not sure why you edited out the BCOLEMAN in your config file above and replaced it with ***. It should also appear in your cgate logs for each entry. Did you edit it out here as well?

Can you control your c-bus via your apple device and the homebridge UI now?

What happens if you turn debug logging back on again? Do the messages disappear?

Cheers

Jason

@arrikhan
Copy link
Author

Not sure why you edited out the BCOLEMAN in your config file above and replaced it with ***. It should also appear in your cgate logs for each entry. Did you edit it out here as well?

Yeah it stuffed up the copy/paste. Assume it and the port number are there.

Interestingly, no. I did not edit it out of the CGATE logs I pasted. Just realised the temp updates coming from the network don't show the project name, nor do the sync statements.

I can control/see units on Apple Home just fine.

As far as debug mode being turned on, I see the raw info coming from CGATE pretty much. The usual human undecipherable blart of data.

@JasonY00
Copy link
Contributor

I can only to suggest looking at the logs without debug mode turned on and without your level change filter and see what you get. I can't reproduce what you are seeing on my config.

Let us know how you go, I am a little stumped with this one...

Cheers

Jason

@JasonY00
Copy link
Contributor

JasonY00 commented Aug 25, 2020

Good news and bad news!

I have managed to reproduce what you are observing with the cbus:level debug. Because I am using the homebridge-UI, I had to make the appropriate change in the homebridge environment setting with a slight change and observed your problem of undefined cbus:level responses.

It all goes back to a bug in the coding to support temperature sensors in the index.js file. With this corrected and another if statement added to exclude measurement "levels" being sent through, the cbus:level DEBUG option works again as originally designed.

That's the good news...

The bad news. It will take a pull request to amend the code, trigger an update in the plugin and you will have to run an update on the plugin to give you what you want. If you know some node.js and really want this now, I can post up the code snippet for you to splice into the index.js file in your own system. Otherwise, you may have to wait for one of us to submit the pull request and have Anthony integrate it.

If I have time in the next few days, I will try to submit a pull request myself.

Cheers

Jason

@arrikhan
Copy link
Author

Jason, thank you so much for spending the time to recreate the problem with the code. Sorry I hadn't had notifications turned on so didn't see your message until now. I don't know node.js and am happy to wait for the brains to resolve this. Thanks again!

BenC

@manningoz
Copy link

Any progress on this as I am now getting the same issue? Many thanks

@manningoz
Copy link

Good news and bad news!

I have managed to reproduce what you are observing with the cbus:level debug. Because I am using the homebridge-UI, I had to make the appropriate change in the homebridge environment setting with a slight change and observed your problem of undefined cbus:level responses.

It all goes back to a bug in the coding to support temperature sensors in the index.js file. With this corrected and another if statement added to exclude measurement "levels" being sent through, the cbus:level DEBUG option works again as originally designed.

That's the good news...

The bad news. It will take a pull request to amend the code, trigger an update in the plugin and you will have to run an update on the plugin to give you what you want. If you know some node.js and really want this now, I can post up the code snippet for you to splice into the index.js file in your own system. Otherwise, you may have to wait for one of us to submit the pull request and have Anthony integrate it.

If I have time in the next few days, I will try to submit a pull request myself.

Cheers

Jason

Thanks Jason for working out the issue. Would you able to provide the code and instructions so I can fix this issue?

many thanks

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