diff --git a/README.md b/README.md index 2f8e9e5..f047478 100644 --- a/README.md +++ b/README.md @@ -168,20 +168,20 @@ The following settings exist: - `mac_address` - The MAC address of your Victron device. - `bindkey` - The AES encryption key of your Victron device. - [Automation Triggers](https://esphome.io/guides/automations.html): - - `on_message` - When any message is recieved. - - `on_battery_monitor_message` - When a battery monitor message is recieved. - - `on_solar_charger_message` - When a solar charger message is recieved. - - `on_inverter_message` - When a inverter message is recieved. - - `on_dcdc_converter_message` - When a DC/DC converter message is recieved. - - `on_smart_lithium_message` - When a smart Lithium message is recieved. - - `on_inverter_rs_message` - When a Inverter RS message is recieved. - - `on_ac_charger_message` - When a AC Charger message is recieved. - - `on_smart_battery_protect_message` - When a Smart Battery Protect message is recieved. - - `on_lynx_smart_bms_message` - When a Lynx (Smart BMS) message is recieved. - - `on_multi_rs_message` - When a Multi RS message is recieved. - - `on_ve_bus_message` - When a VE.Bus message is recieved. - - `on_dc_energy_meter_message` - When a DC Energy meter message is recieved. - - `on_orion_xs_message` - When a Orion XS message is recieved. + - `on_message` - When any message is received. + - `on_battery_monitor_message` - When a battery monitor message is received. + - `on_solar_charger_message` - When a solar charger message is received. + - `on_inverter_message` - When a inverter message is received. + - `on_dcdc_converter_message` - When a DC/DC converter message is received. + - `on_smart_lithium_message` - When a smart Lithium message is received. + - `on_inverter_rs_message` - When a Inverter RS message is received. + - `on_ac_charger_message` - When a AC Charger message is received. + - `on_smart_battery_protect_message` - When a Smart Battery Protect message is received. + - `on_lynx_smart_bms_message` - When a Lynx (Smart BMS) message is received. + - `on_multi_rs_message` - When a Multi RS message is received. + - `on_ve_bus_message` - When a VE.Bus message is received. + - `on_dc_energy_meter_message` - When a DC Energy meter message is received. + - `on_orion_xs_message` - When a Orion XS message is received. ### Sensor diff --git a/components/victron_ble/victron_ble.cpp b/components/victron_ble/victron_ble.cpp index 217ab97..7ec05b2 100644 --- a/components/victron_ble/victron_ble.cpp +++ b/components/victron_ble/victron_ble.cpp @@ -24,7 +24,7 @@ void VictronBle::update() { } switch (this->last_package_.record_type) { case VICTRON_BLE_RECORD_TYPE::SOLAR_CHARGER: - ESP_LOGD(TAG, "[%s] Recieved SOLAR_CHARGER message.", this->address_str().c_str()); + ESP_LOGD(TAG, "[%s] Received SOLAR_CHARGER message.", this->address_str().c_str()); if (this->on_solar_charger_message_callback_.size() > 0) { this->defer("VictronBle1", [this]() { this->on_solar_charger_message_callback_.call(&this->last_package_.data.solar_charger); @@ -32,7 +32,7 @@ void VictronBle::update() { } break; case VICTRON_BLE_RECORD_TYPE::BATTERY_MONITOR: - ESP_LOGD(TAG, "[%s] Recieved BATTERY_MONITOR message.", this->address_str().c_str()); + ESP_LOGD(TAG, "[%s] Received BATTERY_MONITOR message.", this->address_str().c_str()); if (this->on_battery_monitor_message_callback_.size() > 0) { this->defer("VictronBle2", [this]() { this->on_battery_monitor_message_callback_.call(&this->last_package_.data.battery_monitor); @@ -40,7 +40,7 @@ void VictronBle::update() { } break; case VICTRON_BLE_RECORD_TYPE::INVERTER: - ESP_LOGD(TAG, "[%s] Recieved INVERTER message.", this->address_str().c_str()); + ESP_LOGD(TAG, "[%s] Received INVERTER message.", this->address_str().c_str()); if (this->on_inverter_message_callback_.size() > 0) { this->defer("VictronBle3", [this]() { this->on_inverter_message_callback_.call(&this->last_package_.data.inverter); }); @@ -48,7 +48,7 @@ void VictronBle::update() { break; case VICTRON_BLE_RECORD_TYPE::DCDC_CONVERTER: - ESP_LOGD(TAG, "[%s] Recieved DCDC_CONVERTER message.", this->address_str().c_str()); + ESP_LOGD(TAG, "[%s] Received DCDC_CONVERTER message.", this->address_str().c_str()); if (this->on_dcdc_converter_message_callback_.size() > 0) { this->defer("VictronBle4", [this]() { this->on_dcdc_converter_message_callback_.call(&this->last_package_.data.dcdc_converter); @@ -56,7 +56,7 @@ void VictronBle::update() { } break; case VICTRON_BLE_RECORD_TYPE::SMART_LITHIUM: - ESP_LOGD(TAG, "[%s] Recieved SMART_LITHIUM message.", this->address_str().c_str()); + ESP_LOGD(TAG, "[%s] Received SMART_LITHIUM message.", this->address_str().c_str()); if (this->on_smart_lithium_message_callback_.size() > 0) { this->defer("VictronBle5", [this]() { this->on_smart_lithium_message_callback_.call(&this->last_package_.data.smart_lithium); @@ -64,21 +64,21 @@ void VictronBle::update() { } break; case VICTRON_BLE_RECORD_TYPE::INVERTER_RS: - ESP_LOGD(TAG, "[%s] Recieved INVERTER_RS message.", this->address_str().c_str()); + ESP_LOGD(TAG, "[%s] Received INVERTER_RS message.", this->address_str().c_str()); if (this->on_inverter_rs_message_callback_.size() > 0) { this->defer("VictronBle6", [this]() { this->on_inverter_rs_message_callback_.call(&this->last_package_.data.inverter_rs); }); } break; case VICTRON_BLE_RECORD_TYPE::AC_CHARGER: - ESP_LOGD(TAG, "[%s] Recieved AC_CHARGER message.", this->address_str().c_str()); + ESP_LOGD(TAG, "[%s] Received AC_CHARGER message.", this->address_str().c_str()); if (this->on_ac_charger_message_callback_.size() > 0) { this->defer("VictronBle8", [this]() { this->on_ac_charger_message_callback_.call(&this->last_package_.data.ac_charger); }); } break; case VICTRON_BLE_RECORD_TYPE::SMART_BATTERY_PROTECT: - ESP_LOGD(TAG, "[%s] Recieved SMART_BATTERY_PROTECT message.", this->address_str().c_str()); + ESP_LOGD(TAG, "[%s] Received SMART_BATTERY_PROTECT message.", this->address_str().c_str()); if (this->on_smart_battery_protect_message_callback_.size() > 0) { this->defer("VictronBle9", [this]() { this->on_smart_battery_protect_message_callback_.call(&this->last_package_.data.smart_battery_protect); @@ -86,7 +86,7 @@ void VictronBle::update() { } break; case VICTRON_BLE_RECORD_TYPE::LYNX_SMART_BMS: - ESP_LOGD(TAG, "[%s] Recieved LYNX_SMART_BMS message.", this->address_str().c_str()); + ESP_LOGD(TAG, "[%s] Received LYNX_SMART_BMS message.", this->address_str().c_str()); if (this->on_lynx_smart_bms_message_callback_.size() > 0) { this->defer("VictronBleA", [this]() { this->on_lynx_smart_bms_message_callback_.call(&this->last_package_.data.lynx_smart_bms); @@ -94,21 +94,21 @@ void VictronBle::update() { } break; case VICTRON_BLE_RECORD_TYPE::MULTI_RS: - ESP_LOGD(TAG, "[%s] Recieved MULTI_RS message.", this->address_str().c_str()); + ESP_LOGD(TAG, "[%s] Received MULTI_RS message.", this->address_str().c_str()); if (this->on_multi_rs_message_callback_.size() > 0) { this->defer("VictronBleB", [this]() { this->on_multi_rs_message_callback_.call(&this->last_package_.data.multi_rs); }); } break; case VICTRON_BLE_RECORD_TYPE::VE_BUS: - ESP_LOGD(TAG, "[%s] Recieved VE_BUS message.", this->address_str().c_str()); + ESP_LOGD(TAG, "[%s] Received VE_BUS message.", this->address_str().c_str()); if (this->on_ve_bus_message_callback_.size() > 0) { this->defer("VictronBleC", [this]() { this->on_ve_bus_message_callback_.call(&this->last_package_.data.ve_bus); }); } break; case VICTRON_BLE_RECORD_TYPE::DC_ENERGY_METER: - ESP_LOGD(TAG, "[%s] Recieved DC_ENERGY_METER message.", this->address_str().c_str()); + ESP_LOGD(TAG, "[%s] Received DC_ENERGY_METER message.", this->address_str().c_str()); if (this->on_dc_energy_meter_message_callback_.size() > 0) { this->defer("VictronBleD", [this]() { this->on_dc_energy_meter_message_callback_.call(&this->last_package_.data.dc_energy_meter); @@ -116,7 +116,7 @@ void VictronBle::update() { } break; case VICTRON_BLE_RECORD_TYPE::ORION_XS: - ESP_LOGD(TAG, "[%s] Recieved ORION_XS message.", this->address_str().c_str()); + ESP_LOGD(TAG, "[%s] Received ORION_XS message.", this->address_str().c_str()); if (this->on_orion_xs_message_callback_.size() > 0) { this->defer("VictronBleF", [this]() { this->on_orion_xs_message_callback_.call(&this->last_package_.data.orion_xs); }); @@ -192,7 +192,7 @@ bool VictronBle::parse_device(const esp32_ble_tracker::ESPBTDevice &device) { this->handle_record_(victron_data->record_type, encrypted_data); - // Save the last recieved data counter + // Save the last received data counter this->last_package_.data_counter = victron_data->data_counter_lsb | (victron_data->data_counter_msb << 8); return true; } diff --git a/components/victron_ble_connect/victron_ble_connect.cpp b/components/victron_ble_connect/victron_ble_connect.cpp index 49c82b6..8ef8cec 100644 --- a/components/victron_ble_connect/victron_ble_connect.cpp +++ b/components/victron_ble_connect/victron_ble_connect.cpp @@ -316,7 +316,7 @@ void VictronBleConnect::read_value_(const uint16_t handle, const uint8_t *value, } } } else { - ESP_LOGW(TAG, "[%s] Error recieved data with unknown handle for service %s handle 0x%04x", this->get_name().c_str(), + ESP_LOGW(TAG, "[%s] Error received data with unknown handle for service %s handle 0x%04x", this->get_name().c_str(), SERVICE_UUID.to_string().c_str(), handle); } } @@ -342,7 +342,7 @@ void VictronBleConnect::update_sensors_() { this->state_of_charge_->publish_state(static_cast(this->value_state_of_charge_) / 100.0f); } else { this->state_of_charge_->publish_state(NAN); - ESP_LOGW(TAG, "[%s] Recieved no or invalid data for State of Charge.", this->get_name().c_str()); + ESP_LOGW(TAG, "[%s] Received no or invalid data for State of Charge.", this->get_name().c_str()); } } @@ -351,7 +351,7 @@ void VictronBleConnect::update_sensors_() { this->voltage_->publish_state(static_cast(this->value_voltage_) / 100.0f); } else { this->voltage_->publish_state(NAN); - ESP_LOGW(TAG, "[%s] Recieved no or invalid data for Voltage.", this->get_name().c_str()); + ESP_LOGW(TAG, "[%s] Received no or invalid data for Voltage.", this->get_name().c_str()); } } @@ -360,7 +360,7 @@ void VictronBleConnect::update_sensors_() { this->power_->publish_state(static_cast(this->value_power_)); } else { this->power_->publish_state(NAN); - ESP_LOGW(TAG, "[%s] Recieved no or invalid data for Power consumption.", this->get_name().c_str()); + ESP_LOGW(TAG, "[%s] Received no or invalid data for Power consumption.", this->get_name().c_str()); } } @@ -369,7 +369,7 @@ void VictronBleConnect::update_sensors_() { this->current_->publish_state(static_cast(this->value_current_) / 1000.0f); } else { this->current_->publish_state(NAN); - ESP_LOGW(TAG, "[%s] Recieved no or invalid data for Current.", this->get_name().c_str()); + ESP_LOGW(TAG, "[%s] Received no or invalid data for Current.", this->get_name().c_str()); } } @@ -378,7 +378,7 @@ void VictronBleConnect::update_sensors_() { this->ah_->publish_state(static_cast(this->value_ah_) / 10.0f); } else { this->ah_->publish_state(NAN); - ESP_LOGW(TAG, "[%s] Recieved no or invalid data for Consumed Ah.", this->get_name().c_str()); + ESP_LOGW(TAG, "[%s] Received no or invalid data for Consumed Ah.", this->get_name().c_str()); } } @@ -387,7 +387,7 @@ void VictronBleConnect::update_sensors_() { this->starter_battery_voltage_->publish_state(static_cast(this->value_starter_battery_voltage_) / 100.0f); } else { this->starter_battery_voltage_->publish_state(NAN); - ESP_LOGW(TAG, "[%s] Recieved no or invalid data for Starter Battery Voltage.", this->get_name().c_str()); + ESP_LOGW(TAG, "[%s] Received no or invalid data for Starter Battery Voltage.", this->get_name().c_str()); } } @@ -396,7 +396,7 @@ void VictronBleConnect::update_sensors_() { this->val2_->publish_state(static_cast(this->value_val2_)); } else { this->val2_->publish_state(NAN); - ESP_LOGW(TAG, "[%s] Recieved no or invalid data for Val2.", this->get_name().c_str()); + ESP_LOGW(TAG, "[%s] Received no or invalid data for Val2.", this->get_name().c_str()); } } @@ -405,7 +405,7 @@ void VictronBleConnect::update_sensors_() { this->val3_->publish_state(static_cast(this->value_val3_)); } else { this->val3_->publish_state(NAN); - ESP_LOGW(TAG, "[%s] Recieved no or invalid data for Val3.", this->get_name().c_str()); + ESP_LOGW(TAG, "[%s] Received no or invalid data for Val3.", this->get_name().c_str()); } } @@ -414,7 +414,7 @@ void VictronBleConnect::update_sensors_() { this->val4_->publish_state(static_cast(this->value_val4_)); } else { this->val4_->publish_state(NAN); - ESP_LOGW(TAG, "[%s] Recieved no or invalid data for Val4.", this->get_name().c_str()); + ESP_LOGW(TAG, "[%s] Received no or invalid data for Val4.", this->get_name().c_str()); } } @@ -423,7 +423,7 @@ void VictronBleConnect::update_sensors_() { this->remaining_time_->publish_state(static_cast(this->value_remaining_time_)); } else { this->remaining_time_->publish_state(NAN); - ESP_LOGW(TAG, "[%s] Recieved no or invalid data for Remaining Time.", this->get_name().c_str()); + ESP_LOGW(TAG, "[%s] Received no or invalid data for Remaining Time.", this->get_name().c_str()); } } }