Skip to content

Commit

Permalink
OTmonitor 6.2: Support firmware versions 5.5 and 6.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
hvxl committed Oct 11, 2022
1 parent e088a08 commit 2717ebc
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 13 deletions.
30 changes: 26 additions & 4 deletions otmonitor.vfs/eeprom.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ proc gui::eeprom::gui {w} {
toplevel $w.set
wm transient $w.set $w
wm title $w.set "Transferred EEPROM settings"
text $w.set.t -width 60 -height 18 -relief flat -highlightthickness 0 \
text $w.set.t -width 60 -height 20 -relief flat -highlightthickness 0 \
-cursor "" -font TkDefaultFont -wrap word
ttk::button $w.set.b1 -text Close -command [list destroy $w.set]
menu $w.set.t.menu -tearoff 0
Expand All @@ -19,8 +19,8 @@ proc gui::eeprom::gui {w} {
pack $w.set.b1 -side bottom -pady 4
pack $w.set.t -fill both -expand 1 -padx 4 -pady 4
foreach n {
SavedSettings Configuration FunctionGPIO AwaySetpoint
FunctionLED ThermostatModel AlternativeCmd UnknownFlags
Configuration ThermostatModel AwaySetpoint DHWSetpoint MaxCHSetpoint
SavedSettings FunctionLED FunctionGPIO AlternativeCmd UnknownFlags
} {
if {[dict exists $eeprom $n value]} {
[string tolower $n] $w.set.t [dict get $eeprom $n]
Expand Down Expand Up @@ -70,7 +70,27 @@ proc gui::eeprom::functiongpio {w data} {

proc gui::eeprom::awaysetpoint {w data} {
lassign [dict get $data value] unit frac
$w insert end "Away setpoint:\t[format %.2f [expr {$unit + $frac / 256.}]]\n"
$w insert end "Away setpoint:\t[float [expr {$unit * 256 + $frac}]]\n"
}

proc gui::eeprom::dhwsetpoint {w data} {
lassign [dict get $data value] unit frac
if {$unit} {
set value [float [expr {$unit * 256 + $frac}]]
} else {
set value --
}
$w insert end "DHW setpoint:\t$value\n"
}

proc gui::eeprom::maxchsetpoint {w data} {
lassign [dict get $data value] unit frac
if {$unit} {
set value [float [expr {$unit * 256 + $frac}]]
} else {
set value --
}
$w insert end "Max CH setpoint:\t$value\n"
}

proc gui::eeprom::functionled {w data} {
Expand All @@ -92,6 +112,8 @@ proc gui::eeprom::thermostatmodel {w data} {
set model iSense
} elseif {$val & 0x20} {
set model "Celcia 20"
} elseif {$val & 0x10} {
set model "Standard"
} else {
set model Default
}
Expand Down
7 changes: 4 additions & 3 deletions otmonitor.vfs/gui.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -2177,13 +2177,13 @@ proc gui::capsdlg {} {

set var [namespace which -variable capsvar]
ttk::label .caps.l1 -text "Boiler make and model:"
ttk::matchbox .caps.e1 -width 32 -textvariable ${var}(boiler) \
ttk::matchbox .caps.e1 -width 40 -textvariable ${var}(boiler) \
-matchcommand [list [namespace which capsmatch] .caps.e1]
ttk::label .caps.l2 -text "Thermostat make and model:"
ttk::matchbox .caps.e2 -width 32 -textvariable ${var}(thermostat) \
ttk::matchbox .caps.e2 -width 40 -textvariable ${var}(thermostat) \
-matchcommand [list [namespace which capsmatch] .caps.e2]
ttk::label .caps.l3 -text "Email address:"
ttk::entrybox .caps.e3 -width 32 -textvariable ${var}(email)
ttk::entrybox .caps.e3 -width 40 -textvariable ${var}(email)
set wrap [expr {[winfo reqwidth .caps.l2] + [winfo reqwidth .caps.e2] + 10}]
ttk::label .caps.h -wraplength $wrap -anchor w -justify left -text "All\
fields are optional. The logfile will automatically be uploaded if you\
Expand All @@ -2203,6 +2203,7 @@ proc gui::capsdlg {} {
grid .caps.status - -sticky ew -padx 5 -pady 5

::tk::PlaceWindow .caps widget .
wm resizable .caps 0 0

coroutine capscoro capslist .caps.e1 .caps.e2
}
Expand Down
6 changes: 3 additions & 3 deletions otmonitor.vfs/otmonitor.inf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Language "0409"
CodePage "04b0"
FileDescription "Opentherm Monitor 6.1"
FileVersion "6.1"
FileDescription "Opentherm Monitor 6.2"
FileVersion "6.2"
ProductName "Opentherm Monitor"
ProductVersion "6.1.0.0"
ProductVersion "6.2.0.0"
OriginalFilename "otmonitor.exe"
InternalName "otmonitor"
CompanyName "Tclcode"
Expand Down
2 changes: 1 addition & 1 deletion otmonitor.vfs/otmonitor.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Opentherm monitor utility.
# For more information, see http://otgw.tclcode.com/otmonitor.html

set version 6.1
set version 6.2
set reportflags 0
set appendlog 0
set setpt 20.00
Expand Down
17 changes: 15 additions & 2 deletions otmonitor.vfs/upgrade.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,8 @@ proc upgrade::eeprom {version} {
4.0a0 4.0a1 4.0a2 4.0a3 4.0a4 4.0a5 4.0a6 4.0a7 4.0a8
4.0a9 4.0a9.1 4.0a10 4.0a11 4.0a11.1 4.0a11.2 4.0a12
}
if {$version == 0 || \
$version ni $supported && ![package vsatisfies $version 4.0b0-6.2]} {
if {$version ni $supported && \
![package vsatisfies $version 4.0b0-5.5 6.0-6.3]} {
return {}
}
set rc {
Expand Down Expand Up @@ -684,6 +684,14 @@ proc upgrade::eeprom {version} {
address 0x0e
size 1
}
DHWSetpoint {
address 0x0f
size 2
}
MaxCHSetpoint {
address 0x11
size 2
}
UnknownFlags {
address 0xd0
size 16
Expand Down Expand Up @@ -757,6 +765,11 @@ proc upgrade::eeprom {version} {
dict set rc Configuration mask 0x30
}

# MaxCHSetpoint and DHWSetpoint were introduced in firmware 5.5 and 6.2
if {![package vsatisfies $version 5.5 6.2-]} {
dict unset rc DHWSetpoint
dict unset rc MaxCHSetpoint
}
return $rc
}

Expand Down

0 comments on commit 2717ebc

Please sign in to comment.