{"id":26105310,"url":"https://github.com/arasgungore/eebus-in-java","last_synced_at":"2025-04-12T18:26:13.124Z","repository":{"id":219894932,"uuid":"750170154","full_name":"arasgungore/EEBUS-in-Java","owner":"arasgungore","description":"Java implementation of the EEBUS protocol suite which provides support for the SHIP and SPINE protocols.","archived":false,"fork":false,"pushed_at":"2024-01-30T10:48:28.000Z","size":70,"stargazers_count":8,"open_issues_count":1,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-26T12:46:47.505Z","etag":null,"topics":["charging-stations","communication-layer","communication-protocol","data-exchange","discovery","eebus","electric-vehicles","emobility","energy-management","energy-management-system","energy-management-systems","gateway","java","network-programming","network-protocol","pairing","protocols","ship","spine","tcp-ip"],"latest_commit_sha":null,"homepage":"https://enbility.net","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arasgungore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-30T05:44:55.000Z","updated_at":"2024-12-13T15:28:39.000Z","dependencies_parsed_at":"2024-06-21T07:29:27.602Z","dependency_job_id":"1f0d2ed7-05f6-4420-92f8-b04caf3012d3","html_url":"https://github.com/arasgungore/EEBUS-in-Java","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"5e1dda2eb423f05e8d8bf49e182409ab7e86ffd2"},"previous_names":["arasgungore/eebus-in-java"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arasgungore%2FEEBUS-in-Java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arasgungore%2FEEBUS-in-Java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arasgungore%2FEEBUS-in-Java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arasgungore%2FEEBUS-in-Java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arasgungore","download_url":"https://codeload.github.com/arasgungore/EEBUS-in-Java/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248611885,"owners_count":21133194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["charging-stations","communication-layer","communication-protocol","data-exchange","discovery","eebus","electric-vehicles","emobility","energy-management","energy-management-system","energy-management-systems","gateway","java","network-programming","network-protocol","pairing","protocols","ship","spine","tcp-ip"],"created_at":"2025-03-09T21:05:05.539Z","updated_at":"2025-04-12T18:26:13.072Z","avatar_url":"https://github.com/arasgungore.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EEBUS-in-Java\n\n![EEBUS Logo](https://github.com/arasgungore/EEBUS-in-Java/blob/main/assets/eebus_logo.png)\n\nJava implementation of the EEBUS protocol suite which provides support for the SHIP and SPINE protocols. The EEBUS protocols facilitate efficient communication among smart home IoT devices, allowing seamless integration regardless of device brand or type. This open-source framework aims to offer a future-proof solution applicable to various environments and applications.\n\n\n\n## Table of Contents\n\n- [Prerequisites](#prerequisites)\n- [Getting Started](#getting-started)\n- [Usage](#usage)\n- [License](#license)\n- [Acknowledgements](#acknowledgements)\n- [Author](#author)\n\n\n\n## Prerequisites\n\nBefore you begin, ensure you have the following requirements installed on your machine:\n\n- [Java](https://www.java.com/)\n- [Maven](https://maven.apache.org/) for building and managing dependencies\n\n\n\n## Getting Started\n\nTo start using the project, follow these steps:\n\n1. Build the project using Maven:\n\n   ```bash\n   mvn clean install\n   ```\n\n2. Run the main driver code or utilize the provided classes for your application.\n\n\n\n## Usage\n\n### General Usage\n\nThe framework can be utilized as follows:\n\n```java\n// Importing the framework\nimport eebus \"github.com/LMF-DHBW/go-eebus\"\n\n// Configure EEBUS node\neebusNode = eebus.NewEebusNode(\"100.90.1.102\", true, \"gateway\", \"0001\", \"DHBW\", \"Gateway\");\n\n// IP-Adr, is gateway, ssl cert name, device ID, brand name, device type\neebusNode.Update = update; // set method called on subscription updates\n\n// Function that creates device structure\nbuildDeviceModel(eebusNode);\n\n// Start node\neebusNode.Start();\n```\n\n\n### Creating Device Structure\n\nThe device structure for an EEBUS node can be created as follows:\n\n```java\neebusNode.DeviceStructure.DeviceType = \"Generic\";\neebusNode.DeviceStructure.DeviceAddress = \"Switch1\";\neebusNode.DeviceStructure.Entities = Arrays.asList(\n    new resources.EntityModel(\n        \"Switch\",\n        0,\n        Arrays.asList(\n            eebusNode.DeviceStructure.createNodeManagement(false),\n            new resources.FeatureModel(\n                \"ActuatorSwitch\",\n                1,\n                \"client\",\n                resources.ActuatorSwitch(\"button\", \"button for leds\"),\n                Arrays.asList(\"ActuatorSwitch\")\n            )\n        )\n    )\n);\n\n// Create node management again, in order to update discovery data\neebusNode.DeviceStructure.Entities.get(0).getFeatures().set(0, eebusNode.DeviceStructure.createNodeManagement(false));\n```\n\n\n### Accepting Requests from Gateway\n\nRequests from the gateway can be accepted as follows:\n\n```java\n// Requests are saved in the following list\neebusNode.SpineNode.ShipNode.Requests;\n\nint i = 0; // Select the first entry as an example\n\n// Accept request by connecting with the device\nRequest req = eebusNode.SpineNode.ShipNode.Requests.get(i);\nnew Thread(() -\u003e eebusNode.SpineNode.ShipNode.connect(req.getPath(), req.getSki())).start();\n\n// Remove request from list\neebusNode.SpineNode.ShipNode.Requests.remove(i);\n```\n\n\n### Reading Subscription Messages\n\n```java\npublic void update(resources.DatagramType data, spine.SpineConnection conn) {\n    int entitySource = data.getHeader().getAddressSource().getEntity();\n    int featureSource = data.getHeader().getAddressSource().getFeature();\n\n    if (conn.DiscoveryInformation.FeatureInformation.get(featureSource).getDescription().getFeatureType().equals(\"Measurement\")) {\n        resources.MeasurementDataType Function = JAXB.unmarshal(new StringReader(data.getPayload().getCmd().getFunction()), resources.MeasurementDataType.class);\n        // Function.getValue() contains measured value\n    }\n}\n```\n\n\n### Reading Feature States\n\n```java\nfor (spine.SpineConnection e : eebusNode.SpineNode.Connections) {\n    for (resources.FeatureInformation feature : e.SubscriptionData) {\n        if (\"ActuatorSwitch\".equals(feature.getFeatureType()) \u0026\u0026 \"LED\".equals(feature.getEntityType())) {\n            resources.FunctionElement state = JAXB.unmarshal(new StringReader(feature.getCurrentState()), resources.FunctionElement.class);\n            // state.getFunction() contains the state (on/off)\n        }\n    }\n}\n```\n\n\n### Sending Subscription Messages\n\n```java\nfor (spine.SpineConnection e : eebusNode.SpineNode.Subscriptions) {\n    e.send(\"notify\", resources.makePayload(\"actuatorSwitchData\",\n            new resources.FunctionElement(\"on\")));\n}\n```\n\n\n### Sending Binding Messages\n\n```java\nfor (spine.SpineConnection e : eebusNode.SpineNode.Bindings) {\n    e.send(\"write\", resources.makePayload(\"actuatorSwitchData\",\n            new resources.FunctionElement(\"toggle\")));\n}\n```\n\nFeel free to adjust these examples to fit your specific use case.\n\n\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n\n\n## Acknowledgements\n\nThis Java implementation is inspired by the Go-based EEBUS communication framework [go_eebus](https://github.com/LMF-DHBW/go_eebus).\n\n\n\n## Author\n\n👤 **Aras Güngöre**\n\n- LinkedIn: [@arasgungore](https://www.linkedin.com/in/arasgungore)\n- GitHub: [@arasgungore](https://github.com/arasgungore)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farasgungore%2Feebus-in-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farasgungore%2Feebus-in-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farasgungore%2Feebus-in-java/lists"}