Skip to content

Commit

Permalink
Detect number of inverter strings (evcc-io#999)
Browse files Browse the repository at this point in the history
  • Loading branch information
andig authored May 11, 2021
1 parent d6624ce commit d8d9368
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions detect/definitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const (
taskEVSEWifi = "evsewifi"
taskGoE = "go-e"
taskInverter = "inverter"
taskStrings = "strings"
taskBattery = "battery"
taskMeter = "meter"
taskFronius = "fronius"
Expand Down Expand Up @@ -90,6 +91,18 @@ func init() {
},
})

taskList.Add(tasks.Task{
ID: taskStrings,
Type: tasks.Modbus,
Depends: TaskSunspec,
Config: map[string]interface{}{
"ids": sunspecIDs,
"models": []int{160},
"point": "N",
"invalid": []int{0xFFFF},
},
})

taskList.Add(tasks.Task{
ID: taskBattery,
Type: tasks.Modbus,
Expand Down
2 changes: 2 additions & 0 deletions detect/tasks/modbus.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ func (h *ModbusHandler) testSunSpec(log *util.Logger, conn meters.Connection, de
val = int(res.Uint16())
case "enum16":
val = int(res.Enum16())
case "count":
val = int(res.Count())
default:
panic("invalid point type: " + typ)
}
Expand Down

0 comments on commit d8d9368

Please sign in to comment.