Added states to devices
Added automatic state changes when executing a command