Give the dog more attention & affection. Try talking to & playing with him/her more often, take the dog for more walks if it enjoys them... maybe the dog is feeling neglected. If it is an older dog, he/she might be "grumpy" due to old age aches & pains. If that's the case, see if your vet can prescribe anything to make the dog more comfortable, but NEVER give a dog ANY medication w/o the vet's advice.
Think about what makes u grumpy pain lack of sleep. Changing food brands often can disrupt the digestive system. Maybe one of your appliances is making a noise he dosnt like or you have an unfriendly neighbor