Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Enhanced Samsung AC Integration: Energy Sensors & Optimizations 🚀 #208

Merged
merged 9 commits into from
Oct 28, 2024

Conversation

omerfaruk-aran
Copy link
Owner

Summary

This PR introduces significant enhancements to the Samsung AC ESPHome component with a focus on energy monitoring, memory optimizations, and improvements to the overall performance of the integration. With these updates, the integration is now more aligned with Home Assistant's preferred energy dashboard, making it easier to track and analyze energy usage.

What's New ✨

1. New Energy Sensors Added ⚡

We've added new energy-related sensors to the integration to give users a comprehensive view of their HVAC system's energy consumption. These sensors can now be seamlessly integrated into Home Assistant’s energy dashboard, allowing for detailed tracking and analysis of energy usage.

  • Outdoor Instantaneous Power Sensor: Measures the current power consumption of the outdoor HVAC components in Watts.
  • Outdoor Cumulative Energy Sensor: Calculates the total energy consumed over time in kWh.
  • Outdoor Current Sensor: Monitors the current drawn by the outdoor unit in Amperes.
  • Outdoor Voltage Sensor: Tracks the voltage supplied to the outdoor unit in Volts.

By leveraging these sensors, users can easily monitor their energy consumption trends and ensure efficient operation of their HVAC system.

2. Energy Dashboard Compatibility 📊

All new energy sensors are fully compatible with Home Assistant's Energy Dashboard. This compatibility enables users to:

  • Track energy consumption in real-time using Home Assistant’s intuitive graphs and charts.
  • Analyze historical energy data and gain insights into the HVAC system’s efficiency.
  • Detect potential issues with irregular voltage or current draw, ensuring the safety and stability of the system.

3. Optimizations & Memory Management Improvements 💡

This PR includes critical optimizations to the integration’s codebase, focusing on:

  • Efficient Memory Utilization: We streamlined the memory allocation strategy, reducing overall memory footprint and enhancing performance.
  • Consolidated Sensor Update Functions: Refactored the sensor update methods into a single generic function, reducing redundant code and improving maintainability.
  • Improved Error Handling: Enhanced error detection and recovery mechanisms to provide more robust performance under varying network conditions.
  • Refined Data Processing: Simplified the data processing flow to reduce latency and ensure that data updates are timely and accurate.

Detailed Changelog 📝

  • Added: New sensors for tracking outdoor instantaneous power, cumulative energy, current, and voltage.
  • Enhanced: Sensor compatibility with Home Assistant's Energy Dashboard.
  • Optimized: Memory usage and reduced redundant code for improved efficiency.
  • Improved: Error handling logic and recovery from unexpected conditions.
  • Refactored: Sensor update functions into a single streamlined method.

How to Set Up ⚙️

  1. Add the Samsung AC component to your ESPHome configuration.
  2. Define the outdoor unit address and specify the newly added energy sensors in your YAML configuration.
  3. Set up the Home Assistant Energy Dashboard to include these sensors for comprehensive energy monitoring.

Example configuration:

- address: "10.00.00"

     outdoor_instantaneous_power:
        name: "Outdoor Instantaneous Power"

      outdoor_cumulative_energy:
        name: "Outdoor Cumulative Energy"

      outdoor_current:
        name: "Outdoor Current"

      outdoor_voltage:
        name: "Outdoor Voltage"

Conclusion

With these updates, the Samsung AC integration is more powerful and efficient than ever before. We are confident that these new features and optimizations will significantly enhance the user experience and provide valuable insights into energy consumption.

Thank you for your continued support and contributions!


@omerfaruk-aran omerfaruk-aran merged commit 4b8b418 into omerfaruk-aran:main Oct 28, 2024
@Jkirjo
Copy link

Jkirjo commented Oct 28, 2024

How i can get this enhancement to work? Editing only yaml file won't work, these additions are invalid. Obviously it needs something else too.

@omerfaruk-aran
Copy link
Owner Author

To get this enhancement working, please follow these steps:

  1. YAML Configuration Update: If you have previously defined custom sensors for energy readings, please ensure they are commented out or removed from your current YAML configuration to avoid conflicts. This enhancement introduces new sensors directly under the outdoor unit address.
# Example updated configuration
    - address: "10.00.00"
        outdoor_instantaneous_power:
          name: "Outdoor Instantaneous Power"

        outdoor_cumulative_energy:
          name: "Outdoor Cumulative Energy"

        outdoor_current:
          name: "Outdoor Current"

        outdoor_voltage:
          name: "Outdoor Voltage"
  1. Verify external_components Source: Ensure that your YAML file includes the updated source reference. The enhancement is part of the latest version of the repository under the following source:
external_components:
  - source: github://omerfaruk-aran/esphome_samsung_hvac_bus@main
  1. Configuration Deployment: Once you've made the necessary changes to the YAML configuration, redeploy the updated configuration to your ESP device using ESPHome's deployment command or through the Home Assistant interface.

By following these steps, the new energy sensors defined under the outdoor unit address should be active and provide accurate energy readings without conflict from previously defined custom sensors. If you continue to encounter issues, double-check that the old sensor definitions are fully removed or commented out.

Let me know if you need further assistance! 😊

@Jkirjo
Copy link

Jkirjo commented Oct 28, 2024

Thanks, but indentation is wrong in this exsample. In your example.yaml it is correct. Checked from there and now it is working. Excellent.

@omerfaruk-aran
Copy link
Owner Author

I’m glad you solved the issue! There was a small typo, but it’s great that you double-checked and found the problem. Happy to hear it worked out!

@omerfaruk-aran omerfaruk-aran linked an issue Oct 29, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[NASA] Power Consumption
2 participants