The aim of this appdaemon file is to listen to specific pieces of an MQTT message within MQTT topics and to pass that information to Home Assistant. This came about because Home Assistant does not record the "action_duration" piece of information from an IKEA TRADFRI remote control (E1524/E1810) and simply listening to it by configuring it as a sensor in the Configuration.yaml did not work properly.
This piece of code can be used as an example for using appdaemon within Home Assistant and can be tailored to other needs.