  Given a self-similar $K$ set defined from an iterated function system
$\Gamma=(\gamma_1,\ldots,\gamma_n)$ and a set of function
$H=\{h_i:K\to\mathbb{R}\}_{i=1}^d$ satisfying suitable conditions, we define a
generalized gauge action on Kawjiwara-Watatani algebras $\mathcal{O}_\Gamma$
and their Toeplitz extensions $\mathcal{T}_\Gamma$. We then characterize the
KMS states for this action. For each $\beta\in(0,\infty)$, there is a Ruelle
operator $\mathcal{L}_{H,\beta}$ and the existence of KMS states at inverse
temperature $\beta$ is related to this operator. The critical inverse
temperature $\beta_c$ is such that $\mathcal{L}_{H,\beta_c}$ has spectral
radius 1. If $\beta<\beta_c$, there are no KMS states on $\mathcal{O}_\Gamma$
and $\mathcal{T}_\Gamma$; if $\beta=\beta_c$, there is a unique KMS state on
$\mathcal{O}_\Gamma$ and $\mathcal{T}_\Gamma$ which is given by the
eigenmeasure of $\mathcal{L}_{H,\beta_c}$; and if $\beta>\beta_c$, including
$\beta=\infty$, the extreme points of the set of KMS states on
$\mathcal{T}_\Gamma$ are parametrized by the elements of $K$ and on
$\mathcal{O}_\Gamma$ by the set of branched points.
