NEnvoy 0.3.0-alpha
See the version list below for details.
dotnet add package NEnvoy --version 0.3.0-alpha
NuGet\Install-Package NEnvoy -Version 0.3.0-alpha
<PackageReference Include="NEnvoy" Version="0.3.0-alpha" />
paket add NEnvoy --version 0.3.0-alpha
#r "nuget: NEnvoy, 0.3.0-alpha"
// Install NEnvoy as a Cake Addin #addin nuget:?package=NEnvoy&version=0.3.0-alpha&prerelease // Install NEnvoy as a Cake Tool #tool nuget:?package=NEnvoy&version=0.3.0-alpha&prerelease
NEnvoy
A .Net Enphase Envoy client available as a NuGet package.
Currently a work in progress. The list of currently implemented (and not yet implemented) items can be found here.
Quickstart
// Create client and login (assumes "envoy" hostname)
var ci = new EnvoyConnectionInfo
{
Username = "user@gmail.com",
Password = "sup3rs3cet",
};
var client = await EnvoyClient.FromLoginAsync(ci).ConfigureAwait(false);
// Get information from Envoy
var deviceinfo = await client.GetEnvoyInfoAsync();
Sessions
A login can be slow; once a session has been set up (logged in successfully) you can obtain sessioninfo with the GetSessionInfo()
method. The information in the returned SessionInfo
object can then be stored where you want. Next time, the session can be 'resumed' (assuming it hasn't expired) as follows:
var session = new SessionInfo { Token = "eyJ...iJ9", Id = "i9O...p5Q" };
var client = EnvoyClient.FromSession(session);
// or, if you don't want to use the default "envoy" hostname:
var client = EnvoyClient.FromSession(session, "envoy.local");
// or:
var client = EnvoyClient.FromSession(session, "192.168.123.45");
Sessions can be stored in your appsettings.json
, secrets.json
or wherever you want. We provide a few conveniencemethods that save and load sessions to and from a file or stream:
Static methods on EnvoyClient:
// Save to and load from file:
Task SaveSessionAsync(path, sessionInfo, jsonSerializerOptions, cancellationToken);
Task<SessionInfo> LoadSessionAsync(path, jsonSerializerOptions, cancellationToken);
// Save to and load from stream:
Task SaveSessionAsync(stream, sessionInfo, jsonSerializerOptions, cancellationToken);
Task<SessionInfo> LoadSessionAsync(stream, jsonSerializerOptions, cancellationToken);
// Instance methods on EnvoyClient:
Task SaveSessionAsync(path, jsonSerializerOptions, cancellationToken);
Task SaveSessionAsync(stream, jsonSerializerOptions, cancellationToken);
If you'd rather store session information in another way, you can get the session info by calling GetSessionInfo()
.
Connection
You can specify a different hostname or IP address for your Envoy:
var ci = new ConnectionInfo("user@gmail.com", "sup3rs3cet", "envoy.local");
// or:
var ci = new ConnectionInfo("user@gmail.com", "sup3rs3cet", "192.168.123.45");
Similarly, the base URI's for the enphase portal can be overridden:
var ci = new ConnectionInfo("user@gmail.com", "sup3rs3cet", EnphaseBaseUri: "https://enlighten-new.enphaseenergy.com");
// or:
var ci = new ConnectionInfo("user@gmail.com", "sup3rs3cet", EnphaseEntrezBaseUri: "https://entrez-new.enphaseenergy.com");
Contributing
Yes please! Implement any of the methods and make a PR and we'll take it from there.
License
Licensed under MIT license. See LICENSE for details.
Icon made by Payungkead from www.flaticon.com is licensed by CC 3.0.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
- Refit.Xml (>= 6.3.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.3.2-alpha | 79 | 3/7/2024 |
0.3.1-alpha | 115 | 6/2/2023 |
0.3.0-alpha | 90 | 6/2/2023 |
0.2.5-alpha | 89 | 5/30/2023 |
0.2.4-alpha | 79 | 5/30/2023 |
0.2.3-alpha | 83 | 5/22/2023 |
0.2.2-alpha | 80 | 5/22/2023 |
0.2.1-alpha | 80 | 5/22/2023 |
0.2.0-alpha | 84 | 5/22/2023 |
0.1.2-alpha | 77 | 5/17/2023 |
0.1.1-alpha | 76 | 5/17/2023 |
0.1.0-alpha | 78 | 5/16/2023 |