If the state_topic can receive payloads meant for more than one sensor, you should consider implementing Strategy #2 described in the following topic: