Smart thermostats and home energy management systems (HEMSs) are generally studied separately. However, their joint use can provide a greater benefit. Therefore, this study primarily aims to combine a smart thermostat with a HEMS. The mixed-integer linear programming (MILP)-based HEMS performs day-ahead load scheduling for cost-minimization and provides optimal demand response (DR) and photovoltaic (PV) self-consumption, and the fuzzy logic-based thermostat aims efficient DR of air-conditioning and maintenance of thermal comfort. In the first stage, unlike conventional fixed set-point thermostats, the proposed thermostat defines different setpoints for each time interval, by fuzzifying input parameters of electricity prices, solar radiation, and occupant presence, to be used by HEMS. In the second stage, the HEMS schedules the operation of time-shiftable, thermostatically controlled, and power-shiftable (battery energy storage system (BESS), electric vehicle (EV)) loads. The HEMS considers bi-directional power flow between home, BESS, EV, and grid, as well as battery degradation to avoid unnecessary energy arbitrage. The simulation results show that a daily cost reduction of 53.2 % is achieved under time-of-use (TOU) and feed-in tariff rates of Turkey. AC cost is reduced by 24 % compared to conventional thermostats. In a future scenario of real-time pricing (RTP) and dynamic feed-in tariff, vehicle-to-grid (V2G) becomes possible.