Those generators run against the tire sidewall, not the rim. They are much less common than in the past. Here is a higher-quality one - the light would be bought separately.
http://harriscyclery.net/itemdetails.cfm?ID=1580
There are also generators that run centered on the tread of the tire.
Much more rolling resistance than a battery-powered LED headlight (which would have none).
You saw a plastic cover on a valve stem and you don't know what it is but you want one? hmmmmmm
Could it have been a battery-powered light of some sort? Wasn't a valve cap, was it? (Plastic cover that screws on)