-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Tibber Meter with SML Parsing and Enhance HttpBridge for Byte Requests #2597
Open
Sn0w3y
wants to merge
68
commits into
OpenEMS:develop
Choose a base branch
from
Sn0w3y:feature/meter-tibber
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,281
−5
Open
Changes from all commits
Commits
Show all changes
68 commits
Select commit
Hold shift + click to select a range
0ab6166
Create update_script.sh
Sn0w3y 197065f
Implement Shelly Plus1PM
Sn0w3y 7fcb40f
Delete io.openems.edge.io.shelly/src/io/openems/edge/io/shelly/shelly…
Sn0w3y c23e44d
Implement Shelly Plus1PM
Sn0w3y adc9091
Merge pull request #1 from Sn0w3y/Sn0w3y-ShellyPlus1PM
Sn0w3y d2430aa
Delete io.openems.edge.io.shelly/src/io/openems/edge/io/shelly/shelly…
Sn0w3y e81f0ea
Merge branch 'OpenEMS:develop' into develop
Sn0w3y c40eba8
Delete io.openems.edge.meter.microcare.sdm630 directory
Sn0w3y 6fdcca5
Changed naming from Microcare to Eastron (#4)
Sn0w3y 4d68320
Samsung ESS (#5)
Sn0w3y ed771d1
Merge branch 'OpenEMS:develop' into develop
Sn0w3y 929cd00
Merge branch 'OpenEMS:develop' into develop
Sn0w3y baab3ad
Add files via upload
Sn0w3y 3de883f
Delete src/io/openems/edge/io/opendtu directory
Sn0w3y 86988f9
openDTU Implementation first commit
Sn0w3y 5bf4eda
Update EdgeApp.bndrun
Sn0w3y 3423a74
Delete bnd.bnd
Sn0w3y 0485674
Delete readme.adoc
Sn0w3y ac0748d
Merge branch 'develop' into feature/openDTU
Sn0w3y 5c971cd
Feature/open dtu (#6)
Sn0w3y f32dbe4
Merge branch 'feature/openDTU' into develop
Sn0w3y d5415ce
Fix Themrmometer add Humidity
Sn0w3y 809a68e
Fix Encoding
Sn0w3y f6b80c9
Fix Encoding
Sn0w3y e9748f6
Update EdgeApp.bndrun
Sn0w3y 759ce96
Update OpendtuImpl.java
Sn0w3y 4433d4b
Merge branch 'OpenEMS:develop' into develop
Sn0w3y 75aecac
Delete io.openems.edge.io.opendtu directory
Sn0w3y 34f1df7
Merge branch 'OpenEMS:develop' into develop
Sn0w3y 7a08785
Merge branch 'OpenEMS:develop' into develop
Sn0w3y 42eb5e5
Merge branch 'OpenEMS:develop' into develop
Sn0w3y 4150530
Merge branch 'OpenEMS:develop' into develop
Sn0w3y 52237f3
Merge branch 'OpenEMS:develop' into develop
Sn0w3y 62b1185
Merge branch 'OpenEMS:develop' into develop
Sn0w3y ed1ba59
Create .gitignore
Sn0w3y f1d03ff
Updates in SamsungESS
Sn0w3y 976d514
Update EdgeApp.bndrun
Sn0w3y fcf6a55
Merge branch 'OpenEMS:develop' into develop
Sn0w3y bf49aa5
Initial Commit
Sn0w3y 2609c22
Update EdgeApp.bndrun
Sn0w3y cc14105
Delete io.openems.edge.meter.tibber/test/.gitignore
Sn0w3y 309673e
Create .gitignore
Sn0w3y add9109
Merge branch 'OpenEMS:develop' into develop
Sn0w3y 780715e
Delete .github/workflows/docker.yml
Sn0w3y 1376317
Update build.yml
Sn0w3y d2c7763
Merge branch 'OpenEMS:develop' into develop
Sn0w3y 26cebce
Merge branch 'OpenEMS:develop' into develop
Sn0w3y 4ce00b7
Merge branch 'OpenEMS:develop' into feature/meter-tibber
Sn0w3y 166cb2c
Merge branch 'OpenEMS:develop' into feature/meter-tibber
Sn0w3y cf86fe4
Merge branch 'OpenEMS:develop' into feature/meter-tibber
Sn0w3y c269d58
Merge branch 'OpenEMS:develop' into feature/meter-tibber
Sn0w3y f4f8885
Updates HttpBridge
Sn0w3y 5c19ae4
Revert "Updates HttpBridge"
Sn0w3y b7957ee
Merge branch 'develop' into feature/meter-tibber
Sn0w3y 5490950
Revert "Merge branch 'develop' into feature/meter-tibber"
Sn0w3y aaf6424
Merge remote-tracking branch 'upstream/develop' into feature/meter-ti…
Sn0w3y 2c63a0b
Updates
Sn0w3y be35a0a
Delete io.openems.edge.meter.tibber/test/.gitignore
Sn0w3y ef58659
Update NetworkEndpointFetcher.java
Sn0w3y d6a7433
Merge branch 'feature/meter-tibber' of https://github.com/Sn0w3y/open…
Sn0w3y cd128f2
Apply prepare-commit.sh
Sn0w3y b3438a0
Fix
Sn0w3y 9beee76
Revert "Fix"
Sn0w3y bbb80a5
Revert "Apply prepare-commit.sh"
Sn0w3y 4f091a8
Reapply "Apply prepare-commit.sh"
Sn0w3y 5578b31
Reapply "Fix"
Sn0w3y 874ed6d
Merge branch 'OpenEMS:develop' into feature/meter-tibber
Sn0w3y 5fdb5c1
Merge branch 'OpenEMS:develop' into feature/meter-tibber
Sn0w3y File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -232,4 +232,12 @@ private static <I, R> CompletableFuture<R> mapFuture(// | |
return future; | ||
} | ||
|
||
/** | ||
* Fetches the url once and returns the raw byte array of the response. | ||
* | ||
* @param endpoint the {@link Endpoint} to fetch | ||
* @return the result response future containing the raw byte array | ||
*/ | ||
CompletableFuture<byte[]> requestRaw(Endpoint endpoint); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wahrscheinlich wäre auch hier besser einen |
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,4 +176,4 @@ private static JsonElement successJson() { | |
.build(); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,4 +69,4 @@ public void testSubscribeTime() throws Exception { | |
assertEquals(3, counter.get()); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="aQute.bnd.classpath.container"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/> | ||
<classpathentry kind="src" output="bin" path="src"/> | ||
<classpathentry kind="src" output="bin_test" path="test"> | ||
<attributes> | ||
<attribute name="test" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/bin_test/ | ||
/generated/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>io.openems.edge.meter.tibber</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>bndtools.core.bndbuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>bndtools.core.bndnature</nature> | ||
</natures> | ||
</projectDescription> |
2 changes: 2 additions & 0 deletions
2
io.openems.edge.meter.tibber/.settings/org.eclipse.core.resources.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
encoding/<project>=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Bundle-Name: OpenEMS Edge Meter Tibber Pulse | ||
Bundle-Vendor: Haller Johannes | ||
Bundle-License: https://opensource.org/licenses/EPL-2.0 | ||
Bundle-Version: 1.0.0.${tstamp} | ||
|
||
-buildpath: \ | ||
${buildpath},\ | ||
bcprov,\ | ||
io.openems.edge.common,\ | ||
io.openems.edge.meter.api,\ | ||
io.openems.edge.timedata.api,\ | ||
io.openems.common,\ | ||
org.openmuc.jsml,\ | ||
org.apache.commons.codec,\ | ||
io.openems.edge.bridge.http,\ | ||
|
||
-testpath: \ | ||
${testpath} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
= Meter Tibber Pulse | ||
|
||
Implementation of a Tibber Pulse as Grid Meter. | ||
|
||
== How to Set Up Pulse: | ||
|
||
|
||
Since the device has no port available in normal mode and all traffic is encrypted,go back to Setup-Mode. This mode can easily be entered by unplugging the device, plug it and repeat this once. As soon as the green LED lights up, the device opens an access point named „Tibber Bridge“. The password is printed on the QR-Code on the device itself. | ||
|
||
This time do not use the tibber app to connect but you Smartphone or Laptop instead. It gets a connection and an IP address assigned from the Tibber Bridge. The Tibber Pulse Bridge itself has the IP 10.133.70.1 and provides a web interface. The credentials are „admin“ and the password printed on the Plug (only can be seen if unplugged). | ||
|
||
Open the IP 10.133.70.1 in a Web-Browser and provide the Credentials User: "admin" and Password: "XX12-X123". | ||
|
||
Search for the key: "webserver_force_enable" and set it to "true". Scroll down to the end of the Page and click "Store params to flash". | ||
|
||
Now again set up the Pulse Bridge with the Tibber App and continue using it. The IP needed is then assigned from your local DHCP-Server. | ||
|
||
Done ! | ||
|
||
https://github.com/OpenEMS/openems/tree/develop/io.openems.edge.meter.tibber[Source Code icon:github[]] |
34 changes: 34 additions & 0 deletions
34
io.openems.edge.meter.tibber/src/io/openems/edge/meter/tibber/pulse/Config.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.openems.edge.meter.tibber.pulse; | ||
|
||
import org.osgi.service.metatype.annotations.AttributeDefinition; | ||
import org.osgi.service.metatype.annotations.AttributeType; | ||
import org.osgi.service.metatype.annotations.ObjectClassDefinition; | ||
|
||
import io.openems.edge.meter.api.MeterType; | ||
|
||
@ObjectClassDefinition(// | ||
name = "Meter Tibber Pulse", // | ||
description = "Implements the Tibber Pulse as Meter") | ||
@interface Config { | ||
|
||
@AttributeDefinition(name = "Component-ID", description = "Unique ID of this Component") | ||
String id() default "meter0"; | ||
|
||
@AttributeDefinition(name = "Alias", description = "Human-readable name of this Component; defaults to Component-ID") | ||
String alias() default ""; | ||
|
||
@AttributeDefinition(name = "Is enabled?", description = "Is this Component enabled?") | ||
boolean enabled() default true; | ||
|
||
@AttributeDefinition(name = "IP", description = "IP of the Tibber bridge.") | ||
String ip() default ""; | ||
|
||
@AttributeDefinition(name = "Password", description = "Password of the Tibber bridge", type = AttributeType.PASSWORD) | ||
String password() default ""; | ||
|
||
@AttributeDefinition(name = "Meter-Type", description = "What is measured by this Meter?") | ||
MeterType type() default MeterType.GRID; | ||
|
||
String webconsole_configurationFactory_nameHint() default "Meter Tibber Pulse [{id}]"; | ||
|
||
} |
65 changes: 65 additions & 0 deletions
65
io.openems.edge.meter.tibber/src/io/openems/edge/meter/tibber/pulse/MeterTibberPulse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package io.openems.edge.meter.tibber.pulse; | ||
|
||
import org.osgi.service.event.EventHandler; | ||
|
||
import io.openems.common.channel.Level; | ||
import io.openems.edge.common.channel.Doc; | ||
import io.openems.edge.common.channel.StateChannel; | ||
import io.openems.edge.common.channel.value.Value; | ||
import io.openems.edge.common.component.OpenemsComponent; | ||
import io.openems.edge.meter.api.ElectricityMeter; | ||
|
||
public interface MeterTibberPulse extends ElectricityMeter, OpenemsComponent, EventHandler { | ||
|
||
public static enum ChannelId implements io.openems.edge.common.channel.ChannelId { | ||
/** | ||
* Slave Communication Failed Fault. | ||
* | ||
* <ul> | ||
* <li>Interface: MeterTibberPulse | ||
* <li>Type: State | ||
* </ul> | ||
*/ | ||
SLAVE_COMMUNICATION_FAILED(Doc.of(Level.FAULT)); // | ||
|
||
private final Doc doc; | ||
|
||
private ChannelId(Doc doc) { | ||
this.doc = doc; | ||
} | ||
|
||
@Override | ||
public Doc doc() { | ||
return this.doc; | ||
} | ||
} | ||
|
||
/** | ||
* Gets the Channel for {@link ChannelId#SLAVE_COMMUNICATION_FAILED}. | ||
* | ||
* @return the Channel | ||
*/ | ||
public default StateChannel getSlaveCommunicationFailedChannel() { | ||
return this.channel(ChannelId.SLAVE_COMMUNICATION_FAILED); | ||
} | ||
|
||
/** | ||
* Gets the Slave Communication Failed State. See | ||
* {@link ChannelId#SLAVE_COMMUNICATION_FAILED}. | ||
* | ||
* @return the Channel {@link Value} | ||
*/ | ||
public default Value<Boolean> getSlaveCommunicationFailed() { | ||
return this.getSlaveCommunicationFailedChannel().value(); | ||
} | ||
|
||
/** | ||
* Internal method to set the 'nextValue' on | ||
* {@link ChannelId#SLAVE_COMMUNICATION_FAILED} Channel. | ||
* | ||
* @param value the next value | ||
*/ | ||
public default void _setSlaveCommunicationFailed(boolean value) { | ||
this.getSlaveCommunicationFailedChannel().setNextValue(value); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kann man die zwei methoden nicht zusammen führen, die sehen ja sehr ähnlich aus