sfudeus / isg_exporter

Prometheus exporter for data from Stiebel Eltron Internet Service Gateway
Apache License 2.0
6 stars 1 forks source link

modbus scraping doesn't work (illegal data address) #109

Open lopf opened 3 weeks ago

lopf commented 3 weeks ago

Environment:

I'm starting it with docker compose:

services:
  isg_exporter:
    image: index.docker.io/sfudeus/isg_exporter:1.5.7
    environment:
      - ISG_URL=http://192.168.34.99 or 192.168.34.99 (modbus)
      - EXPORTER_PORT=8080
      - ISG_USER=pseudo
      - ISG_PASSWORD=pseudo
    ports:
      - "8080:8080"

If the exporter is started with just the IP in ISG_URL, it crashes with:

level=fatal msg="modbus: exception '2' (illegal data address), function '132'"

Scraping via HTTP doesn't work either if the WP is off ("Aus") (similar to https://github.com/sfudeus/isg_exporter/issues/65, it works fine if it's "On"):

panic: inconsistent label cardinality: expected 1 label values but got 0 in []string(nil)

goroutine 23 [running]:
github.com/prometheus/client_golang/prometheus.(*GaugeVec).WithLabelValues(...)
    /go/pkg/mod/github.com/prometheus/client_golang@v1.19.1/prometheus/gauge.go:238
main.createOrRetrieve({0x2d10710, 0xe}, {0x96bd44, 0x0}, 0x0)
    /build/main.go:219 +0x5ec
main.parsePage.func1.1(0x1, 0x28681e0)
    /build/scraping.go:123 +0x348
github.com/PuerkitoBio/goquery.(*Selection).Each(0x2d15ec0, 0x292fdfc)
    /go/pkg/mod/github.com/!puerkito!bio/goquery@v1.9.2/iteration.go:10 +0x64
main.parsePage.func1(0x3, 0x2d15e48)
    /build/scraping.go:98 +0xc0
github.com/PuerkitoBio/goquery.(*Selection).Each(0x2d14900, 0x292fe64)
    /go/pkg/mod/github.com/!puerkito!bio/goquery@v1.9.2/iteration.go:10 +0x64
main.parsePage({0x8553f5, 0x3}, 0x292ff48)
    /build/scraping.go:96 +0x1a8
main.gatherScrapingData()
    /build/scraping.go:74 +0x1b8
main.gatherData()
    /build/main.go:179 +0x158
main.main.func1()
    /build/main.go:97 +0x14
created by main.main in goroutine 1
    /build/main.go:95 +0x188

Did I miss something in the configuration or could this be related to the WPL model?

sfudeus commented 2 weeks ago

HI @lopf ,

what is a ICS 17 classic? The modbgus error might be explained by different fields being usable for your heatpump. This is governed by a modbus-mapping.yaml file (the location is not configurable, but you can override it at its location and remove whatever is not fitting to your system.

The language thing should be fixable easily enough, I need to check when I get to it.

sfudeus commented 2 weeks ago

@lopf Could you maybe provide an HTML dump of the page which cannot be scraped? It would be easier to test and reproduce then. Values like "Aus", "Ein", "On", "Off" should be supported.

sfudeus commented 2 weeks ago

And did your log maybe show more before the scraping error, something like Failed to process value %s for label %s, skipping