Skip to content

Conversation

@briadelour
Copy link
Contributor

@briadelour briadelour commented Jan 12, 2026

Description

This PR adds support for the SolarEdge home automation devices API endpoint, enabling retrieval of smart home device information including EV chargers, batteries, and other connected devices.

Changes

  • Added async_get_home_automation_devices() method to retrieve home automation device information
  • Endpoint: https://monitoring.solaredge.com/services/api/homeautomation/v1.0/sites/{site_id}/devices
  • Implemented session state initialization by visiting the Smart Home page before API calls
  • Added _smart_home_visited flag to track session state and avoid redundant page visits
  • Includes proper error handling and logging

Implementation Details

The home automation API requires specific session state to be established before it will return device data. The implementation:

  1. Logs in to obtain session cookies (existing functionality)
  2. Visits the Smart Home page URL to establish proper session context
  3. Calls the devices API endpoint, which now succeeds with the initialized session
  4. Returns the complete device information including device types, status, features, and configuration

This approach mirrors how the SolarEdge web interface itself accesses the API.

Testing

Successfully tested with my SolarEdge installation:

Test Environment:

  • Site ID: xxxxxxx
  • Equipment: 33 pieces of solar equipment
  • Home Automation Devices: 1 EV Charger

Copy link
Collaborator

@tronikos tronikos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the pre-commit findings?

@briadelour briadelour requested a review from tronikos January 13, 2026 00:22
@tronikos tronikos merged commit 73e21ec into Solarlibs:main Jan 13, 2026
2 checks passed
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.

2 participants