Skip to content

Commit ba94d19

Browse files
author
Xavier Berger
committed
feat(fronius): Add logs for http_requests
1 parent 09f2e3d commit ba94d19

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

solar_router/power_meter_fronius.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,17 @@ script:
3939
then:
4040
- http_request.get:
4141
url: http://${power_meter_ip_address}/solar_api/v1/GetMeterRealtimeData.cgi
42+
headers:
43+
Content-Type: application/json
4244
capture_response: true
4345
max_response_buffer_size: 4096
4446
on_response:
4547
then:
48+
- logger.log:
49+
format: 'Response status: %d, Duration: %u ms'
50+
args:
51+
- response->status_code
52+
- response->duration_ms
4653
- lambda: |-
4754
json::parse_json(body, [](JsonObject root) -> bool {
4855
id(real_power).publish_state(root["Body"]["Data"]["0"]["PowerReal_P_Sum"].as< float >());

0 commit comments

Comments
 (0)