From 12fd62f415e4c3cdd16c069124e0620b35a2ea36 Mon Sep 17 00:00:00 2001 From: andig Date: Thu, 6 Aug 2026 08:46:35 +0200 Subject: [PATCH] emsesp: use single cached bulk fetch to avoid firmware rate limiting (#32559) --- templates/definition/charger/emsesp.yaml | 62 ++++++++++++------------ 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/templates/definition/charger/emsesp.yaml b/templates/definition/charger/emsesp.yaml index 46b11a6d6..a1bd7983e 100644 --- a/templates/definition/charger/emsesp.yaml +++ b/templates/definition/charger/emsesp.yaml @@ -93,36 +93,36 @@ render: | type: sgready power: source: http - uri: http://{{ .host }}/api/boiler/{{ .powersource }} - jq: .value // 0 + uri: http://{{ .host }}/api/boiler + cache: {{ .cache }} + jq: .{{ .powersource }} // 0 {{- if eq .powersource "hppower" }} scale: 1000 {{- end}} getmode: - source: cached - cache: {{ .cache }} - value: - source: go - script: | - res := 2 // 0/0 Normal - switch { - case SG1 == "1" && SG4 == "0": res = 1 // 1/0 Frostschutz - case SG4 == "1": res = 3 // x/1 Forcierter Betrieb/Sofortige Ansteuerung - } - res - in: - - name: SG1 - type: string - config: - source: http - uri: http://{{ .host }}/api/boiler/{{ .sg1 }} - jq: '.value[0:1]' - - name: SG4 - type: string - config: - source: http - uri: http://{{ .host }}/api/boiler/{{ .sg4 }} - jq: '.value[0:1]' + source: go + script: | + res := 2 // 0/0 Normal + switch { + case SG1 == "1" && SG4 == "0": res = 1 // 1/0 Frostschutz + case SG4 == "1": res = 3 // x/1 Forcierter Betrieb/Sofortige Ansteuerung + } + res + in: + - name: SG1 + type: string + config: + source: http + uri: http://{{ .host }}/api/boiler + cache: {{ .cache }} + jq: '.{{ .sg1 }}[0:1]' + - name: SG4 + type: string + config: + source: http + uri: http://{{ .host }}/api/boiler + cache: {{ .cache }} + jq: '.{{ .sg4 }}[0:1]' setmode: source: switch switch: @@ -191,11 +191,13 @@ render: | {{- if .tempsource }} temp: source: http - uri: http://{{ .host }}/api/boiler/dhw/curtemp - jq: .value + uri: http://{{ .host }}/api/boiler + cache: {{ .cache }} + jq: .dhw.curtemp limittemp: source: http - uri: http://{{ .host }}/api/boiler/dhw/settemp - jq: .value + uri: http://{{ .host }}/api/boiler + cache: {{ .cache }} + jq: .dhw.settemp {{- end }} {{ include "heatpumpswitch" . }}