A smart thermostat can turn on the heat in your home before you go to sleep. A smart speaker can play music. From across the room, a smart lightbulb can be turned on or off.

Smart- home devices are not just about convenience. Some of them can help keep your home safe and secure, so they could earn you a discount on your homeowners insurance.

Discounts for smart-home devices

Most insurance companies offer discounts to homeowners with smart- home devices designed to prevent water damage, fire or theft. In our research, we found that homeowners insurance discounts can be as high as 13% depending on the device and where you live.

Water leak sensors, security cameras and smoke detectors were the smart devices that were most often eligible for discounts. Insurers like Farmers and Amica offer discounts for smart locks and motion sensors.

If you already own a smart- home device, ask your carrier if you are eligible for a discount.

Insurers have partnerships with smart- home technology companies to make the devices more affordable or even provide them for free. State Farm policyholders in most states can sign up for three years of free service. A plug-in that monitors your home for electrical problems can cause fires.

Hippo gives free smart home-monitoring kits from partners such as SimpliSafe to eligible states. The policyholder can save up to 13% on their homeowners insurance if they install the devices and keep them active.

Nationwide offers nearly 50% off the purchase of Notion smart sensors, while Amica can save when buying select smart- home devices. Once you install the devices, the companies will give you insurance discounts.

I'm putting a solar array on my home. I found out about the technology, storage and cost.

MarketWatch on Multiple devices
Why insurance companies reward smart-home devices

Insurance companies offer discounts for smart- home devices because the technology can help prevent expensive claims.

If you have a smart water sensor next to your water heater, it could cause a leak. The device could sound an alarm and send an alert to your phone. Some devices have an automatic water shut-off feature.

If you don't have the sensor, you could end up filing a claim, paying a big deductible and having contractors clean up the mess in your basement. You wouldn't need to make a claim if the damage is limited by the sensor.

The best experience is one where there is no claim.

Are you sharing a password? Not for a while.

Should you buy smart-home devices?

The cost of technology can add up quickly. Karen Collins, assistant vice president of personal lines at the American Property Casualty Insurance Association, says that if you want to invest in a protective device but aren't sure which ones are worth the money, consider your home's unique risks.

If your home has old plumbing, water sensors might be worth buying. If you live in a neighborhood with high crime rates, your money might be better spent on a home security system.

Water damage is the most common claim that smart- home devices can help prevent. It's possible to keep small claims from turning into big ones by putting sensors in the bathroom.

If the devices you are considering would qualify you for a homeowners insurance discount, ask your insurer. Depending on the amount of the discount and the cost of the devices, they might pay for themselves within a few years.

Is it time for retirees to look at reverse mortgages?

The benefits of smart- home technology can go beyond insurance savings.

NerdWallet has more.

Sarah Schlichter is a writer. Sschlichter@nerdwallet.com is the email address.