Optional ads:
1. currently power display:
evaluates the power of the Shelly EM channels, displays it in the CUxD device and of course the value can also be used in programs.
For this we need 2 system variable for the currently power value:
The variables are assigned to the corresponding channel of the Shelly CUxD device. This makes it visible as shown in Figure 1 in # 1.
In the status updating program (see picture in # 2) we add a 2nd THEN line to update the power data.
Attention:
The names of the system variables must not contain any "spaces" !
The script for this:
!Skript zur Leistungsaktualisierung Shelly EM mit Originalfirmware (by SparkyMaster V2.0)
!Photovoltaik (nur zur Orientierung, ggf anpassen)
!****Abfrage des Shelly EM Kanal 1*****
!In der folgenden Zeile IP des Shelly EM anpassen!
var url = "http://192.168.178.33/emeter/0?status";
!In den folgenden Zeilen die CUxD-Exec-Kanal anpassen (hier: 2801001:15)
dom.GetObject("CUxD.CUX2801001:15.CMD_SETS").State("wget -q -O - '"#url#"'");
dom.GetObject("CUxD.CUX2801001:15.CMD_QUERY_RET").State(1);
string Antwort = dom.GetObject("CUxD.CUX2801001:15.CMD_RETS").State();
string t = dom.GetObject("CUxD.CUX2801001:15.CMD_RETS").State();
dom.GetObject("CUxD.CUX2801001:15.CMD_SETS").State("0");
!WriteLine(Antwort);
!WriteLine(t);
!****Auswertung des Antwortstrings ****
!Hier NICHTS ändern
string s;
foreach (s,t.Split (",")) {
if (s.LTrim ("{").StartsWith ('"power"')) {
string p = (s.StrValueByIndex (":",1).RTrim ("}"));
! WriteLine(p);
}
}
!**** Variable setzen****
!Variablennamen anpassen (hier: Shelly_EM_Photovoltaik_Leistung1)
dom.GetObject("Shelly_EM_Photovoltaik_Leistung1").State(p);
!****Abfrage des Shelly EM Kanal 2*****
!In der folgenden Zeile IP des Shelly EM anpassen!
var url = "http://192.168.178.33/emeter/1?status";
!In den folgenden Zeilen die CUxD-Exec-Kanal anpassen (hier: 2801001:15)
dom.GetObject("CUxD.CUX2801001:15.CMD_SETS").State("wget -q -O - '"#url#"'");
dom.GetObject("CUxD.CUX2801001:15.CMD_QUERY_RET").State(1);
string Antwort = dom.GetObject("CUxD.CUX2801001:15.CMD_RETS").State();
string t = dom.GetObject("CUxD.CUX2801001:15.CMD_RETS").State();
dom.GetObject("CUxD.CUX2801001:15.CMD_SETS").State("0");
!WriteLine(Antwort);
!WriteLine(t);
!****Auswertung des Antwortstrings ****
!Hier NICHTS ändern
string s;
foreach (s,t.Split (",")) {
if (s.LTrim ("{").StartsWith ('"power"')) {
string p = (s.StrValueByIndex (":",1).RTrim ("}"));
! WriteLine(p);
}
}
!**** Variable setzen****
!Variablennamen anpassen (hier: Shelly_EM_Photovoltaik_Leistung2)
dom.GetObject("Shelly_EM_Photovoltaik_Leistung2").State(p);
!Ende Skript
Alles anzeigen
In the set interval of the timer, the currently power is now updated. ![]()
2. Online Status:
As with all other couplings, the opt. display of the online status is also made using the system variable and CUxD ping device (28).
To display the online status, 1 system variable is required:
The variable is linked again to the corresponding channel of the CUxD device and thus displayed there.
The online status is monitored and controlled by a CUxD ping channel. That, with 1 CUxd Ping device (28) up to 16 Shelly EM can be monitored. Of course, a free channel of an existing CUxD ping can be used.
Adjust IP!
Settings for: SWITCH|CMD_EXEC_TRUE:
Settings for SWITCH|CMD_EXEC_FALSE:
Adapt the name of the system variable in each case! (here:Onlinestatus_ShellyEM_Photovoltaik)
In the set interval of the timer, the online status is now updated. ![]()
3. currently voltage display:
evaluates the voltage of the Shelly EM, displays it in the CUxD device and of course the value can also be used in programs.
For this we need 1 system variable for the currently voltage value:
The variables are assigned to the corresponding channel of the Shelly CUxD device. This makes it visible as shown in Figure 1 in # 1.
In the status updating program (see picture in # 2) we add a 3rd THEN line to update the voltage data.
Attention:
The names of the system variables must not contain any "spaces" !
The script for this:
!Skript zur Spannungsaktualisierung Shelly EM mit Originalfirmware (by SparkyMaster V1.0)
!Photovoltaik (nur zur Orientierung, ggf anpassen)
!****Abfrage des Shelly EM Kanal 1*****
!In der folgenden Zeile IP des Shelly EM anpassen!
var url = "http://192.168.178.33/emeter/0?voltage";
!In den folgenden Zeilen die CUxD-Exec-Kanal anpassen (hier: 2801001:15)
dom.GetObject("CUxD.CUX2801001:15.CMD_SETS").State("wget -q -O - '"#url#"'");
dom.GetObject("CUxD.CUX2801001:15.CMD_QUERY_RET").State(1);
string Antwort = dom.GetObject("CUxD.CUX2801001:15.CMD_RETS").State();
string t = dom.GetObject("CUxD.CUX2801001:15.CMD_RETS").State();
dom.GetObject("CUxD.CUX2801001:15.CMD_SETS").State("0");
!WriteLine(Antwort);
!WriteLine(t);
!****Auswertung des Antwortstrings ****
!Hier NICHTS ändern
string s;
foreach (s,t.Split (",")) {
if (s.LTrim ("{").StartsWith ('"voltage"')) {
string p = (s.StrValueByIndex (":",1).RTrim ("}"));
! WriteLine(p);
}
}
!**** Variable setzen****
!Variablennamen anpassen (hier: Shelly_EM_Photovoltaik_Spannung)
dom.GetObject("Shelly_EM_Photovoltaik_Spannung").State(p);
!Ende Skript
Alles anzeigen
In the set interval of the timer, the currently voltage is now updated. ![]()
4. currently reactive power display:
evaluates the reactive power of the Shelly EM channels, displays it in the CUxD device and of course the value can also be used in programs.
For this we need 2 system variable for the currently reactive power value:
The variables are assigned to the corresponding channel of the Shelly CUxD device. This makes it visible as shown in Figure 1 in # 1.
In the status updating program (see picture in # 2) we add a 4th THEN line to update the reactive power data.
Attention:
The names of the system variables must not contain any "spaces" !
The script for this:
!Skript zur Blindleistungsaktualisierung Shelly EM mit Originalfirmware (by SparkyMaster V2.0)
!Photovoltaik (nur zur Orientierung, ggf anpassen)
!****Abfrage des Shelly EM Kanal 1*****
!In der folgenden Zeile IP des Shelly EM anpassen!
var url = "http://192.168.178.33/emeter/0?reactive";
!In den folgenden Zeilen die CUxD-Exec-Kanal anpassen (hier: 2801001:15)
dom.GetObject("CUxD.CUX2801001:15.CMD_SETS").State("wget -q -O - '"#url#"'");
dom.GetObject("CUxD.CUX2801001:15.CMD_QUERY_RET").State(1);
string Antwort = dom.GetObject("CUxD.CUX2801001:15.CMD_RETS").State();
string t = dom.GetObject("CUxD.CUX2801001:15.CMD_RETS").State();
dom.GetObject("CUxD.CUX2801001:15.CMD_SETS").State("0");
!WriteLine(Antwort);
!WriteLine(t);
!****Auswertung des Antwortstrings ****
!Hier NICHTS ändern
string s;
foreach (s,t.Split (",")) {
if (s.LTrim ("{").StartsWith ('"reactive"')) {
string p = (s.StrValueByIndex (":",1).RTrim ("}"));
! WriteLine(p);
}
}
!**** Variable setzen****
!Variablennamen anpassen (hier: Shelly_EM_Photovoltaik_Blindleistung1)
dom.GetObject("Shelly_EM_Photovoltaik_Blindleistung1").State(p);
!****Abfrage des Shelly EM Kanal 2*****
!In der folgenden Zeile IP des Shelly EM anpassen!
var url = "http://192.168.178.33/emeter/1?reactive";
!In den folgenden Zeilen die CUxD-Exec-Kanal anpassen (hier: 2801001:15)
dom.GetObject("CUxD.CUX2801001:15.CMD_SETS").State("wget -q -O - '"#url#"'");
dom.GetObject("CUxD.CUX2801001:15.CMD_QUERY_RET").State(1);
string Antwort = dom.GetObject("CUxD.CUX2801001:15.CMD_RETS").State();
string t = dom.GetObject("CUxD.CUX2801001:15.CMD_RETS").State();
dom.GetObject("CUxD.CUX2801001:15.CMD_SETS").State("0");
!WriteLine(Antwort);
!WriteLine(t);
!****Auswertung des Antwortstrings ****
!Hier NICHTS ändern
string s;
foreach (s,t.Split (",")) {
if (s.LTrim ("{").StartsWith ('"reactive"')) {
string p = (s.StrValueByIndex (":",1).RTrim ("}"));
! WriteLine(p);
}
}
!**** Variable setzen****
!Variablennamen anpassen (hier: Shelly_EM_Photovoltaik_Blindleistung2)
dom.GetObject("Shelly_EM_Photovoltaik_Blindleistung2").State(p);
!Ende Skript
Alles anzeigen
Adapt the name of the system variable in each case! (here:Shelly_EM_Photovoltaik_Blindleistung1 bzw. 2)
In the set interval of the timer, the reactive power is now updated. ![]()
5. currently total consumed energy display:
evaluates the total consumed energy of the Shelly EM channels, displays it in the CUxD device and of course the value can also be used in programs.
For this we need 2 system variable for the currently total consumed energy:
The variables are assigned to the corresponding channel of the Shelly CUxD device. This makes it visible as shown in Figure 1 in # 1.
In the status updating program (see picture in # 2) we add a 5th THEN line to update the total consumed energy data.
Attention:
The names of the system variables must not contain any "spaces" !
The script for this:
!Skript zur Energie-Bezug-Aktualisierung Shelly EM mit Originalfirmware (by SparkyMaster V1.0)
!Photovoltaik (nur zur Orientierung, ggf anpassen)
!****Abfrage des Shelly EM Kanal 1*****
!In der folgenden Zeile IP des Shelly EM anpassen!
var url = "http://192.168.178.33/emeter/0?total";
!In den folgenden Zeilen die CUxD-Exec-Kanal anpassen (hier: 2801001:15)
dom.GetObject("CUxD.CUX2801001:15.CMD_SETS").State("wget -q -O - '"#url#"'");
dom.GetObject("CUxD.CUX2801001:15.CMD_QUERY_RET").State(1);
string Antwort = dom.GetObject("CUxD.CUX2801001:15.CMD_RETS").State();
string t = dom.GetObject("CUxD.CUX2801001:15.CMD_RETS").State();
dom.GetObject("CUxD.CUX2801001:15.CMD_SETS").State("0");
!WriteLine(Antwort);
!WriteLine(t);
!****Auswertung des Antwortstrings ****
!Hier NICHTS ändern
string s;
foreach (s,t.Split (",")) {
if (s.LTrim ("{").StartsWith ('"total"')) {
string p = (s.StrValueByIndex (":",1).RTrim ("}"));
! WriteLine(p);
}
}
!**** Variable setzen****
!Variablennamen anpassen (hier: Shelly_EM_Photovoltaik_Energie_Bezug1)
dom.GetObject("Shelly_EM_Photovoltaik_Energie_Bezug1").State(p);
!****Abfrage des Shelly EM Kanal 2*****
!In der folgenden Zeile IP des Shelly EM anpassen!
var url = "http://192.168.178.33/emeter/1?total";
!In den folgenden Zeilen die CUxD-Exec-Kanal anpassen (hier: 2801001:15)
dom.GetObject("CUxD.CUX2801001:15.CMD_SETS").State("wget -q -O - '"#url#"'");
dom.GetObject("CUxD.CUX2801001:15.CMD_QUERY_RET").State(1);
string Antwort = dom.GetObject("CUxD.CUX2801001:15.CMD_RETS").State();
string t = dom.GetObject("CUxD.CUX2801001:15.CMD_RETS").State();
dom.GetObject("CUxD.CUX2801001:15.CMD_SETS").State("0");
!WriteLine(Antwort);
!WriteLine(t);
!****Auswertung des Antwortstrings ****
!Hier NICHTS ändern
string s;
foreach (s,t.Split (",")) {
if (s.LTrim ("{").StartsWith ('"total"')) {
string p = (s.StrValueByIndex (":",1).RTrim ("}"));
! WriteLine(p);
}
}
!**** Variable setzen****
!Variablennamen anpassen (hier: Shelly_EM_Photovoltaik_Energie_Bezug2)
dom.GetObject("Shelly_EM_Photovoltaik_Energie_Bezug2").State(p);
!Ende Skript
Alles anzeigen
Adapt the name of the system variable in each case! (here:Shelly_EM_Photovoltaik_Energie_Bezug1 bzw. 2)
In the set interval of the timer, the total consumed energy is now updated. ![]()
6. currently total returned energy display:
evaluates the total returned Energy of the Shelly EM channels, displays it in the CUxD device and of course the value can also be used in programs.
For this we need 2 system variable for the currently total returned energy value:
The variables are assigned to the corresponding channel of the Shelly CUxD device. This makes it visible as shown in Figure 1 in # 1.
In the status updating program (see picture in # 2) we add a 6th THEN line to update the total returned energy data.
Attention:
The names of the system variables must not contain any "spaces" !
The script for this:
!Skript zur Energie-Einspeisung-Aktualisierung Shelly EM mit Originalfirmware (by SparkyMaster V1.0)
!Photovoltaik (nur zur Orientierung, ggf anpassen)
!****Abfrage des Shelly EM Kanal 1*****
!In der folgenden Zeile IP des Shelly EM anpassen!
var url = "http://192.168.178.33/emeter/0?status";
!In den folgenden Zeilen die CUxD-Exec-Kanal anpassen (hier: 2801001:15)
dom.GetObject("CUxD.CUX2801001:15.CMD_SETS").State("wget -q -O - '"#url#"'");
dom.GetObject("CUxD.CUX2801001:15.CMD_QUERY_RET").State(1);
string Antwort = dom.GetObject("CUxD.CUX2801001:15.CMD_RETS").State();
string t = dom.GetObject("CUxD.CUX2801001:15.CMD_RETS").State();
dom.GetObject("CUxD.CUX2801001:15.CMD_SETS").State("0");
!WriteLine(Antwort);
!WriteLine(t);
!****Auswertung des Antwortstrings ****
!Hier NICHTS ändern
string s;
foreach (s,t.Split (",")) {
if (s.LTrim ("{").StartsWith ('"total_returned"')) {
string p = (s.StrValueByIndex (":",1).RTrim ("}"));
! WriteLine(p);
}
}
!**** Variable setzen****
!Variablennamen anpassen (hier: Shelly_EM_Photovoltaik_Energie_Einspeisung1)
dom.GetObject("Shelly_EM_Photovoltaik_Energie_Einspeisung1").State(p);
!****Abfrage des Shelly EM Kanal 2*****
!In der folgenden Zeile IP des Shelly EM anpassen!
var url = "http://192.168.178.33/emeter/1?status";
!In den folgenden Zeilen die CUxD-Exec-Kanal anpassen (hier: 2801001:15)
dom.GetObject("CUxD.CUX2801001:15.CMD_SETS").State("wget -q -O - '"#url#"'");
dom.GetObject("CUxD.CUX2801001:15.CMD_QUERY_RET").State(1);
string Antwort = dom.GetObject("CUxD.CUX2801001:15.CMD_RETS").State();
string t = dom.GetObject("CUxD.CUX2801001:15.CMD_RETS").State();
dom.GetObject("CUxD.CUX2801001:15.CMD_SETS").State("0");
!WriteLine(Antwort);
!WriteLine(t);
!****Auswertung des Antwortstrings ****
!Hier NICHTS ändern
string s;
foreach (s,t.Split (",")) {
if (s.LTrim ("{").StartsWith ('"total_returned"')) {
string p = (s.StrValueByIndex (":",1).RTrim ("}"));
! WriteLine(p);
}
}
!**** Variable setzen****
!Variablennamen anpassen (hier: Shelly_EM_Photovoltaik_Energie_Einspeisung2)
dom.GetObject("Shelly_EM_Photovoltaik_Energie_Einspeisung2").State(p);
!Ende Skript
Alles anzeigen
Adapt the name of the system variable in each case! (here:Shelly_EM_Photovoltaik_Energie_Einspeisung1 bzw. 2)
In the set interval of the timer, the total returned energy is now updated. ![]()
____________________________________________________________
The instructions including the scripts and pictures are subject to copyright. Who violates the copyright (for example, images or texts illegally copied and published on other websites), makes itself gem. §§ 106 ff UrhG punishable, can also be warned with costs and must pay damages (§ 97 UrhG).
© 2019 SparkyMaster