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

βœ… Outdoor Temperature and Energy Consumption - Home Assistant Sensor #215

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

omerfaruk-aran
Copy link
Owner

@omerfaruk-aran omerfaruk-aran commented Oct 30, 2024

πŸ“„ Description

What does this Pull Request do?

  • 🐞 Bug Fix
  • ✨ New Feature
  • πŸ”¨ Code Improvement

This PR adds outdoor temperature and energy sensors to enhance the Samsung HVAC system's integration with ESPHome. Additionally, significant code optimizations were performed to improve performance and maintainability.

✨ Key Changes

  1. Added Outdoor Temperature sensor to track the temperature reported by the outdoor unit.
  2. Implemented energy sensors including:
    • Outdoor Instantaneous Power sensor to monitor power usage in real-time.
    • Outdoor Cumulative Energy sensor to track total energy consumption.
  3. Optimized bitmask handling with descriptive constants for improved readability and maintainability.
  4. Refactored code to minimize memory usage and enhance performance.

πŸ”— Related Issues

Fixes: #214, #108
Related: discussions


βœ… Checklist

Please ensure the following before submitting your PR:

  • Code compiles without errors πŸ§‘β€πŸ’»
  • All tests pass successfully βœ…
  • Changes have been tested on relevant devices πŸ› οΈ
  • Documentation has been updated (if necessary) πŸ“–
  • This PR is ready for review πŸ”

🌐 Environment Information

πŸ”’ Versions

  • ESPHome Version: 2024.10.2
  • Home Assistant Version: 2024.10.4

🧩 Devices

  • Air Conditioner Type:
    • NASA
    • NON-NASA
    • Other
  • Air Conditioner Model:
  • Outdoor Unit Model:
  • ESP Device Model: (M5STACK ATOM Lite + M5STACK RS-485)
  • Wiring Configuration: (F1/F2)

πŸ§ͺ Test Plan

How were these changes tested?

  1. Tested the outdoor temperature sensor on both NASA and Non-NASA devices to verify accurate readings.
  2. Monitored system logs for any errors or unexpected behavior after code optimizations.

πŸ” Logs

  • ESPHome Logs: Verified sensor initialization and values.
  • Home Assistant Logs: Confirmed data synchronization and display.

πŸ› οΈ YAML Configuration

    - address: "10.00.00" # Outdoor device address as the following components are dependent on an outdoor unit.
    
      # This sensor captures and monitors specific error codes returned by the HVAC system.
      # When an error occurs, the sensor detects the error code and updates its value accordingly.
      # Additionally, by using the blueprint available at https://github.com/omerfaruk-aran/esphome_samsung_ac_blueprint,
      # you can automatically send detailed error messages to your mobile devices based on the captured error codes.
      error_code:
        name: error_code

      #[NASA or NonNASA]  
      outdoor_temperature: # Should be used with outdoor device address
        name: "Outdoor temperature"

      # [NASA or NonNASA] This sensor measures the instantaneous power consumption of the outdoor unit in Watts.
      # The captured value represents the current power draw of the outdoor HVAC components, helping track energy usage patterns.
      outdoor_instantaneous_power:
        name: "Outdoor Instantaneous Power"

      # [NASA or NonNASA] This sensor records the cumulative energy consumption of the outdoor unit in kWh.
      # It calculates the total energy consumed over time, allowing users to monitor and analyze energy efficiency.
      outdoor_cumulative_energy:
        name: "Outdoor Cumulative Energy"

      # [NASA or NonNASA] This sensor measures the current drawn by the outdoor unit in Amperes.
      # Monitoring current values helps identify electrical irregularities and ensure safe power levels in the system.
      outdoor_current:
        name: "Outdoor Current"

      # [NASA or NonNASA] This sensor tracks the voltage supplied to the outdoor unit in Volts.
      # Consistent voltage readings indicate stable power delivery, while deviations can help detect electrical issues in the system.
      outdoor_voltage:
        name: "Outdoor Voltage"

@omerfaruk-aran omerfaruk-aran added the enhancement New feature or request label Oct 30, 2024
@omerfaruk-aran omerfaruk-aran self-assigned this Oct 30, 2024
@omerfaruk-aran omerfaruk-aran marked this pull request as draft October 31, 2024 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[NonNASA] Outdoor Temperature and Energy Consumption - Home Assistant Sensor Request
1 participant