Is this smoke detector safely connected?
This is a Firex 4618, interconnected smoke alarm with backup battery. Here is the manual which explains Green Light means its operating on A/C (hardwired) power.  Otherwise, its running off the backup battery.  It can run on the backup for several years like a battery operated smoke alarm, but the manual states a standard battery should last for 1 year, then when it drops under voltage it will chirp at you. 

The black wire (hot) can be connected to a black wire up in the box to run on A/C power again.  Often it can pop off especially if someone removed the smoke detector that strained the wires.  Those stranded core wires and cheap wire nuts that come with the smoke detector often don't result in a very strong connection. 

The fix is to first switch off the power.  Hard wired smoke alarms usually share the lighting circuit.  Then you can reconnect the black wire on the pigtail to the black wire in the box.  When you power it back on, there will be a green light like the others.