I'd like to set the feedname based on the device name and use the same code for multiple units. This way I don't need to have a separate code base for each unit.
Example:
3 Units - Inside, Outside, and Garage
Measuring Temperature
Feed Name:
Code: Select all
Adafruit_MQTT_Publish Temperature = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "/feeds/[UNIT_NAME].temp");
Assuming I can easily uniquely self-identify each unit (Particle Photon with system.DeviceID), how can I get this in the MQTT Publish?
Is it acceptable to move the Publish routine from the start of the code into the setup() section?
Thanks!