A python client to fetch/receive and parse uplink messages from The Things Network
It is used primarily for the home-assistant integration but it should also work independently - check the testcases.
For this library to work, the TheThingNetwork storage plugin is required. You might also check the home assistant prerequisites as they also apply when this library is used standalone.
A payload decoded needs to be present so that you have a decoded_payload in the uplink message. By default, this library expects the decoded_payload to have a key-value format such as:
"decoded_payload": {
"accelerometer_77": {
"x": 1, # Sensor will be called accelerometer_77_x
"y": 0.5, # Sensor will be called accelerometer_77_y
"z": 9.8 # Sensor will be called accelerometer_77_z
},
"voltage": 3.1, # Sensor will be called voltage and be of type float
"boolean_1": true, # Binary Sensor will be called boolean_1
"digital_in_1": 8, # Sensor will be called voltage and be of type int
"gps_34": { # Device Tracker will be called gps_34
"latitude": 48.76826575,
"longitude": 9.1596689,
"altitude": 310
}
}If you have a device using a different format, please open an Issue and post a copy of full message for your device.
This library uses tox so just install it and run tox
This package structure and pipeline is derived from the zwave-js-server-python package.