ebaauw / homebridge-p1

Homebridge plugin for DSMR end-consumer (P1) interface
Apache License 2.0
54 stars 11 forks source link

Manage log level without Eve (just Home.app and vanilla) Homebridge #38

Closed hylkefaber closed 3 years ago

hylkefaber commented 3 years ago

Hi Erik, would it be possible to change the log level of homebridge-p1 without requiring the use of Eve? I'm only using HB, Home.app and Homebridge-Config-UI-X, and I cannot seem to change the level of logging. While it is very helpful to see how frequently my power usage changes, the number of log messages is clogging up the rest of my /var/lib/homebridge/homebridge.log file. As I understand from a closed issue, this is possible to adjust via Eve, but as mentioned before I do not run that app. Thanks so much for this plugin!

ebaauw commented 3 years ago

No, Apple’s Home app doesn’t support all of HomeKit, so you need another HomeKit app for the full functionality.

hylkefaber commented 3 years ago

Ah I understand, thanks. Second part of the question: is there any way to reduce the number of log messages in the homebridge.log file?

ebaauw commented 3 years ago

Homebridge just writes messages to standard output and standard error; it’s up to the service starting Homebridge to direct these to a file.

To reduce the number of messages written by Homebridge P1, (temporarily) install another HomeKit app and change the Log Level. It sticks after changing it, and is persisted in cachedAccessories. If you’re feeling particularly lucky, you might try and patch that file (while Homebridge isn’t running), but it’s really easier to install another HomeKit app.

Also, Homebridge P1 doesn’t expose anything that Home supports, so if you only use Home, why do you use Homebridge P1?

hylkefaber commented 3 years ago

I recently moved, and I was curious to see how much power we use on a daily basis. Also, I'm hoping improvements will be made to Homekit to have it included more accessories, hopefully soon, so this plugin can be of use.

hylkefaber commented 3 years ago

I can confirm this works! 1) stop the service via hb-service stop 2) edit the file at /var/lib/homebridge/accessories/cachedAccessories 3) find the variable logLevel (multiple instances) and set the variable to 0 4) no more logs in the homebridge.log! Thanks Erik for guiding me in the right direction!