最近装了太阳能板,想用 lambda + grafana + prometheus 爬一下逆变器的各种数据做个简单的 dashboard.
然后发现华为光伏的 API 文档写的实在有点粗糙..
还有一些不能理解的地方:
curl -vkX POST \
'https://au1.fusionsolar.huawei.com:27200/openApi/login?userName=FOO&password=BAR'
* Trying 54.153.220.93...
* TCP_NODELAY set
* Connected to au1.fusionsolar.huawei.com (54.153.220.93) port 27200 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Request CERT (13):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / AES128-SHA
* ALPN, server did not agree to a protocol
* Server certificate:
* subject: C=CN; ST=Guangdong; L=Shenzhen; O=Huawei; OU=Network Energy; CN=NetEcoServer
* start date: Mar 18 01:23:06 2015 GMT
* expire date: Mar 13 01:23:06 2035 GMT
* issuer: C=CN; O=huawei; OU=Network Energy; CN=NEPL PKI
* SSL certificate verify result: self signed certificate in certificate chain (19), continuing anyway.
> POST /openApi/login?userName=FOO&password=BAR HTTP/1.1
> Host: au1.fusionsolar.huawei.com:27200
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Tue, 08 Oct 2019 13:02:55 GMT
< Set-Cookie: JSESSIONID=1jsi0rnxij5mzokex34wnr7ig;Path=/;Secure;HttpOnly
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Cache-Control: no-cache
< X-Frame-Options: SAMEORIGIN
< X-Download-Options: noopen
< X-XSS-Protection: 1;mode=block
< Strict-Transport-Security: max-age=31536000;includeSubdomains
< X-Content-Type-Options: nosniff
< Vary: Accept-Encoding, User-Agent
< Transfer-Encoding: chunked
<
{"errorMsg":309}
* Connection #0 to host au1.fusionsolar.huawei.com left intact
文档参考:
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.