Sinopé Thermostat TH112xZB with energy meter - debug logging

I’m looking for a way to stop debug logging on the display backlight using @samuel.c.auclair’s Sinopé TH112XZB thermostat driver. I’ve read through the driver code to see if I could find where it gets recorded, but don’t know enough to find it unfortunately…

This is the version I am using:

https://raw.githubusercontent.com/sacua/SinopeDriverHubitat/main/drivers/TH112xZB_Sinope_Hubitat.groovy

Line 766 has the log.debug line
log.debug("setting display backlight to ${mode} (${backlightModeAttr})")

You can comment it out by putting a // at the front.
// log.debug("setting display backlight to ${mode} (${backlightModeAttr})")

Probably better would be:
if (txtEnable) log.debug("setting display backlight to ${mode} (${backlightModeAttr})")

Even more better :slight_smile: would be to add in a debug switch and preface all the log.debug statements with the conditional.

Line 77 gets inserted:
input name: "debugOutput", type: "bool", title: "<b>Enable debug logging?</b>", description: "<br>", defaultValue: true //csteele

Then we turn it off after 30 min by inserting Line 116:
if (debugOutput) runIn(1800,logsOff) //csteele

Then add in a logsOff method:

def logsOff(){ //csteele
	log.warn "debug logging disabled..."
	device.updateSetting("debugOutput",[value:"false",type:"bool"])
}

at the very end of the code.

Line 766 then becomes:
if (debugOutput) log.debug("setting display backlight to ${mode} (${backlightModeAttr})")

and then put "if (debugOutput) " in front of any other log.debug you don't want to see all the time :smiley:

2 Likes

Will update the drivers accordingly to correct this bug when I will return home tomorrow.

4 Likes

If you use the logsOff code, you'll probably want an unschedule() ahead of the runIn...

    unschedule()
   //
    if (debugOutput) runIn(1800,logsOff)

Obviously every unschedule() in the driver today will terminate the 30 min autoshut, which might make it less desirable to have it at all.

1 Like

This is awesome! Thanks @csteele and @samuel.c.auclair!

You guys are really great! I really appreciate it. :blush:

Should be corrected the next time you will update the driver through HPM.

1 Like

Awesome! Thanks!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.