Skip to content

Commit 33367df

Browse files
publish(dataModel.EnergyStorage): generated files for Electrolyzer, ElectrolizerMeasurement
Date: 2026-06-09 22:51 UTC Generated by publish.py (smart-data-models publication pipeline)
1 parent c665ab6 commit 33367df

20 files changed

Lines changed: 5086 additions & 22 deletions

Electrolyzer/README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[![Smart Data Models](https://smartdatamodels.org/wp-content/uploads/2022/01/SmartDataModels_logo.png "Logo")](https://smartdatamodels.org)
2+
# Electrolyzer
3+
Version: 0.0.1
4+
5+
## Description
6+
7+
A generic electrolyzer which can generate hydrogen from energy
8+
9+
notes appearing in the beginning of the README.md at the root of the data model directory
10+
### Specification
11+
12+
Link to the [interactive specification](https://swagger.lab.fiware.org/?url=https://smart-data-models.github.io/dataModel.EnergyStorage/Electrolyzer/swagger.yaml)
13+
14+
Link to the [specification](https://github.com/smart-data-models/dataModel.EnergyStorage/blob/master/Electrolyzer/doc/spec.md)
15+
16+
Enlace a la [Especificación en español](https://github.com/smart-data-models/dataModel.EnergyStorage/blob/master/Electrolyzer/doc/spec_ES.md)
17+
18+
Lien vers le [spécification en français](https://github.com/smart-data-models/dataModel.EnergyStorage/blob/master/Electrolyzer/doc/spec_FR.md)
19+
20+
Link zur [deutschen Spezifikation](https://github.com/smart-data-models/dataModel.EnergyStorage/blob/master/Electrolyzer/doc/spec_DE.md)
21+
22+
Link alla [specifica](https://github.com/smart-data-models/dataModel.EnergyStorage/blob/master/Electrolyzer/doc/spec_IT.md)
23+
24+
[仕様へのリンク](https://github.com/smart-data-models/dataModel.EnergyStorage/blob/master/Electrolyzer/doc/spec_JA.md)
25+
26+
[链接到规范](https://github.com/smart-data-models/dataModel.EnergyStorage/blob/master/Electrolyzer/doc/spec_ZH.md)
27+
28+
[사양 링크](https://github.com/smart-data-models/dataModel.EnergyStorage/blob/master/Electrolyzer/doc/spec_KO.md)
29+
### Examples
30+
31+
Link to the [example](https://smart-data-models.github.io/dataModel.EnergyStorage/Electrolyzer/examples/example.json) (keyvalues) for NGSI v2
32+
33+
Link to the [example](https://smart-data-models.github.io/dataModel.EnergyStorage/Electrolyzer/examples/example.jsonld) (keyvalues) for NGSI-LD
34+
35+
Link to the [example](https://smart-data-models.github.io/dataModel.EnergyStorage/Electrolyzer/examples/example-normalized.json) (normalized) for NGSI-V2
36+
37+
Link to the [example](https://smart-data-models.github.io/dataModel.EnergyStorage/Electrolyzer/examples/example-normalized.jsonld) (normalized) for NGSI-LD
38+
### Dynamic Examples generation
39+
40+
Link to the [Generator](https://smartdatamodels.org/extra/ngsi-ld_generator.php?schemaUrl=https://raw.githubusercontent.com/smart-data-models/dataModel.EnergyStorage/master/Electrolyzer/schema.json&email=info@smartdatamodels.org) of NGSI-LD normalized payloads compliant with this data model. Refresh for new values
41+
42+
Link to the [Generator](https://smartdatamodels.org/extra/ngsi-ld_generator_keyvalues.php?schemaUrl=https://raw.githubusercontent.com/smart-data-models/dataModel.EnergyStorage/master/Electrolyzer/schema.json&email=info@smartdatamodels.org) of NGSI-LD keyvalues payloads compliant with this data model. Refresh for new values
43+
44+
Link to the [Generator](https://smartdatamodels.org/extra/geojson_features_generator.php?schemaUrl=https://raw.githubusercontent.com/smart-data-models/dataModel.EnergyStorage/master/Electrolyzer/schema.json&email=info@smartdatamodels.org) of geojson feature format payloads compliant with this data model. Refresh for new values
45+
### PostgreSQL schema
46+
### Contribution
47+
48+
If you have any issue on this data model you can raise an [issue](https://github.com/smart-data-models/dataModel.EnergyStorage/issues) or contribute with a [PR](https://github.com/smart-data-models/dataModel.EnergyStorage/pulls)
49+
50+
If you wish to develop your own data model you can start from [contribution manual](https://bit.ly/contribution_manual). Several services have been developed to help with:
51+
- [Test data model repository](https://smartdatamodels.org/index.php/data-models-contribution-api/) including the schema and example payloads, etc
52+
- [Generate PostgreSQL schema](https://smartdatamodels.org/index.php/sql-service/) to help create a table, create type, etc

Electrolyzer/code/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Electrolyzer
2+
3+
### List of code samples
4+
5+
<!-- 50-List of code -->
6+
7+
<!-- [code entry](link) -->
8+
[code_for_using_dataModel.EnergyStorage_Electrolyzer.py](https://github.com/smart-data-models/dataModel.EnergyStorage/blob/master/Electrolyzer/code/code_for_using_dataModel.EnergyStorage_Electrolyzer.py)
9+
10+
<!-- /50-List of code -->
11+
12+
### Contribution
13+
You can raise an [issue](https://github.com/smart-data-models/dataModel.EnergyStorage/issues) or submit your [PR](https://github.com/smart-data-models/dataModel.EnergyStorage/pulls) on existing data models
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# This code allows you to install a orion-ld broker in a linux system
2+
# The manuals are here https://github.com/FIWARE/context.Orion-LD/tree/develop/doc/manuals-ld
3+
#
4+
# INSTALL NGSI LD broker (OrionLD)
5+
# sudo docker pull mongo:3.6
6+
# sudo docker pull fiware/orion-ld
7+
# sudo docker network create fiware_default
8+
# sudo docker run -d --name=mongo-db --network=fiware_default --expose=27017 mongo:3.6 --bind_ip_all --smallfiles
9+
# sudo docker run -d --name fiware-orionld -h orion --network=fiware_default -p 1026:1026 fiware/orion-ld -dbhost mongo-db
10+
#
11+
# TO RELAUNCH (only if you have already installed a broker in the same machine)
12+
# sudo docker stop fiware-orionld
13+
# sudo docker rm fiware-orionld
14+
# sudo docker stop mongo-db
15+
# sudo docker rm mongo-db
16+
# sudo docker network rm fiware_default
17+
#
18+
# CHECK INSTANCES
19+
# curl -X GET 'http://localhost:1026/version'
20+
# curl -X GET http://localhost:1026/ngsi-ld/v1/entities?local=true&limit=1000
21+
#
22+
# now the python code you can use to insert some value in the context broker
23+
24+
from pysmartdatamodels import pysmartdatamodels as sdm
25+
import subprocess
26+
import requests
27+
import sys
28+
29+
print("Searching broker...")
30+
serverUrl = None
31+
for _url in ["http://localhost:1026", "https://localhost:1026"]:
32+
try:
33+
if requests.get(f"{_url}/version", timeout=5).status_code == 200:
34+
serverUrl = _url
35+
print(f"Broker found at {serverUrl}")
36+
break
37+
except Exception:
38+
pass
39+
if serverUrl is None:
40+
serverUrl = input(
41+
"No broker found at default locations. Enter broker URL (or press Enter to abort): "
42+
).strip()
43+
if serverUrl:
44+
try:
45+
if requests.get(f"{serverUrl}/version", timeout=5).status_code != 200:
46+
print("WARNING: Cannot connect to broker. Script cannot provide results.")
47+
sys.exit(1)
48+
except Exception:
49+
print("WARNING: Cannot connect to broker. Script cannot provide results.")
50+
sys.exit(1)
51+
else:
52+
print("WARNING: No broker URL provided. Script cannot provide results.")
53+
sys.exit(1)
54+
55+
dataModel = "Electrolyzer"
56+
subject = "dataModel.EnergyStorage"
57+
58+
status = "ON"
59+
attribute = "status"
60+
value = status
61+
# Updates the attribute in the broker; creates the entity if it does not exist
62+
print(sdm.update_broker(dataModel, subject, attribute, value, serverUrl=serverUrl, updateThenCreate=True))
63+
64+
maxPowerConsumed = 3000
65+
attribute = "maxPowerConsumed"
66+
value = maxPowerConsumed
67+
# Updates the attribute in the broker; creates the entity if it does not exist
68+
print(sdm.update_broker(dataModel, subject, attribute, value, serverUrl=serverUrl, updateThenCreate=True))
69+
70+
maxHydrogenFlowGenerated = 600
71+
attribute = "maxHydrogenFlowGenerated"
72+
value = maxHydrogenFlowGenerated
73+
# Updates the attribute in the broker; creates the entity if it does not exist
74+
print(sdm.update_broker(dataModel, subject, attribute, value, serverUrl=serverUrl, updateThenCreate=True))
75+
76+
print("In case you have installed the orion-ld broker (see header comments)")
77+
print("Execute this to check the entity was inserted:")
78+
command = ['curl', '-X', 'GET', 'http://localhost:1026/ngsi-ld/v1/entities?local=true&limit=1000']
79+
result = subprocess.run(command, capture_output=True, text=True)
80+
print(result.stdout)

0 commit comments

Comments
 (0)