diff --git a/esphome/components/ebyte_lora/__init__.py b/esphome/components/ebyte_lora/__init__.py index 06a1cd840b..f0dcfa74b4 100644 --- a/esphome/components/ebyte_lora/__init__.py +++ b/esphome/components/ebyte_lora/__init__.py @@ -5,10 +5,10 @@ from esphome.components import sensor, text_sensor, uart from esphome.const import ( DEVICE_CLASS_SIGNAL_STRENGTH, - UNIT_DECIBEL_MILLIWATT, STATE_CLASS_MEASUREMENT, CONF_ID, ENTITY_CATEGORY_NONE, + UNIT_PERCENT, ) CODEOWNERS = ["@danielkoek"] @@ -43,8 +43,8 @@ CONFIG_SCHEMA = ( # if you want to see the rssi cv.Optional(CONF_LORA_RSSI): sensor.sensor_schema( device_class=DEVICE_CLASS_SIGNAL_STRENGTH, - unit_of_measurement=UNIT_DECIBEL_MILLIWATT, - accuracy_decimals=0, + unit_of_measurement=UNIT_PERCENT, + accuracy_decimals=1, state_class=STATE_CLASS_MEASUREMENT, ), } diff --git a/esphome/components/ebyte_lora/ebyte_lora.cpp b/esphome/components/ebyte_lora/ebyte_lora.cpp index 319dec8ad1..7550638fcf 100644 --- a/esphome/components/ebyte_lora/ebyte_lora.cpp +++ b/esphome/components/ebyte_lora/ebyte_lora.cpp @@ -163,7 +163,7 @@ void EbyteLoraComponent::loop() { ESP_LOGD(TAG, "VALUE: %u ", data[2]); ESP_LOGD(TAG, "RSSI: %#02x ", data[3]); if (this->rssi_sensor_ != nullptr) - this->rssi_sensor_->publish_state(data[3]); + this->rssi_sensor_->publish_state((data[3] / 255.0) * 100); if (this->message_text_sensor_ != nullptr) this->message_text_sensor_->publish_state("Got something");