The state House and Senate are locked in a tug of war over short-term rentals — think, Airbnb-type businesses — and how they should be taxed and regulated.

A compromise is now being worked on to reconcile conflicting House and Senate versions of a bill that addresses the issue, which has roiled the commonwealth ever since online platforms like Airbnb, HomeAway and VRBO turned spare rooms into a cottage industry.

The House version (H.4314) would impose taxes ranging from 4 percent to 8 percent based on how many units a host offers and requires the Department of Revenue to maintain a short-term rental registry. Cities and towns would have the option to impose local excise taxes and to conduct a safety inspection on units being listed on the newly created registry.

House Speaker Robert DeLeo said, “For the first time in Massachusetts, we go beyond taxation and implement a necessary regulatory framework to ensure public safety and accountability.”

Subsequently, the state Senate scrapped the House’s three-tiered tax rates, simply extending the existing lodging tax of 5.7 percent to short-term rentals, and leaves regulations such as registration, licensing or inspection up to municipalities.

The bill levels the playing field between currently untaxed and unregulated short-term rentals and the hotels, motels and bed & breakfasts that are regulated and taxed. State Sen. Stanley Rosenberg, D-Amherst, supports the Senate bill (S.2381).

Rosenberg told the Daily Hampshire Gazette earlier this year that the issue is one of fairness, because “Airbnbs are actually competing now with hotels and motels.”

Regulations add credibility to the industry, and Airbnbs “want reasonable regulation,” he added.

According to Airbnb, the number of hosts in Hampshire County is estimated to have grown from 220 in 2016 to 280 in 2017. Many of those hosts are located in Northampton, which grew from 120 to about 150 during that period.

Statewide, there were some 144,000 Airbnb hosts in 2017, up from an estimated 112,000 in 2016.

To the good, both the House and Senate versions ensure that short-term rentals will henceforth be taxed by the state. The compromise will determine what that tax rate will be. This will generate millions of dollars in new revenue for the state and for local municipalities that impose their own taxes.

Also to the good is a data-sharing amendment in the Senate version that would give communities access to information like the total number of days a house or apartment is being rented and the location of each short-term rental.

It’s telling who supports the different versions: Airbnb has called the House bill “onerous and overly burdensome” and applauded the Senate bill, while the Massachusetts Lodging Association charged that the Senate “capitulated to Airbnb by failing to produce even the most basic of health, safety and consumer protections.”

It may be hard to believe, but older, substandard housing without two exits does exist and a fire blocking the only exit is a recipe for tragedy that is the stuff of nightmares for firefighters. House fires, food safety and sanitation issues are the pitfalls of unregulated short-term housing. This nascent industry is one tragedy away from even more stringent regulation.

We believe that Airbnb and similar online services should supply local communities with enough data so they can establish a registry of residents hosting short-term rentals and perform inspections as needed to certify that they comply with building and health codes.

The compromise version governing short-term rentals in Massachusetts needs to enhance transparency so that even the smallest towns can easily locate and inspect short-term rental offerings to ensure consumer safety and, yes, to verify the tax rolls.