Skip to main content

Custom iot:1 protocol

Project description


My custom protocol for communication between devices at home.
It uses UPD and broadcast.
Messages are json strings.

## Message body:

"protocol": "iot:1",
"node": "Rpi-lcd-1",
"chip_id": "RpiB",
"event": "lcd.content",
"parameters: [
"content": "-(=^.^)"
"response": '',
"targets": [

- protocol: defines name, currently iot:1
- node: friendly node name like light-room-big or screen-one-kitchen
- chip_id: a unique device id
- event: event name like light.on or dispay
- parameters: array of parameters. like rows to display
- response: used when responding to request, ie returning toilet state
- targets: message targets by nde name. special keyword ALL for all nodes in network

## functions

### Message(node, chip_id=None)

Create instance of class. Node is a node name, chip_id if blank will be generated

### prepare_message(data=None)

Returns empty message dictionary. If data is passed it copy values from it.

### decode_message(string)

Decode json string to dict message. Validates protocol and targets.
Return None on failure

Project details

Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
iot_message-0.1.0-py2.py3-none-any.whl (5.2 kB) Copy SHA256 hash SHA256 Wheel 3.4
iot_message-0.1.0.tar.gz (2.9 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page