Use Definitive Door State from Database

The comparision did not state clearly if door is open. If the last two states where exactly the same, it returned wrong statement.