设备实时数据
接口描述 设备实时数据
请求URL https://api.solarmanpv.com/device/v1.0/currentData
请求方式 post
请求类型 application/json
返回类型 /
请求参数
参数名 数据类型 参数类型 是否必填 描述说明
language string query N 语言类型,示例值:zh
authorization string header Y accessToken,示例值:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9
companyId integer body N 商家ID ,示例值:22
deviceId integer body N 设备在平台内的唯一标识 ,示例值:252525
deviceSn string body Y 设备的唯一标识 ,示例值:12583SS
userId integer body Y 账号ID ,示例值:1234
响应参数
参数名 数据类型 参数类型 是否必填 描述说明
code string body N 信息码 ,示例值:10000
dataList array body N 数据列表 ,示例值:dataList
key string body N 参数key ,示例值:PG_Pt1
name string body N 参数名称 ,示例值:电网总功率
unit string body N 参数单位 ,示例值:W
value string body N 参数值 ,示例值:55
deviceId integer body N 设备在平台内的唯一标识 ,示例值:252525
deviceSn string body N 设备的唯一标识 ,示例值:12583SS
deviceState integer body N 设备的当前状态。取值:1.在线 2.报警 3.离线 ,示例值:1
deviceType string body N 设备类型 ,示例值:C0LLECTOR
msg string body N 信息描述 ,示例值:success
success boolean body N 是否成功 ,示例值:true
requestId string body N 请求标识 ,示例值:1d6f6eca9bee4b6483d4af064b659eec

示例

请求体

  1. {
  2. "deviceId": 123456789,
  3. "deviceSn": "deviceSn"
  4. }

响应体

  1. {
  2. "code": null,
  3. "msg": null,
  4. "success": true,
  5. "requestId": "requestId",
  6. "deviceSn": "deviceSn",
  7. "deviceId": 1234567890,
  8. "deviceType": "INVERTER",
  9. "deviceState": 1,
  10. "dataList": [
  11. {
  12. "key": "SN1",
  13. "value": "deviceSn",
  14. "unit": null,
  15. "name": "SN"
  16. },
  17. {
  18. "key": "PM1",
  19. "value": "47",
  20. "unit": null,
  21. "name": "Product Type"
  22. },
  23. {
  24. "key": "SS_CY1",
  25. "value": "SS_CY1",
  26. "unit": null,
  27. "name": "Production Compliance Country"
  28. },
  29. {
  30. "key": "P_CURVv1",
  31. "value": "4",
  32. "unit": null,
  33. "name": "Power Curve Version"
  34. },
  35. {
  36. "key": "Pr1",
  37. "value": "30000",
  38. "unit": "W",
  39. "name": "Rated Power"
  40. },
  41. {
  42. "key": "HCIv1",
  43. "value": "23",
  44. "unit": null,
  45. "name": "HMI Version"
  46. },
  47. {
  48. "key": "DSPv1",
  49. "value": "11",
  50. "unit": null,
  51. "name": "DSP Version"
  52. },
  53. {
  54. "key": "DV1",
  55. "value": "265.70",
  56. "unit": "V",
  57. "name": "DC Voltage PV1"
  58. },
  59. {
  60. "key": "DV2",
  61. "value": "310.30",
  62. "unit": "V",
  63. "name": "DC Voltage PV2"
  64. },
  65. {
  66. "key": "DV3",
  67. "value": "303.70",
  68. "unit": "V",
  69. "name": "DC Voltage PV3"
  70. },
  71. {
  72. "key": "DV4",
  73. "value": "221.10",
  74. "unit": "V",
  75. "name": "DC Voltage PV4"
  76. },
  77. {
  78. "key": "DC1",
  79. "value": "0.00",
  80. "unit": "A",
  81. "name": "DC Current PV1"
  82. },
  83. {
  84. "key": "DC2",
  85. "value": "0.00",
  86. "unit": "A",
  87. "name": "DC Current PV2"
  88. },
  89. {
  90. "key": "DC3",
  91. "value": "0.00",
  92. "unit": "A",
  93. "name": "DC Current PV3"
  94. },
  95. {
  96. "key": "DC4",
  97. "value": "0.00",
  98. "unit": "A",
  99. "name": "DC Current PV4"
  100. },
  101. {
  102. "key": "DP1",
  103. "value": "0.00",
  104. "unit": "W",
  105. "name": "DC Power PV1"
  106. },
  107. {
  108. "key": "DP2",
  109. "value": "0.00",
  110. "unit": "W",
  111. "name": "DC Power PV2"
  112. },
  113. {
  114. "key": "DP3",
  115. "value": "0.00",
  116. "unit": "W",
  117. "name": "DC Power PV3"
  118. },
  119. {
  120. "key": "DP4",
  121. "value": "0.00",
  122. "unit": "W",
  123. "name": "DC Power PV4"
  124. },
  125. {
  126. "key": "AV1",
  127. "value": "242.00",
  128. "unit": "V",
  129. "name": "AC Voltage R/U/A"
  130. },
  131. {
  132. "key": "AV2",
  133. "value": "240.50",
  134. "unit": "V",
  135. "name": "AC Voltage S/V/B"
  136. },
  137. {
  138. "key": "AV3",
  139. "value": "241.40",
  140. "unit": "V",
  141. "name": "AC Voltage T/W/C"
  142. },
  143. {
  144. "key": "AC1",
  145. "value": "0.00",
  146. "unit": "A",
  147. "name": "AC Current R/U/A"
  148. },
  149. {
  150. "key": "AC2",
  151. "value": "0.00",
  152. "unit": "A",
  153. "name": "AC Current S/V/B"
  154. },
  155. {
  156. "key": "AC3",
  157. "value": "0.00",
  158. "unit": "A",
  159. "name": "AC Current T/W/C"
  160. },
  161. {
  162. "key": "APo_t1",
  163. "value": "0.00",
  164. "unit": "W",
  165. "name": "Total AC Output Power (Active)"
  166. },
  167. {
  168. "key": "A_Fo1",
  169. "value": "50.01",
  170. "unit": "Hz",
  171. "name": "AC Output Frequency R"
  172. },
  173. {
  174. "key": "Et_ge0",
  175. "value": "8431.00",
  176. "unit": "kWh",
  177. "name": "Cumulative Production (Active)"
  178. },
  179. {
  180. "key": "Elast_mon1",
  181. "value": "3720",
  182. "unit": "kWh",
  183. "name": "Production Last Month (Active)"
  184. },
  185. {
  186. "key": "Etdy_ge1",
  187. "value": "0.00",
  188. "unit": "kWh",
  189. "name": "Daily Production (Active)"
  190. },
  191. {
  192. "key": "Emon1",
  193. "value": "2970",
  194. "unit": "kWh",
  195. "name": "Monthly Production (Active)"
  196. },
  197. {
  198. "key": "PG_Pt1",
  199. "value": "0",
  200. "unit": "W",
  201. "name": "Total Grid Power"
  202. },
  203. {
  204. "key": "Q_PG1",
  205. "value": "0",
  206. "unit": "Var",
  207. "name": "Total Grid Reactive Power"
  208. },
  209. {
  210. "key": "PG_PF1",
  211. "value": "0.00",
  212. "unit": null,
  213. "name": "Grid Power Factor"
  214. },
  215. {
  216. "key": "S_PGt1",
  217. "value": "0",
  218. "unit": "VA",
  219. "name": "Total Grid Apparent Power"
  220. },
  221. {
  222. "key": "T_in1",
  223. "value": "34.50",
  224. "unit": "℃",
  225. "name": "Internal Temperature"
  226. },
  227. {
  228. "key": "P_thd_pct1",
  229. "value": "100.00",
  230. "unit": "%",
  231. "name": "Limited Power (%)"
  232. },
  233. {
  234. "key": "STon_off1",
  235. "value": "190",
  236. "unit": null,
  237. "name": "On/Off Status"
  238. }
  239. ]
  240. }

CURL

normal

  1. ## 3.3 Real-time Data-Device
  2. curl -X "POST" "https://api.solarmanpv.com/device/v1.0/currentData?language=en" \
  3. -H 'Content-Type: application/json' \
  4. -H 'Authorization: bearer PUT-YOUR-TOKEN-HERE' \
  5. -d $'{
  6. "deviceSn": "YOUR-DEVICE-SN"
  7. }'

Home Assistant

https://community.home-assistant.io/t/collect-inverter-data-from-solarman-api/328760 https://reqbin.com/curl

  1. curl --request POST \
  2. --url 'https://api.solarmanpv.com/device/v1.0/currentData?appId=<appId>&language=en&=' \
  3. --header 'Authorization: bearer PUT-YOUR-TOKEN-HERE' \
  4. --header 'Content-Type: application/json' \
  5. --data '{
  6. "deviceSn": "YOUR-DEVICE-SN"
  7. }'

PYTHON

  1. # Install the Python Requests library:
  2. # `pip install requests`
  3. import requests
  4. import json
  5. def send_request():
  6. # 3.3 设备实时数据Real-time Data-Device
  7. # POST https://api.solarmanpv.com/device/v1.0/currentData
  8. try:
  9. response = requests.post(
  10. url="https://api.solarmanpv.com/device/v1.0/currentData",
  11. params={
  12. "language": "zh",
  13. },
  14. headers={
  15. "Content-Type": "application/json",
  16. "Authorization": "bearer your-token",
  17. "User-Agent":"Paw/3.3.1 (Macintosh; OS X/12.0.1) GCDHTTPRequest"
  18. },
  19. data=json.dumps({
  20. "deviceSn": "deviceSn"
  21. })
  22. )
  23. print('Response HTTP Status Code: {status_code}'.format(
  24. status_code=response.status_code))
  25. print('Response HTTP Response Body: {content}'.format(
  26. content=response.content))
  27. except requests.exceptions.RequestException:
  28. print('HTTP Request failed')