diff --git a/esphome/components/number/automation.cpp b/esphome/components/number/automation.cpp index 78ffc255fe..a3d49a6ff6 100644 --- a/esphome/components/number/automation.cpp +++ b/esphome/components/number/automation.cpp @@ -14,8 +14,7 @@ void ValueRangeTrigger::setup() { float local_min = this->min_.value(0.0); float local_max = this->max_.value(0.0); convert hash = {.from = (local_max - local_min)}; - uint32_t myhash = hash.to ^ this->parent_->get_preference_hash(); - this->rtc_ = global_preferences->make_preference(myhash); + this->rtc_ = this->parent_->make_entity_preference(hash.to); bool initial_state; if (this->rtc_.load(&initial_state)) { this->previous_in_range_ = initial_state;