He received an imperial edict to make a tour of inspection around the empire, but unfortunately while on this mission drowned at sea. The Tang emperor Taizong gave him a posthumous official post, with responsibility for patrolling the world on his behalf, and also commanded that temples to make offerings to Wen Wang-yeh be set up throughout the land.
傳說溫王爺本來是唐朝進士，奉聖旨巡行天下時，不幸遭逢海難而亡，被貞觀皇帝追封「代天巡狩」，並頒旨全國建廟奉祀。