I am looking forward using the MQTT persistence service. I am currently running Apache Apollo 1.2 for some tests, and would like to use the Apollo broker as MQTT server.
Has anyone already tried to connect to Apollo or can anyone help how the openhab.cfg file would look like?
Based on the example Xively example in the Wiki, I am not sure how to set up the ocnfiguration.
the instructions are the same no matter what broker you are using.
The MQTT Persistence addon depends on the MQTT Binding. So make sure both are installed.
Then configure the connection to the broker following the instructions for the MQTT Binding:
This is where you define the port, host, clientID, username, password, LWT, etc parameters for connecting OH to the Broker.
Then you just define the three parameters needed for the MQTT Persistence addon, broker (name matches the mqtt:broker parameter defined in the MQTT Binding), what topic to post the persistence data to, and the format of the messages that get posted using the $ notation defined on the wiki page.
NOTE: In OH 1.x these configuration parameters go in configurations/openhab.cfg. For OH 2.0 the MQTT parameters go in services/mqtt.cfg and the MQTT persistence parameters go in services/mqtt-persistence.cfg with the “mqtt:” and “mqtt-persistence:” removed from the parameter names.
Finally, you need to create a .persist file that dictates which Items get persisted and how (e.g. everyChange, everyMinute, etc).