Let's say, I have a dataset with $X$ and $Y$ values. $X$ represents the monthly average temperature and $Y$ represents the money spent on utilities. My underlying hypothesis is that the heating energy (and utility bill) will be proportional to the average monthly temperature, but depending upon whether the house has gas or electric heating, the slope, $ ^\circ C$, will be different.
How can I use linear regression to extract out these two slopes? If I just do a simple linear regression with $X$ and $Y$, I will only get a single slope that will represent the average $^\circ C$ between gas and electric heating. If I do a scatter plot, it's quite easy to see distinct linear relations (as shown in figure below), but I am lost in terms of how to extract the two slopes.



If you cannot distinct the two groups then just classify the observations manually, e.g, whenever $y_i/x_i$ larger then some threshold, then it belongs to group $A$, then just estimate $$ y_i = \beta_0 + \beta_1 x_i + \beta_2 D_Ax_i + \epsilon_i, $$ where $D_A$ is the indicator of the $A$th group. The slope of the $A$th group will be $(\beta_1 + \beta_2)$, while for the other group just $\beta_1$.