From c83cd9cc8a2d6d38e0cc41f7c2074dbbc25c501f Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 10 Jul 2025 12:52:35 +0200 Subject: [PATCH 1/4] Bozza lib Emmegi (probab non necessaria) --- EgwProxy.Emmegi.Test/App.config | 6 ++ .../EgwProxy.Emmegi.Test.csproj | 59 +++++++++++++++++ EgwProxy.Emmegi.Test/Program.cs | 53 +++++++++++++++ .../Properties/AssemblyInfo.cs | 33 ++++++++++ EgwProxy.Emmegi/CallManager.cs | 57 +++++++++++++++++ EgwProxy.Emmegi/DTO/StatusDTO.cs | 64 +++++++++++++++++++ EgwProxy.Emmegi/EgwProxy.Emmegi.csproj | 50 +++++++++++++++ EgwProxy.Emmegi/Enums.cs | 22 +++++++ EgwProxy.Emmegi/Properties/AssemblyInfo.cs | 33 ++++++++++ 9 files changed, 377 insertions(+) create mode 100644 EgwProxy.Emmegi.Test/App.config create mode 100644 EgwProxy.Emmegi.Test/EgwProxy.Emmegi.Test.csproj create mode 100644 EgwProxy.Emmegi.Test/Program.cs create mode 100644 EgwProxy.Emmegi.Test/Properties/AssemblyInfo.cs create mode 100644 EgwProxy.Emmegi/CallManager.cs create mode 100644 EgwProxy.Emmegi/DTO/StatusDTO.cs create mode 100644 EgwProxy.Emmegi/EgwProxy.Emmegi.csproj create mode 100644 EgwProxy.Emmegi/Enums.cs create mode 100644 EgwProxy.Emmegi/Properties/AssemblyInfo.cs diff --git a/EgwProxy.Emmegi.Test/App.config b/EgwProxy.Emmegi.Test/App.config new file mode 100644 index 0000000..b50c74f --- /dev/null +++ b/EgwProxy.Emmegi.Test/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/EgwProxy.Emmegi.Test/EgwProxy.Emmegi.Test.csproj b/EgwProxy.Emmegi.Test/EgwProxy.Emmegi.Test.csproj new file mode 100644 index 0000000..4782b94 --- /dev/null +++ b/EgwProxy.Emmegi.Test/EgwProxy.Emmegi.Test.csproj @@ -0,0 +1,59 @@ + + + + + Debug + AnyCPU + {A5DDEF7B-98C3-4391-B8BC-16CFC469B77E} + Exe + EgwProxy.Emmegi.Test + EgwProxy.Emmegi.Test + v4.6.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + {f3c0f746-b4fb-4cbb-92bd-9c9a686a21bb} + EgwProxy.Emmegi + + + + \ No newline at end of file diff --git a/EgwProxy.Emmegi.Test/Program.cs b/EgwProxy.Emmegi.Test/Program.cs new file mode 100644 index 0000000..f5b6cda --- /dev/null +++ b/EgwProxy.Emmegi.Test/Program.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EgwProxy.Emmegi.Test +{ + internal class Program + { + static void Main(string[] args) + { + string linea = "-----------------------------"; + Console.WriteLine(linea); + Console.WriteLine("Test comunicazione Emmegi"); + Console.WriteLine(linea); + Console.WriteLine(); + + string escimi = "N"; + EgwProxy.Emmegi.CallManager EmmegiMan = new CallManager("http://192.168.100.59", 8090, "C129696"); + + + + Console.WriteLine("Premere un tasto per iniziare test."); + escimi = Console.ReadLine().ToUpper(); + + int idxReq = 10; + // lettura + while (escimi != "E") + { + string output = ""; + Console.WriteLine("Cosa vuoi fare ora? S = Status, E = Uscita"); + escimi = Console.ReadLine().ToUpper(); + DateTime adesso = DateTime.Now; + // invio pesata + if (escimi == "S") + { + try + { + var answ = EmmegiMan.GetCurrentStatus(); + output = $"Dt: {answ.Workstation.StatusTimestamp} | WrkId: {answ.Workstation.Id.IdValue} | Operatore: {answ.Workstation.Operator} | Job: {answ.Workstation.JobId} | Status: {answ.Workstation.Status} | # Tagli Job: {answ.Workstation.Operations} | # Tot Tagli: {answ.Workstation.TotalOperations}"; + Console.WriteLine(output); + Console.WriteLine(); + } + catch (Exception exc) + { + Console.WriteLine($"Errore:{Environment.NewLine}{exc}"); + } + } + } + } + } +} diff --git a/EgwProxy.Emmegi.Test/Properties/AssemblyInfo.cs b/EgwProxy.Emmegi.Test/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..5c97631 --- /dev/null +++ b/EgwProxy.Emmegi.Test/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("EgwProxy.Emmegi.Test")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("EgwProxy.Emmegi.Test")] +[assembly: AssemblyCopyright("Copyright © 2025")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a5ddef7b-98c3-4391-b8bc-16cfc469b77e")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/EgwProxy.Emmegi/CallManager.cs b/EgwProxy.Emmegi/CallManager.cs new file mode 100644 index 0000000..701b36b --- /dev/null +++ b/EgwProxy.Emmegi/CallManager.cs @@ -0,0 +1,57 @@ +using EgwProxy.Emmegi.DTO; +using System; +using System.Collections.Generic; +using System.Data.SqlTypes; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Serialization; + +namespace EgwProxy.Emmegi +{ + public class CallManager + { + + public CallManager(string baseUrl, int port, string workstationId) + { + BaseUrl = baseUrl; + Port= port; + WorkstationId = workstationId; + } + + /// + /// restituisce stato impianto nel formato specifico + /// + /// + public StatusDTO GetCurrentStatus() + { + StatusDTO answ = new StatusDTO(); + + // chiamo + string xmlRaw = @" + + + + ON + 2025-07-10 11:30:31 + unknown + TAGLIO SINGOLO + 194312 + 194312 + + "; + // deserializzo + var serializer = new XmlSerializer(typeof(StatusDTO)); + using (var reader = new StringReader(xmlRaw)) + { + answ = (StatusDTO)serializer.Deserialize(reader); + } + return answ; + } + + private string BaseUrl = ""; + private int Port = 0; + private string WorkstationId = ""; + } +} diff --git a/EgwProxy.Emmegi/DTO/StatusDTO.cs b/EgwProxy.Emmegi/DTO/StatusDTO.cs new file mode 100644 index 0000000..1d973c9 --- /dev/null +++ b/EgwProxy.Emmegi/DTO/StatusDTO.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices.ComTypes; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Serialization; + +namespace EgwProxy.Emmegi.DTO +{ + + [XmlRoot("result_workstation_status")] + public class StatusDTO + { + [XmlElement("workstation")] + public Workstation Workstation { get; set; } + } + + /// + /// Obj workstation + /// + public class Workstation + { + + [XmlElement("id")] + public WorkstationId Id { get; set; } + + [XmlElement("status")] + public Enums.MachineStatus Status { get; set; } + + [XmlElement("status_timestamp")] + public string StatusTimestampRaw { get; set; } + + [XmlIgnore] + public DateTime StatusTimestamp + { + get => DateTime.ParseExact(StatusTimestampRaw, "yyyy-MM-dd HH:mm:ss", null); + } + + [XmlElement("operator")] + public string Operator { get; set; } + + [XmlElement("job_id")] + public string JobId { get; set; } + + [XmlElement("operations")] + public int Operations { get; set; } + + [XmlElement("tot_operations")] + public int TotalOperations { get; set; } + } + + /// + /// Obj WorkstationId + /// + public class WorkstationId + { + [XmlAttribute("id")] + public string IdValue { get; set; } + } + +} + + diff --git a/EgwProxy.Emmegi/EgwProxy.Emmegi.csproj b/EgwProxy.Emmegi/EgwProxy.Emmegi.csproj new file mode 100644 index 0000000..e4fbd84 --- /dev/null +++ b/EgwProxy.Emmegi/EgwProxy.Emmegi.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + {F3C0F746-B4FB-4CBB-92BD-9C9A686A21BB} + Library + Properties + EgwProxy.Emmegi + EgwProxy.Emmegi + v4.6.2 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/EgwProxy.Emmegi/Enums.cs b/EgwProxy.Emmegi/Enums.cs new file mode 100644 index 0000000..4d385d9 --- /dev/null +++ b/EgwProxy.Emmegi/Enums.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EgwProxy.Emmegi +{ + public class Enums + { + public enum MachineStatus + { + ON, + WORKING, + OFF_LINE, + + OFF, + WAIT, + ERROR + } + } +} diff --git a/EgwProxy.Emmegi/Properties/AssemblyInfo.cs b/EgwProxy.Emmegi/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3125454 --- /dev/null +++ b/EgwProxy.Emmegi/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("EgwProxy.Emmegi")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("EgwProxy.Emmegi")] +[assembly: AssemblyCopyright("Copyright © 2025")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f3c0f746-b4fb-4cbb-92bd-9c9a686a21bb")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] From a3d7c936da08d5cc71f4d81383b8bb49bc62f05f Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 10 Jul 2025 12:52:45 +0200 Subject: [PATCH 2/4] Update shelly --- EgwProxy.Emmegi.sln | 43 ++++++++++++++++++++ EgwProxy.Shelly/DTO/Gen1/DiscoverDTO.cs | 47 ++++++++++++++++++++++ EgwProxy.Shelly/DTO/Gen2/DiscoverDTO.cs | 53 +++++++++++++++++++++++++ 3 files changed, 143 insertions(+) create mode 100644 EgwProxy.Emmegi.sln create mode 100644 EgwProxy.Shelly/DTO/Gen1/DiscoverDTO.cs create mode 100644 EgwProxy.Shelly/DTO/Gen2/DiscoverDTO.cs diff --git a/EgwProxy.Emmegi.sln b/EgwProxy.Emmegi.sln new file mode 100644 index 0000000..50cad8a --- /dev/null +++ b/EgwProxy.Emmegi.sln @@ -0,0 +1,43 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.2.32630.192 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.Gomba.Test", "EgwProxy.Gomba.Test\EgwProxy.Gomba.Test.csproj", "{2B7F1536-61D1-4F05-AF8D-62A52D114479}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.Gomba", "EgwProxy.Gomba\EgwProxy.Gomba.csproj", "{CC377124-1B94-40C1-B552-D6D42EB2BF27}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.Emmegi", "EgwProxy.Emmegi\EgwProxy.Emmegi.csproj", "{F3C0F746-B4FB-4CBB-92BD-9C9A686A21BB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.Emmegi.Test", "EgwProxy.Emmegi.Test\EgwProxy.Emmegi.Test.csproj", "{A5DDEF7B-98C3-4391-B8BC-16CFC469B77E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2B7F1536-61D1-4F05-AF8D-62A52D114479}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2B7F1536-61D1-4F05-AF8D-62A52D114479}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2B7F1536-61D1-4F05-AF8D-62A52D114479}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2B7F1536-61D1-4F05-AF8D-62A52D114479}.Release|Any CPU.Build.0 = Release|Any CPU + {CC377124-1B94-40C1-B552-D6D42EB2BF27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CC377124-1B94-40C1-B552-D6D42EB2BF27}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CC377124-1B94-40C1-B552-D6D42EB2BF27}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CC377124-1B94-40C1-B552-D6D42EB2BF27}.Release|Any CPU.Build.0 = Release|Any CPU + {F3C0F746-B4FB-4CBB-92BD-9C9A686A21BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F3C0F746-B4FB-4CBB-92BD-9C9A686A21BB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F3C0F746-B4FB-4CBB-92BD-9C9A686A21BB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F3C0F746-B4FB-4CBB-92BD-9C9A686A21BB}.Release|Any CPU.Build.0 = Release|Any CPU + {A5DDEF7B-98C3-4391-B8BC-16CFC469B77E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A5DDEF7B-98C3-4391-B8BC-16CFC469B77E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A5DDEF7B-98C3-4391-B8BC-16CFC469B77E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A5DDEF7B-98C3-4391-B8BC-16CFC469B77E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DA96981F-F7D0-47A9-A51F-9BCC8D35619F} + EndGlobalSection +EndGlobal diff --git a/EgwProxy.Shelly/DTO/Gen1/DiscoverDTO.cs b/EgwProxy.Shelly/DTO/Gen1/DiscoverDTO.cs new file mode 100644 index 0000000..8f96776 --- /dev/null +++ b/EgwProxy.Shelly/DTO/Gen1/DiscoverDTO.cs @@ -0,0 +1,47 @@ +using Newtonsoft.Json; + +// +// This is here so CodeMaid doesn't reorganize this document +// +namespace EgwProxy.Shelly.DTO.Gen1 +{ + /// + /// Discover for Gen1 Shelly Dev + /// + public class DiscoverDTO + { + #region Public Properties + + [JsonProperty("auth")] + public bool Auth { get; set; } + + [JsonProperty("discoverable")] + public bool Discoverable { get; set; } + + [JsonProperty("fw")] + public string Fw { get; set; } + + [JsonProperty("longid")] + public int Longid { get; set; } + + [JsonProperty("mac")] + public string Mac { get; set; } + + [JsonProperty("num_emeters")] + public int NumEmeters { get; set; } + + [JsonProperty("num_meters")] + public int NumMeters { get; set; } + + [JsonProperty("num_outputs")] + public int NumOutputs { get; set; } + + [JsonProperty("report_period")] + public int ReportPeriod { get; set; } + + [JsonProperty("type")] + public string Type { get; set; } + + #endregion Public Properties + } +} \ No newline at end of file diff --git a/EgwProxy.Shelly/DTO/Gen2/DiscoverDTO.cs b/EgwProxy.Shelly/DTO/Gen2/DiscoverDTO.cs new file mode 100644 index 0000000..26fb8df --- /dev/null +++ b/EgwProxy.Shelly/DTO/Gen2/DiscoverDTO.cs @@ -0,0 +1,53 @@ +using Newtonsoft.Json; + +// +// This is here so CodeMaid doesn't reorganize this document +// +namespace EgwProxy.Shelly.DTO.Gen2 +{ + /// + /// Discover for Gen Shelly Dev + /// + public class DiscoverDTO + { + #region Public Properties + + [JsonProperty("app")] + public string App { get; set; } + + [JsonProperty("auth_domain")] + public object AuthDomain { get; set; } + + [JsonProperty("auth_en")] + public bool AuthEn { get; set; } + + [JsonProperty("fw_id")] + public string FwId { get; set; } + + [JsonProperty("gen")] + public int Gen { get; set; } + + [JsonProperty("id")] + public string Id { get; set; } + + [JsonProperty("mac")] + public string Mac { get; set; } + + [JsonProperty("model")] + public string Model { get; set; } + + [JsonProperty("name")] + public object Name { get; set; } + + [JsonProperty("profile")] + public string Profile { get; set; } + + [JsonProperty("slot")] + public int Slot { get; set; } + + [JsonProperty("ver")] + public string Ver { get; set; } + + #endregion Public Properties + } +} \ No newline at end of file From fa258cf09b2736c0411ea89dea426677e5540afc Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 6 Aug 2025 18:38:31 +0200 Subject: [PATCH 3/4] Shelly: -Update libreria x Pro3Em --- EgwProxy.Shelly/Clients/IShellyPro3Em.cs | 12 ++++ EgwProxy.Shelly/Clients/ShellyPro3EmClient.cs | 55 ++++++++++++++++ .../Converters/EnergyDtoConverter.cs | 66 +++++++++++++++++++ EgwProxy.Shelly/DTO/BaseServiceDto.cs | 2 +- EgwProxy.Shelly/DTO/Gen2/EnergyDto.cs | 57 ++++++++++++++++ EgwProxy.Shelly/DTO/Gen2/PhaseDataDto.cs | 18 +++++ EgwProxy.Shelly/DTO/ShellyGen2StatusDto.cs | 10 ++- EgwProxy.Shelly/EgwProxy.Shelly.csproj | 7 +- 8 files changed, 222 insertions(+), 5 deletions(-) create mode 100644 EgwProxy.Shelly/Clients/IShellyPro3Em.cs create mode 100644 EgwProxy.Shelly/Clients/ShellyPro3EmClient.cs create mode 100644 EgwProxy.Shelly/Converters/EnergyDtoConverter.cs create mode 100644 EgwProxy.Shelly/DTO/Gen2/EnergyDto.cs create mode 100644 EgwProxy.Shelly/DTO/Gen2/PhaseDataDto.cs diff --git a/EgwProxy.Shelly/Clients/IShellyPro3Em.cs b/EgwProxy.Shelly/Clients/IShellyPro3Em.cs new file mode 100644 index 0000000..60f272b --- /dev/null +++ b/EgwProxy.Shelly/Clients/IShellyPro3Em.cs @@ -0,0 +1,12 @@ +using EgwProxy.Shelly.DTO; +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace EgwProxy.Shelly.Clients +{ + public interface IShellyPro3Em + { + Task> GetStatus(CancellationToken cancellationToken, TimeSpan? timeout = null); + } +} diff --git a/EgwProxy.Shelly/Clients/ShellyPro3EmClient.cs b/EgwProxy.Shelly/Clients/ShellyPro3EmClient.cs new file mode 100644 index 0000000..ef53785 --- /dev/null +++ b/EgwProxy.Shelly/Clients/ShellyPro3EmClient.cs @@ -0,0 +1,55 @@ +using EgwProxy.Shelly.Converters; +using EgwProxy.Shelly.DTO; +using EgwProxy.Shelly.DTO.Gen2; +using EgwProxy.Shelly.Options; +using Flurl; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; + +namespace EgwProxy.Shelly.Clients +{ + public class ShellyPro3EmClient : ShellyClientBase, IShellyPro3Em + { + public ShellyPro3EmClient(HttpClient httpClient, Shelly1PmOptions shellyOptions) : base(httpClient, shellyOptions) + { + } + + public async Task> GetStatus(CancellationToken cancellationToken, TimeSpan? timeout = null) + { + var endpoint = ServerUri.AppendPathSegment("Shelly.GetStatus"); + var requestMessage = new HttpRequestMessage(HttpMethod.Get, endpoint); + return await ExecuteRequestAsync(requestMessage, cancellationToken, timeout); + } + + public async Task> GetEmStatus(CancellationToken cancellationToken, TimeSpan? timeout = null) + { + var endpoint = ServerUri.AppendPathSegment("EM.GetStatus?id=0"); + var requestMessage = new HttpRequestMessage(HttpMethod.Get, endpoint); + return await ExecuteRequestAsync(requestMessage, cancellationToken, timeout); + } + +#if false + public async Task> GetSwitchStatus(CancellationToken cancellationToken, int id, TimeSpan? timeout = null) + { + var endpoint = ServerUri.AppendPathSegment("Switch.GetStatus").AppendQueryParam("id", id); + var requestMessage = new HttpRequestMessage(HttpMethod.Get, endpoint); + return await ExecuteRequestAsync(requestMessage, cancellationToken, timeout); + } +#endif + + protected override async Task> HandleOkResponse(HttpResponseMessage response) + { + var readAsStringAsync = await response.Content.ReadAsStringAsync(); + var settings = new JsonSerializerSettings + { + Converters = new List { new EnergyDtoConverter() } + }; + var shelly1Status = JsonConvert.DeserializeObject(readAsStringAsync, settings); + return ShellyResult.Success(shelly1Status, readAsStringAsync); + } + } +} diff --git a/EgwProxy.Shelly/Converters/EnergyDtoConverter.cs b/EgwProxy.Shelly/Converters/EnergyDtoConverter.cs new file mode 100644 index 0000000..81de237 --- /dev/null +++ b/EgwProxy.Shelly/Converters/EnergyDtoConverter.cs @@ -0,0 +1,66 @@ +using EgwProxy.Shelly.DTO.Gen2; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EgwProxy.Shelly.Converters +{ + public class EnergyDtoConverter : JsonConverter + { + public override EnergyDto ReadJson(JsonReader reader, Type objectType, EnergyDto existingValue, bool hasExistingValue, JsonSerializer serializer) + { + JObject obj = JObject.Load(reader); + var dto = new EnergyDto + { + Id = (int)obj["id"], + NeutralCurrent = obj["n_current"]?.ToObject() ?? 0, + TotalCurrent = (double)obj["total_current"], + TotalActivePower = (double)obj["total_act_power"], + TotalApparentPower = (double)obj["total_aprt_power"], + UserCalibratedPhase = obj["user_calibrated_phase"]?.ToObject>() ?? new List() + }; + + dto.PhaseA = new PhaseDataDto + { + Current = (double)obj["a_current"], + Voltage = (double)obj["a_voltage"], + ActivePower = (double)obj["a_act_power"], + ApparentPower = (double)obj["a_aprt_power"], + PowerFactor = (double)obj["a_pf"], + Frequency = (double)obj["a_freq"] + }; + + dto.PhaseB = new PhaseDataDto + { + Current = (double)obj["b_current"], + Voltage = (double)obj["b_voltage"], + ActivePower = (double)obj["b_act_power"], + ApparentPower = (double)obj["b_aprt_power"], + PowerFactor = (double)obj["b_pf"], + Frequency = (double)obj["b_freq"] + }; + + dto.PhaseC = new PhaseDataDto + { + Current = (double)obj["c_current"], + Voltage = (double)obj["c_voltage"], + ActivePower = (double)obj["c_act_power"], + ApparentPower = (double)obj["c_aprt_power"], + PowerFactor = (double)obj["c_pf"], + Frequency = (double)obj["c_freq"] + }; + + return dto; + } + + public override void WriteJson(JsonWriter writer, EnergyDto value, JsonSerializer serializer) + { + throw new NotImplementedException("Serialization not implemented"); + } + } + +} diff --git a/EgwProxy.Shelly/DTO/BaseServiceDto.cs b/EgwProxy.Shelly/DTO/BaseServiceDto.cs index bb026c7..e708e74 100644 --- a/EgwProxy.Shelly/DTO/BaseServiceDto.cs +++ b/EgwProxy.Shelly/DTO/BaseServiceDto.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace EgwProxy.Shelly.DTO.Shelly1PM +namespace EgwProxy.Shelly.DTO { public class BaseServiceDto { diff --git a/EgwProxy.Shelly/DTO/Gen2/EnergyDto.cs b/EgwProxy.Shelly/DTO/Gen2/EnergyDto.cs new file mode 100644 index 0000000..d0348e5 --- /dev/null +++ b/EgwProxy.Shelly/DTO/Gen2/EnergyDto.cs @@ -0,0 +1,57 @@ +using Newtonsoft.Json; +using System.Collections.Generic; + +namespace EgwProxy.Shelly.DTO.Gen2 +{ + /// + /// Energy Info + /// + public class EnergyDto + { + + public int Id { get; set; } + + /// + /// Phase A data + /// + public PhaseDataDto PhaseA { get; set; } = new PhaseDataDto(); + /// + /// Phase B data + /// + public PhaseDataDto PhaseB { get; set; } = new PhaseDataDto(); + /// + /// Phase C data + /// + public PhaseDataDto PhaseC { get; set; } = new PhaseDataDto(); + + /// + /// Corrente Neutro + /// + [JsonProperty("n_current")] + public double NeutralCurrent { get; set; } = 0; + + /// + /// Corrente Totale + /// + [JsonProperty("total_current")] + public double TotalCurrent { get; set; } = 0; + + /// + /// Corrente Totale Attiva + /// + [JsonProperty("total_act_power")] + public double TotalActivePower { get; set; } = 0; + + /// + /// Corrente Totale Apparente + /// + [JsonProperty("total_aprt_power")] + public double TotalApparentPower { get; set; } = 0; + + /// + /// Calibrazione fasi manuale + /// + [JsonProperty("user_calibrated_phase")] + public List UserCalibratedPhase { get; set; } = new List(); + } +} diff --git a/EgwProxy.Shelly/DTO/Gen2/PhaseDataDto.cs b/EgwProxy.Shelly/DTO/Gen2/PhaseDataDto.cs new file mode 100644 index 0000000..8ccdf4c --- /dev/null +++ b/EgwProxy.Shelly/DTO/Gen2/PhaseDataDto.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EgwProxy.Shelly.DTO.Gen2 +{ + public class PhaseDataDto + { + public double ActivePower { get; set; } = 0; + public double ApparentPower { get; set; } = 0; + public double Current { get; set; } = 0; + public double Frequency { get; set; } = 0; + public double PowerFactor { get; set; } = 0; + public double Voltage { get; set; } = 0; + } +} diff --git a/EgwProxy.Shelly/DTO/ShellyGen2StatusDto.cs b/EgwProxy.Shelly/DTO/ShellyGen2StatusDto.cs index 30bf2a1..be02120 100644 --- a/EgwProxy.Shelly/DTO/ShellyGen2StatusDto.cs +++ b/EgwProxy.Shelly/DTO/ShellyGen2StatusDto.cs @@ -1,4 +1,4 @@ -using EgwProxy.Shelly.DTO.Shelly1PM; +using EgwProxy.Shelly.DTO.Gen2; using Newtonsoft.Json; namespace EgwProxy.Shelly.DTO @@ -9,7 +9,6 @@ namespace EgwProxy.Shelly.DTO /// public class ShellyGen2StatusDto { - /// /// WiFi data /// @@ -22,6 +21,13 @@ namespace EgwProxy.Shelly.DTO [JsonProperty("cloud")] public CloudDto ShellyCloud { get; set; } + + /// + /// EnergyMonitor 0 data + /// + [JsonProperty("em:0")] + public EnergyDto EmData { get; set; } + /// /// MQTT queue state /// diff --git a/EgwProxy.Shelly/EgwProxy.Shelly.csproj b/EgwProxy.Shelly/EgwProxy.Shelly.csproj index f4608dd..60fff12 100644 --- a/EgwProxy.Shelly/EgwProxy.Shelly.csproj +++ b/EgwProxy.Shelly/EgwProxy.Shelly.csproj @@ -83,13 +83,16 @@ - + - + + + + From a486724c2ecb34b035135bf6befeb1439d0d6239 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 6 Aug 2025 18:38:42 +0200 Subject: [PATCH 4/4] Refrest test project --- EgwProxy.Emmegi.sln | 12 --- .../EgwProxy.Shelly.Test.csproj | 9 ++ EgwProxy.Shelly.Test/Program.cs | 85 +++++++++++++------ EgwProxy.Shelly.Test/TestSetup.cs | 8 ++ EgwProxy.Shelly.Test/conf/testSetup.json | 3 +- EgwProxy.Shelly.Test/conf/testSetup_71.json | 14 +++ EgwProxy.Shelly.Test/conf/testSetup_72.json | 14 +++ EgwProxy.Shelly.Test/conf/testSetup_73.json | 14 +++ RestTest/Insomnia_Shelly.json | 1 + 9 files changed, 122 insertions(+), 38 deletions(-) create mode 100644 EgwProxy.Shelly.Test/conf/testSetup_71.json create mode 100644 EgwProxy.Shelly.Test/conf/testSetup_72.json create mode 100644 EgwProxy.Shelly.Test/conf/testSetup_73.json create mode 100644 RestTest/Insomnia_Shelly.json diff --git a/EgwProxy.Emmegi.sln b/EgwProxy.Emmegi.sln index 50cad8a..47b3064 100644 --- a/EgwProxy.Emmegi.sln +++ b/EgwProxy.Emmegi.sln @@ -3,10 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.2.32630.192 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.Gomba.Test", "EgwProxy.Gomba.Test\EgwProxy.Gomba.Test.csproj", "{2B7F1536-61D1-4F05-AF8D-62A52D114479}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.Gomba", "EgwProxy.Gomba\EgwProxy.Gomba.csproj", "{CC377124-1B94-40C1-B552-D6D42EB2BF27}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.Emmegi", "EgwProxy.Emmegi\EgwProxy.Emmegi.csproj", "{F3C0F746-B4FB-4CBB-92BD-9C9A686A21BB}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.Emmegi.Test", "EgwProxy.Emmegi.Test\EgwProxy.Emmegi.Test.csproj", "{A5DDEF7B-98C3-4391-B8BC-16CFC469B77E}" @@ -17,14 +13,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2B7F1536-61D1-4F05-AF8D-62A52D114479}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2B7F1536-61D1-4F05-AF8D-62A52D114479}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2B7F1536-61D1-4F05-AF8D-62A52D114479}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2B7F1536-61D1-4F05-AF8D-62A52D114479}.Release|Any CPU.Build.0 = Release|Any CPU - {CC377124-1B94-40C1-B552-D6D42EB2BF27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CC377124-1B94-40C1-B552-D6D42EB2BF27}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CC377124-1B94-40C1-B552-D6D42EB2BF27}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CC377124-1B94-40C1-B552-D6D42EB2BF27}.Release|Any CPU.Build.0 = Release|Any CPU {F3C0F746-B4FB-4CBB-92BD-9C9A686A21BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F3C0F746-B4FB-4CBB-92BD-9C9A686A21BB}.Debug|Any CPU.Build.0 = Debug|Any CPU {F3C0F746-B4FB-4CBB-92BD-9C9A686A21BB}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/EgwProxy.Shelly.Test/EgwProxy.Shelly.Test.csproj b/EgwProxy.Shelly.Test/EgwProxy.Shelly.Test.csproj index dce3fb9..dd699b8 100644 --- a/EgwProxy.Shelly.Test/EgwProxy.Shelly.Test.csproj +++ b/EgwProxy.Shelly.Test/EgwProxy.Shelly.Test.csproj @@ -54,6 +54,15 @@ + + Always + + + Always + + + Always + Always diff --git a/EgwProxy.Shelly.Test/Program.cs b/EgwProxy.Shelly.Test/Program.cs index 68d4301..a179125 100644 --- a/EgwProxy.Shelly.Test/Program.cs +++ b/EgwProxy.Shelly.Test/Program.cs @@ -1,10 +1,7 @@ using System; -using System.Collections.Generic; using System.Diagnostics; using System.Configuration; using System.IO; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; using EgwProxy.Shelly.Clients; @@ -44,10 +41,15 @@ namespace EgwProxy.Shelly.Test return answ; } + ////APC + //private string shellyAddr = "10.74.81.71"; //// caffè //private string shellyAddr = "10.74.81.72"; - //APC - private string shellyAddr = "10.74.81.71"; + //private string model = "Pm1"; + + ////3EM Trifase + //private string shellyAddr = "10.74.81.73"; + //private string model = "Pro3Em"; /// /// Programma principale @@ -60,7 +62,7 @@ namespace EgwProxy.Shelly.Test Console.WriteLine(separator); Console.WriteLine(); string exePath = System.Reflection.Assembly.GetExecutingAssembly().Location; - string BaseDirectory = System.IO.Path.GetDirectoryName(exePath); + string BaseDirectory = Path.GetDirectoryName(exePath); string testFile = Path.Combine(BaseDirectory, "conf", ReadSetting("testFile")); if (!string.IsNullOrEmpty(testFile)) { @@ -86,9 +88,25 @@ namespace EgwProxy.Shelly.Test DefaultTimeout = TimeSpan.FromSeconds(testConf.tOutSec), ServerUri = new Uri($"http://{testConf.devAddr}/rpc") }; - Shelly1PmClient shelly = new Shelly1PmClient(new HttpClient(), options); - // test chiamata completa - serverTest(shelly); + Shelly1PmClient shelly1PM = new Shelly1PmClient(new HttpClient(), options); + ShellyPro3EmClient shellyPro3 = new ShellyPro3EmClient(new HttpClient(), options); + switch (testConf.model) + { + case shellyModel.nd: + break; + case shellyModel.gen1: + // test chiamata completa + serverTest(shelly1PM); + break; + case shellyModel.gen2: + // test chiamata completa + serverTest(shellyPro3); + break; + default: + break; + } + + bool doRepeat = true; while (doRepeat) { @@ -106,25 +124,19 @@ namespace EgwProxy.Shelly.Test switch (item.action) { case stepType.getFullStatus: - var respFull = Task.Run(() => shelly.GetStatus(CancellationToken.None)).Result; + var respFull = Task.Run(() => shelly1PM.GetStatus(CancellationToken.None)).Result; if (respFull.IsSuccess) { - esitoStep = JsonConvert.SerializeObject(respFull.Value, Formatting.Indented); - } - else - { - esitoStep = "Errore in GetStatus"; + string serValFull = JsonConvert.SerializeObject(respFull.Value, Formatting.Indented); + esitoStep = respFull.IsSuccess ? serValFull : "Errore in GetStatus"; } break; case stepType.getSwitchStatus: - var respSwitch = Task.Run(() => shelly.GetSwitchStatus(CancellationToken.None, 0)).Result; + var respSwitch = Task.Run(() => shellyPro3.GetEmStatus(CancellationToken.None)).Result; if (respSwitch.IsSuccess) { - esitoStep = JsonConvert.SerializeObject(respSwitch.Value, Formatting.Indented); - } - else - { - esitoStep = "Errore in GetSwitchStatus"; + string serValSwitch = JsonConvert.SerializeObject(respSwitch.Value, Formatting.Indented); + esitoStep = respSwitch.IsSuccess ? serValSwitch : "Errore in GetEmStatus"; } break; default: @@ -157,17 +169,40 @@ namespace EgwProxy.Shelly.Test // registro ed eseguo chiamata in modalità sincrona sw.Restart(); var response = Task.Run(() => shellyClient.GetStatus(CancellationToken.None)).Result; - sw.Stop(); - Console.WriteLine($"CallSuccess: {response.IsSuccess}"); - if (response.Value != null) + if (response.IsSuccess) + { + string serVal = JsonConvert.SerializeObject(response.Value, Formatting.Indented); + sw.Stop(); + writeResult(response.IsSuccess, serVal); + } + } + + private static void writeResult(bool isSuccess, string serVal) + { + Console.WriteLine($"CallSuccess: {isSuccess}"); + if (!string.IsNullOrEmpty(serVal)) { Console.WriteLine(separator); - Console.WriteLine(JsonConvert.SerializeObject(response.Value, Formatting.Indented)); + Console.WriteLine(serVal); Console.WriteLine(separator); Console.WriteLine($"Elapsed: {sw.Elapsed.TotalMilliseconds:N3}ms"); Console.WriteLine(separator); Console.WriteLine(); } } + + private static void serverTest(ShellyPro3EmClient shellyClient) + { + Console.WriteLine(separator); + // registro ed eseguo chiamata in modalità sincrona + sw.Restart(); + var response = Task.Run(() => shellyClient.GetStatus(CancellationToken.None)).Result; + if (response.IsSuccess) + { + string serVal = JsonConvert.SerializeObject(response.Value, Formatting.Indented); + sw.Stop(); + writeResult(response.IsSuccess, serVal); + } + } } } diff --git a/EgwProxy.Shelly.Test/TestSetup.cs b/EgwProxy.Shelly.Test/TestSetup.cs index b617b7c..1acf9c2 100644 --- a/EgwProxy.Shelly.Test/TestSetup.cs +++ b/EgwProxy.Shelly.Test/TestSetup.cs @@ -9,6 +9,7 @@ namespace EgwProxy.Shelly.Test public class TestSetup { public string devAddr { get; set; } = ""; + public shellyModel model { get; set; } = shellyModel.nd; public int tOutSec{ get; set; } = 5; public List steps { get; set; } } @@ -33,4 +34,11 @@ namespace EgwProxy.Shelly.Test getSwitchStatus } + public enum shellyModel + { + nd, + gen1, + gen2 + } + } diff --git a/EgwProxy.Shelly.Test/conf/testSetup.json b/EgwProxy.Shelly.Test/conf/testSetup.json index f8be26c..7c468c9 100644 --- a/EgwProxy.Shelly.Test/conf/testSetup.json +++ b/EgwProxy.Shelly.Test/conf/testSetup.json @@ -1,5 +1,6 @@ { - "devAddr": "10.74.81.71", + "devAddr": "10.74.81.73", + "model": "gen2", "steps": [ { "id": "01", diff --git a/EgwProxy.Shelly.Test/conf/testSetup_71.json b/EgwProxy.Shelly.Test/conf/testSetup_71.json new file mode 100644 index 0000000..d82a893 --- /dev/null +++ b/EgwProxy.Shelly.Test/conf/testSetup_71.json @@ -0,0 +1,14 @@ +{ + "devAddr": "10.74.81.71", + "model": "gen1", + "steps": [ + { + "id": "01", + "description": "Test SwitchStatus", + "action": "getSwitchStatus", + "numRep": 5, + "waitTime": 500, + "paramList": [] + } + ] +} \ No newline at end of file diff --git a/EgwProxy.Shelly.Test/conf/testSetup_72.json b/EgwProxy.Shelly.Test/conf/testSetup_72.json new file mode 100644 index 0000000..47a9949 --- /dev/null +++ b/EgwProxy.Shelly.Test/conf/testSetup_72.json @@ -0,0 +1,14 @@ +{ + "devAddr": "10.74.81.72", + "model": "gen1", + "steps": [ + { + "id": "01", + "description": "Test SwitchStatus", + "action": "getSwitchStatus", + "numRep": 5, + "waitTime": 500, + "paramList": [] + } + ] +} \ No newline at end of file diff --git a/EgwProxy.Shelly.Test/conf/testSetup_73.json b/EgwProxy.Shelly.Test/conf/testSetup_73.json new file mode 100644 index 0000000..7c468c9 --- /dev/null +++ b/EgwProxy.Shelly.Test/conf/testSetup_73.json @@ -0,0 +1,14 @@ +{ + "devAddr": "10.74.81.73", + "model": "gen2", + "steps": [ + { + "id": "01", + "description": "Test SwitchStatus", + "action": "getSwitchStatus", + "numRep": 5, + "waitTime": 500, + "paramList": [] + } + ] +} \ No newline at end of file diff --git a/RestTest/Insomnia_Shelly.json b/RestTest/Insomnia_Shelly.json new file mode 100644 index 0000000..e2249e0 --- /dev/null +++ b/RestTest/Insomnia_Shelly.json @@ -0,0 +1 @@ +{"_type":"export","__export_format":4,"__export_date":"2025-08-06T14:41:40.468Z","__export_source":"insomnia.desktop.app:v2023.5.8","resources":[{"_id":"req_d558fe6ade76441a805ec4029cc6ca54","parentId":"wrk_aae73b07b2dd47d6ae6ba7cc5ae7ec94","modified":1738860548174,"created":1738860519995,"url":"http://{{ _.ip }}/shelly","name":"Discover","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/2023.5.8"}],"authentication":{},"metaSortKey":-1738860519995,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"wrk_aae73b07b2dd47d6ae6ba7cc5ae7ec94","parentId":null,"modified":1738860378710,"created":1738860378710,"name":"Shelly","description":"","scope":"collection","_type":"workspace"},{"_id":"req_258a48137a0e40ebb9a9cd8b391fdea5","parentId":"wrk_aae73b07b2dd47d6ae6ba7cc5ae7ec94","modified":1742227619223,"created":1742227611532,"url":"http://{{ _.ip }}/settings","name":"Settings","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/2023.5.8"}],"authentication":{},"metaSortKey":-1738754100849.8633,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_fa72373550eb4c51a29f4da61cc23510","parentId":"wrk_aae73b07b2dd47d6ae6ba7cc5ae7ec94","modified":1742227681964,"created":1742227628642,"url":"http://{{ _.ip }}/status","name":"Status","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/2023.5.8"}],"authentication":{},"metaSortKey":-1738749666718.816,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_c16a79129d2a40c4bdd78d52b57312b9","parentId":"wrk_aae73b07b2dd47d6ae6ba7cc5ae7ec94","modified":1742227662370,"created":1742227647801,"url":"http://{{ _.ip }}/emeter/0","name":"Meter_1","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/2023.5.8"}],"authentication":{},"metaSortKey":-1738745232587.7686,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_20b5bc5d42754c019c957920c6beffe0","parentId":"wrk_aae73b07b2dd47d6ae6ba7cc5ae7ec94","modified":1742227675480,"created":1742227666617,"url":"http://{{ _.ip }}/emeter/1","name":"Meter_2","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/2023.5.8"}],"authentication":{},"metaSortKey":-1738740798456.7212,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_89ad3aa6565a46d2a779bd2b4d1d4592","parentId":"wrk_aae73b07b2dd47d6ae6ba7cc5ae7ec94","modified":1742227672480,"created":1742227670003,"url":"http://{{ _.ip }}/emeter/2","name":"Meter_3","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/2023.5.8"}],"authentication":{},"metaSortKey":-1738738581391.1975,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_99becca20929475db7e9b300861c2c04","parentId":"fld_72e8b7c02bef4d52a0640e059f5b8642","modified":1742227576190,"created":1738863418177,"url":"http://{{ _.ip }}/rpc/Shelly.GetConfig","name":"Shelly.GetConfig","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/2023.5.8"}],"authentication":{},"metaSortKey":-1742227576141,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_72e8b7c02bef4d52a0640e059f5b8642","parentId":"wrk_aae73b07b2dd47d6ae6ba7cc5ae7ec94","modified":1742227558969,"created":1742227556373,"name":"Gen2Dev","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1738718627801.4844,"_type":"request_group"},{"_id":"req_4a4eba7b3a6e4471bad467e571300b38","parentId":"fld_72e8b7c02bef4d52a0640e059f5b8642","modified":1742227578117,"created":1738863484124,"url":"http://{{ _.ip }}/rpc/Shelly.GetDeviceInfo","name":"Shelly.GetDeviceInfo","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/2023.5.8"}],"authentication":{},"metaSortKey":-1742227576041,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_ca119c3914f44799af461bf5b8d5a37e","parentId":"fld_72e8b7c02bef4d52a0640e059f5b8642","modified":1742227579406,"created":1738863705771,"url":"http://{{ _.ip }}/rpc/Shelly.GetComponents","name":"Shelly.GetComponents","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/2023.5.8"}],"authentication":{},"metaSortKey":-1742227575941,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_aad7d6f232e746faa24bb732513ca36d","parentId":"fld_72e8b7c02bef4d52a0640e059f5b8642","modified":1742227589850,"created":1738863228414,"url":"http://{{ _.ip }}/rpc/Shelly.GetStatus","name":"Shelly.GetStatus","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/2023.5.8"}],"authentication":{},"metaSortKey":-1742227575916,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_c3f4698b0bb84f9297bed3ff3239052d","parentId":"fld_72e8b7c02bef4d52a0640e059f5b8642","modified":1742227597923,"created":1738863463611,"url":"http://{{ _.ip }}/rpc/Shelly.ListMethods","name":"Shelly.ListMethods","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/2023.5.8"}],"authentication":{},"metaSortKey":-1742227575909.75,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_73377f27000a40969f6a186696d51147","parentId":"fld_72e8b7c02bef4d52a0640e059f5b8642","modified":1742813449412,"created":1742813373216,"url":"http://{{ _.ip }}/rpc/EM.GetStatus?id=0","name":"EM.GetStatus","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/2023.5.8"}],"authentication":{},"metaSortKey":-1742227575906.625,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_0875d47c7cf541d78a309ffdb9bef06e","parentId":"fld_72e8b7c02bef4d52a0640e059f5b8642","modified":1742813486472,"created":1742813408589,"url":"http://{{ _.ip }}/rpc/EM.GetData?id=0","name":"EM.GetData","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/2023.5.8"}],"authentication":{},"metaSortKey":-1742227575905.0625,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_2331c370884e4815aea40ca3be6756d9","parentId":"fld_72e8b7c02bef4d52a0640e059f5b8642","modified":1742227593222,"created":1738863010150,"url":"http://{{ _.ip }}/rpc/Cloud.GetStatus","name":"CloudStatus","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/2023.5.8"}],"authentication":{},"metaSortKey":-1742227575903.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_5a0d55bda23f4503b423ea5c1026995b","parentId":"fld_72e8b7c02bef4d52a0640e059f5b8642","modified":1742227595032,"created":1738863039171,"url":"http://{{ _.ip }}/rpc/Sys.Getconfig","name":"Sys.GetConfig","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/2023.5.8"}],"authentication":{},"metaSortKey":-1742227575897.25,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_1f1c323b0d8a47d08f404bc93819d21a","parentId":"fld_72e8b7c02bef4d52a0640e059f5b8642","modified":1754491176060,"created":1738861000145,"url":"http://{{ _.ip }}/rpc/Switch.GetStatus?id=0","name":"SwitchStatus","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/2023.5.8"}],"authentication":{},"metaSortKey":-1742227575894.125,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_9fda45d7153c687a604bd19a4dc9f895676ed27d","parentId":"wrk_aae73b07b2dd47d6ae6ba7cc5ae7ec94","modified":1738860461436,"created":1738860378717,"name":"Base Environment","data":{"name":"APC","ip":"10.74.81.71"},"dataPropertyOrder":{"&":["name","ip"]},"color":null,"isPrivate":false,"metaSortKey":1738860378717,"_type":"environment"},{"_id":"jar_9fda45d7153c687a604bd19a4dc9f895676ed27d","parentId":"wrk_aae73b07b2dd47d6ae6ba7cc5ae7ec94","modified":1738860378725,"created":1738860378725,"name":"Default Jar","cookies":[],"_type":"cookie_jar"},{"_id":"env_be93b3e44dd04841a6d91c99e4a60395","parentId":"env_9fda45d7153c687a604bd19a4dc9f895676ed27d","modified":1739353414033,"created":1738860462672,"name":"APC","data":{"name":"APC","ip":"10.74.81.71"},"dataPropertyOrder":{"&":["name","ip"]},"color":null,"isPrivate":false,"metaSortKey":1738860462672,"_type":"environment"},{"_id":"env_8d7d55603ad144108dc672c858acc6f4","parentId":"env_9fda45d7153c687a604bd19a4dc9f895676ed27d","modified":1740048653565,"created":1738860494455,"name":"Caffe","data":{"name":"Caffe","ip":"10.74.81.72"},"dataPropertyOrder":{"&":["name","ip"]},"color":null,"isPrivate":false,"metaSortKey":1738860494455,"_type":"environment"},{"_id":"env_ac861bc289374c0aae8252fff4bcad47","parentId":"env_9fda45d7153c687a604bd19a4dc9f895676ed27d","modified":1740048899056,"created":1740048638005,"name":"3EM 3 fasi","data":{"name":"3EM Ufficio","ip":"10.74.81.73"},"dataPropertyOrder":{"&":["name","ip"]},"color":null,"isPrivate":false,"metaSortKey":1740048638006,"_type":"environment"}]} \ No newline at end of file