Do feelings have a purpose? A car has dashboard lights, like "check engine" to indicate malfunctions, etc. Do human feelings have some similar, meaningful function (x produces feeling y), or are feelings just random glitches of cognition?

I can think of feelings that are easy to define:


pain, localized to the injury site as serving a purpose: do not use
the injured limb until it feels healed.
Heartburn may be a feeling associated with eating incorrect types of
foods: stop chewing gum and the feeling goes away.
Feeling heat/cold has a purpose that may be connected to metabolism
and thermoregulation.
Feeling of hunger is relieved by eating


For example, the feeling of hunger can be explained by the balance of hormones of leptin and ghrelin, which control appetite and the feeling of satiety. 

But what about those other feelings, defined by abstract words from dictionaries? Jealous, silly, disgusted,motivated,comfortable, etc, etc. Here's a list of human feelings. One can imagine what they are, but to catch oneself in one of them is a completely different thing. I'm interested if feeling in some way has a purpose. Can we say something about the hormone/neurotransmitter levels based on how a person is feeling?
To me the question is equivalent to what is the function of consciousness itself.

Let me elaborate. There is a difference between affects/emotional circuits and feelings. The level at which for eg. Jaak Panksepp works is emotional circuits or affects that are primarily unconscious and can be conceived of in terms of instincts.

If fear circuit is activated, the organism exhibits a flight-fight-freeze response. Conscious feeling of fear may or may not be involved, but physiological changes like activation of sympathetic system happens. If the unconscious fear circuit is OK to keep us out of harm's way (predators) why do we also need to feel fearful? A related meta question is, if a zombie behaving like me, but having no qualia, can and will succeed similar to me, why have consciousness?

I'll address the questions, but first let me solidify the claim that unconscious processes are sufficient for most adaptive regulations. Consider your example of heat/cold as thermo-regulation of body temperature...but do you really need to 'feel' heat/cold for that. Consider when you are sound asleep- you still unconsciously cover with blanket or throw away blanket depending on how sweaty/ cold you are- you dont need to consciously register that. So thermo-regulation, like other adaptive actions of affects, can happen in absence of accompanying felt feelings. 

So what is the purpose of consciousness/feelings? They provide flexibility to behavior and  leave it to us whether we want to indulge in adaptive hardwired behavior or do differently. Taking our cold/heat analogy, instead of wiring our thermo-regulation behavior entirely, feelings provide us a way to keep remaining cold, despite feeling cold.

Similarly, consciousness/'free wont' gives the ability to suppress prepotent (adaptive in short term) response in favor of our long term view or values. By way of another example, if all we had was an unconscious fear circuit, we would always run when confronted with large challenges that are insurmountable; but when the conscious feeling of fear comes into play, although we may feel sacred as hell when confronted with larger opponents, we can still act bravely and with integrity- and that may be far adaptive in the longer run.   

So the short answer is that conscious feelings like jealousy etc. exist so that we can act contra to that feeling if we wished to do so and are not doomed to always act as per what the feeling dictates!