With the increasing penetration of distributed renewable energy generation and dynamic electricity pricing schemes, applications for residential demand side management are becoming more appealing. In this work, we present an optimal control model for studying the economic and grid interaction benefits of smart charging of electric vehicles (EV), vehicle-to-grid, and space heating load control for residential houses with on-site photovoltaics (PV). A case study is conducted on 1-10 net zero energy houses with detailed empirical data, resulting in 8-33% yearly electricity cost savings per household with various electric vehicle and space heating system combinations. The self-consumption of PV is also significantly increased. Additional benefits through increasing the number of cooperating households are minor and saturate already at around 3-5 households. Permitting electricity transfer between the houses and EV charging stations at workplaces increases self-sufficiency significantly, but it provides limited economic benefit. The additional cost savings from vehicle-to-grid compared to smart charging are minor due to increased battery degradation, despite a significant self-sufficiency increase. If the optimization is conducted without taking the battery degradation cost into account, the added monetary value of vehicle-to-grid can even be negative due to the unmanaged degradation. Neglecting battery degradation completely leads to overestimation of the vehicle-to-grid cost benefit.