The sensors (I have 2 at the moment) update around once per second and thepublish rate cannot be changed.
The gateway publishes sensor updates to a mosquito server.
I control the mosquito server and it runs on the same system as my Indigo server.
The MQTT messages look like:
- Code: Select all
ruuvi/EC:2E:89:E4:21:C7 {
"gw_mac": "FC:E7:EA:35:6C:32",
"rssi": -14,
"aoa": [],
"gwts": "1700598017",
"ts": "1700598017",
"data": "0201061BFF990405124E4BB2BF880020FFD803E4BE56AC31B0EC2E89E421C7",
"coords": ""
}
- Code: Select all
{'data_format': 5, 'humidity': 47.6, 'temperature': 23.38, 'pressure': 988.5, 'acceleration': 1008.7140328160405, 'acceleration_x': 32, 'acceleration_y': -92, 'acceleration_z': 1004, 'tx_power': 4, 'battery': 3192, 'movement_counter': 119, 'measurement_sequence_number': 7458, 'mac': 'ec2e89e421c7'}
- Code: Select all
from ruuvi_decoders import Df5Decoder
decoder = Df5Decoder()
data = MQTT_Data
data = data.split("FF9904")[1]
sensor = decoder.decode_data(data)
print(sensor)
I know I can grab the data key and save it to an Indigo variable and then create a trigger to process the variable and save the encoded keys into other Indigo variables. But, that is not very elegant and doesn't end up with a pseudo device (I.e., one Indigo object), which is what I would prefer. Also, I would like to control the update rate, at least in Indigo (I cannot change the publishing rate in the Ruuvi gateway). Once a minute, or even once every 5 minutes would be fine.
I am open to ideas.
TIA