Deye Sun600G3 microinverter status query via curl

Hi experts,

I recently set up a Deye Sun600G3 solar microinverter and would like to read its data into openHAB.
On the command line it is very easy: (tested with ver 1.53, might be different with earlier/later)

curl -u user:password inverterhostname_ or_ ip/status.html | grep "$dat = "

prints the data that is visible on the status page in the web UI, among which is the current power generated in W, also the daily and permanent totalizer in kWh. Plus some info about serial#, versions, local access point and connected Wifi.

I’m not a programmer and got lost in the documentation on bindings quickly. Maybe someone is interested in making a binding/thing from this, or is there possibly a simple template somewhere to modify?


The Exec Binding and the HTTP Binding come to mind.

Post the data and we’ll see. :slight_smile:

Thanks for the very quick response. Here is the reply of the inverter to the curl request. Some bits changed for privacy purpose. Comments marked “–”.

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0var webdata_sn = "2211252261 ";
var webdata_msvn = " ";
var webdata_ssvn = " ";
var webdata_pv_type = “”;
var webdata_rate_p = “”;
var webdata_now_p = “84”; --Current solar power
var webdata_today_e = “4.0”; --Today total - seems to be not working properly, inverter does not reset the totalizer after dark
var webdata_total_e = “4.1”; --Permanent total
var webdata_alarm = “”;
var webdata_utime = “1”;
var cover_mid = “–Serial#OfTheInternalController,InverterSerialIsDifferent”;
var cover_ver = “MW3_16U_5406_1.53”;
var cover_wmode = “APSTA”;
var cover_ap_ssid = “–InternalAccessPointSSID”;
var cover_ap_ip = “”;
var cover_ap_mac = “–InternalAccessPointMAC”;
var cover_sta_ssid = “–ConnectedNetworkSSID”;
var cover_sta_rssi = “49%”;
var cover_sta_ip = “”;
var cover_sta_mac = “–InternalWlanClientMAC”;
var status_a = “0”;
var status_b = “0”;
var status_c = “0”;
100 11878 100 11878 0 0 212k 0 --:–:-- --:–:-- --:–:-- 214k


Exec Binding:

  1. Install Exec Binding.
  2. Install RegEx Transformation Service (not sure whether it is a requirement though).
  3. Add new Exec Thing.
  4. Add your command to the Exec Thing:
  5. You MUST whitelist your command, see Exec - Bindings | openHAB.
  6. Use REGEX(.*var webdata_now_p = "(.*)";.*) as value for ‘Transformation’ to extract the current solar power (use to test your regexes).
  7. Set Interval and Timeout and enable Autorun.
  8. Link an item to the channel output of your Exec Thing (note that the channel type is String).
1 Like

Hi again,

thanks very much for your help!
I got it working, with your regex slightly modified to get the info as string from the inverter answer and a second regex to transform into a number:

  1. Need a “non-greedy” regex in the Transformation field, otherwise OH (or Java?) gets confused by the double quote within the inverter answer. Difference is the question mark.
    Transformation: REGEX(.*var webdata_now_p = "(.*?)\".*)

  2. Second regex in Channel/Profile setting to convert string to number:
    Profile Configuration: (?<=\()\d(?=\))

The string-to-number regex is not required, inverter is sending power as integer only, and when there is an issue or no DC power it does not reply to the curl request.
OpenHAB seems to do the cast/conversion from string to number automatically, trends etc. are working fine.


1 Like