Closed chicco785 closed 2 years ago
@casarf when done with milestone 0.2 jump on this task and help @Solargi
we have decided that the group of street lights on street 1 will be part of a single sensor id, and the lights on street 2 will be part of another single sensor id since we want to control all the lights on a particular street at once.
instead of passing the topic as variable, let's compose it inside the code following fiware protocol
a topic will be formed by:
protocol
(share across multiple sensors)service_api_key
(share across multiple sensors of the same time, e.g. streetlights)sensor_id
(different for each sensor)a topic to read/write sensor values will be as follow:
/<protocol>/<service_api_key>/<sensor_id>/attrs
i.e. supposed that the protocol is
json
, the service api key is4jggokgpepnvsb2uv4s40d59ov
and the sensor isurn:streetlight:001
:/json/4jggokgpepnvsb2uv4s40d59ov/urn:streetlight:001/attrs
a message to update attributes is a json payload serialized as a string that maps attribute names to values:
e.g.:
i.e., updating the sensor values will be a mqtt command as:
a topic to receive commands will be as follow:
/<protocol>/<service_api_key>/<sensor_id>/cmd
i.e. supposed that the protocol is
json
, the service api key is4jggokgpepnvsb2uv4s40d59ov
and the sensor isurn:streetlight:001
:/json/4jggokgpepnvsb2uv4s40d59ov/urn:streetlight:001/cmd
a message to receive command is a json payload serialized as a string that maps command names to passed parameters and their values:
e.g.
last, but not least, once a sensor receive a commands and execute it, it should confirm the execution (or report error) on the topic:
/<protocol>/<service_api_key>/<sensor_id>/cmdexe
i.e. supposed that the protocol is
json
, the service api key is4jggokgpepnvsb2uv4s40d59ov
and the sensor isurn:streetlight:001
:/json/4jggokgpepnvsb2uv4s40d59ov/urn:streetlight:001/cmdexe
the message to be sent is a json payload serialized as a string that maps attribute names to values:
e.g.