Leuk om te zien dat anderen mijn mod ook gebruiken:
https://github.com/dingo35/SmartEVSE-3.5/blob/master/integrations/slimmelezer/sl32.yaml
Het gaat om dit stukje:
substitutions:
device_name: sl32
smartevse_host: x.x.x.x # <== YOUR SMARTEVSE IP ADDRESS HERE
en...
interval:
- interval: 2sec
then:
- if:
condition:
lambda: |-
return (id(smartevse_integration) &&
!isnan(id(signed_current_l1).state) &&
!isnan(id(signed_current_l2).state) &&
!isnan(id(signed_current_l3).state));
then:
- http_request.post:
url: !lambda |-
static char url[128];
snprintf(url, sizeof(url),
"http://${smartevse_host}/currents?L1=%.0f&L2=%.0f&L3=%.0f",
id(signed_current_l1).state * 10,
id(signed_current_l2).state * 10,
id(signed_current_l3).state * 10);
return url;
headers:
Content-Length: 0
on_response:
then:
lambda: |-
if (id(smartevse_error) != 0) {
id(smartevse_error) = 0;
}
on_error:
then:
lambda: |-
if (id(smartevse_error) < 5) {
id(smartevse_error) += 1;
}
Dat kan uiteraard ook...