NOTE: Where I put bedx bedy and bedz in the command needs to be the coordinates of the bed here is an example command:/summon skeleton ~ ~ ~ {SleepingX:70,SleepingY:63,SleepingZ:63}
command:/summon skeleton ~ ~ ~ {SleepingX:bedx,SleepingY:bedy,SleepingZ:bedz}