Publishing messages with commands to target sensors