emsesp: use single cached bulk fetch to avoid firmware rate limiting (#32559)

This commit is contained in:
andig 2026-08-06 08:46:35 +02:00 • committed by GitHub
parent c0bb9a3fed
commit 12fd62f415
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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" . }}