Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
naiades-platform-poc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
naiades
naiades-platform-poc
Commits
ba7a170b
Commit
ba7a170b
authored
Sep 22, 2020
by
Federico Sismondi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated() FlowerBed entity model regarding last discussions for Carouge DCA
parent
82425f51
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
dca-carouge-watering/app.py
dca-carouge-watering/app.py
+3
-3
scripts-admin/create_entities.py
scripts-admin/create_entities.py
+7
-4
scripts/historic_02_api_query.sh
scripts/historic_02_api_query.sh
+1
-1
No files found.
dca-carouge-watering/app.py
View file @
ba7a170b
...
...
@@ -156,9 +156,9 @@ def _forward_lora_devs_metadata_to_ctx_broker(dev_eui, entity_id, location, oper
app
.
logger
.
info
(
"Initializing IoT sensor meta (entity {})"
.
format
(
entity_id
))
url
=
"{}/v2/entities/{}/attrs"
.
format
(
URL_BASE
,
entity_id
)
payload
=
{
'boxId'
:
{
'value'
:
entity_id
.
split
(
'-'
)[
-
1
]},
'
moistureDeviceEui
'
:
{
'value'
:
dev_eui
},
'boxOperatorComment'
:
{
'value'
:
operator_comment
},
#
'boxId': {'value': entity_id.split('-')[-1]},
'
refDevice
'
:
{
'value'
:
dev_eui
},
#
'boxOperatorComment': {'value': operator_comment},
'location'
:
{
'type'
:
'geo:json'
,
'value'
:
{
'coordinates'
:
location
,
'type'
:
'Point'
}},
}
...
...
scripts-admin/create_entities.py
View file @
ba7a170b
...
...
@@ -72,10 +72,7 @@ extra_args = {
'nextWateringDeadline'
:
datetime
.
fromtimestamp
(
0
),
'nextWateringAmountRecommendation'
:
datetime
.
fromtimestamp
(
0
),
'soilMoisture'
:
0.0
,
'moistureDeviceEui'
:
None
,
'boxId'
:
None
,
'boxSize'
:
None
,
'boxOperatorComment'
:
''
,
'refDevice'
:
None
,
}
}
...
...
@@ -137,9 +134,15 @@ for urn, pilots in entities:
**
{
attr_n
:
get_ngsiv2_typed_description
(
attr_v
)
for
attr_n
,
attr_v
in
extra_args
[
data_type
]
.
items
()}
})
except
KeyError
:
raise
KeyError
(
'Unrecognized pilot {}'
.
format
(
pilot
))
# for _, ents in entities_map.items():
# pprint(ents, indent=4)
#import sys
#sys.exit(0)
# create entities in IoT platform
print
(
'Updating/creating entities'
)
...
...
scripts/historic_02_api_query.sh
View file @
ba7a170b
...
...
@@ -4,7 +4,7 @@
echo
"Querying QuantumLeap API at:
${
QUANTUM_HOST
}
"
curl
--location
--request
GET
\
"http://
$QUANTUM_HOST
:8668/v2/entities/urn:ngsi-ld:FlowerBed:FlowerBed-1/attrs/soilMoisture/value?l
imit
=100"
\
"http://
$QUANTUM_HOST
:8668/v2/entities/urn:ngsi-ld:FlowerBed:FlowerBed-1/attrs/soilMoisture/value?l
astN
=100"
\
--header
"Fiware-Service: carouge"
\
--header
"Fiware-ServicePath: /"
\
--header
"Accept: application/json"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment