You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b7ebfa9
Browse filesBrowse the repository at this point in the historyBrowse files
Priority Balancer notifications now filtered by car owner presence at home.
Only sends notifications when configured person entity state is "home".
Features:
- Added car_owner person entity selector in config flow (required field)
- Priority Balancer notifications check presence before sending
- Smart Blocker and Night Charge notifications always sent (critical)
- Backward compatible with fail-safe defaults
- Comprehensive debug logging for troubleshooting
Technical Implementation:
- New CONF_CAR_OWNER constant in const.py
- Person entity selector in both initial setup and options flow
- MobileNotificationService._is_car_owner_home() method
- All three components pass car owner to notification service
- Updated strings.json with user-friendly descriptions
Files Modified:
- const.py: Added CONF_CAR_OWNER constant, updated VERSION to 1.3.19
- manifest.json: Updated version to 1.3.19
- config_flow.py: Added person entity selector (required)
- strings.json: Added car_owner field with descriptions
- utils/mobile_notification_service.py: Presence check logic
- priority_balancer.py: Pass car owner entity
- automations.py: Pass car owner entity
- night_smart_charge.py: Pass car owner entity
- CLAUDE.md: Comprehensive documentation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+89-1Lines changed: 89 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
7
7
This is a **Home Assistant custom integration** for intelligent EV charging control. It manages EV charger automation based on solar production, time of day, battery levels, grid import protection, and intelligent priority balancing between EV and home battery charging.
8
8
9
9
**Domain:**`ev_smart_charger`
10
-
**Current Version:** 1.3.17
10
+
**Current Version:** 1.3.19
11
11
**Installation:** HACS custom repository or manual installation to `custom_components/ev_smart_charger`
Priority Balancer notifications are now filtered based on car owner presence at home. Notifications are only sent when the configured car owner person entity state is "home", preventing unnecessary alerts when away.
761
+
762
+
**Problem Solved**:
763
+
-**Previous Behavior** (v1.3.18): Priority Balancer sent notifications on every state change (EV/Home/EV_Free), regardless of whether anyone was home to receive them
764
+
-**User Impact**: Notification spam when away from home, where alerts about EV/Home battery priority changes are irrelevant
765
+
-**New Behavior** (v1.3.19): Priority Balancer notifications only sent when car owner is home
766
+
767
+
**New Configuration Field**:
768
+
-**`car_owner`**: Person entity selector in config flow (notifications step)
769
+
- Domain: `person`
770
+
- Required field (mandatory)
771
+
- Example: `person.john`
772
+
- Appears alongside `notify_services` selection
773
+
- Available in both initial setup and options flow reconfiguration
774
+
775
+
**Logic Changes**:
776
+
777
+
**MobileNotificationService Updates**:
778
+
- Added `car_owner_entity` parameter to constructor (optional for backward compatibility)
779
+
- New method: `_is_car_owner_home()` - checks if person.state == "home"
780
+
-`send_priority_change_notification()` now checks presence before sending
781
+
- If car owner not home: notification skipped with debug log entry
782
+
- If car owner entity not configured: notifications always sent (backward compatible)
783
+
- If car owner entity unavailable: notifications always sent (fail-safe default)
784
+
785
+
**Notification Filtering Behavior**:
786
+
- ✅ **Priority Balancer**: Filtered by car owner presence (NEW)
787
+
- ❌ **Smart Blocker**: NOT filtered (charger blocking is critical regardless of presence)
788
+
- ❌ **Night Smart Charge**: NOT filtered (useful to know charging started even when away)
789
+
790
+
**Component Updates**:
791
+
All three components updated to pass car owner entity to MobileNotificationService:
792
+
1.`priority_balancer.py`: Updated constructor call with `config.get(CONF_CAR_OWNER)`
793
+
2.`automations.py` (Smart Blocker): Updated constructor call (no filtering logic)
794
+
3.`night_smart_charge.py`: Updated constructor call (no filtering logic)
Copy file name to clipboardExpand all lines: custom_components/ev_smart_charger/strings.json
+10-6Lines changed: 10 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -55,12 +55,14 @@
55
55
},
56
56
"notifications": {
57
57
"title": "📱 Mobile Notifications - Step {step}/{total_steps}",
58
-
"description": "**🔔 Stay Informed with Smart Notifications**\n\n**Get instant alerts on your mobile devices for:**\n\n🚫 **Smart Blocker Events**\n• Charging blocked outside permitted window\n• Includes reason (nighttime, insufficient solar)\n• Continuous monitoring active\n\n⚖️ **Priority Balancer Changes**\n• Priority switched: EV ↔ Home ↔ EV_Free\n• Current SOC levels (EV & Home)\n• Daily targets status\n\n🌙 **Night Smart Charge**\n• Charging started (battery/grid mode)\n• Solar forecast information\n• Target SOC progress\n\n---\n\n💡 **How it works:**\n• Select one or more mobile devices below\n• All notifications use title **\"BORGO\"** for easy filtering\n• After setup, use dashboard switches to enable/disable per feature\n• Notifications are **enabled by default**, disable if not needed\n\n⚠️ **Optional:** Leave empty to skip mobile notifications (can configure later)",
58
+
"description": "**🔔 Stay Informed with Smart Notifications**\n\n**Get instant alerts on your mobile devices for:**\n\n🚫 **Smart Blocker Events**\n• Charging blocked outside permitted window\n• Includes reason (nighttime, insufficient solar)\n• Continuous monitoring active\n\n⚖️ **Priority Balancer Changes**\n• Priority switched: EV ↔ Home ↔ EV_Free\n• Current SOC levels (EV & Home)\n• Daily targets status\n• **Smart:** Only notified when car owner is home\n\n🌙 **Night Smart Charge**\n• Charging started (battery/grid mode)\n• Solar forecast information\n• Target SOC progress\n\n---\n\n💡 **How it works:**\n• Select one or more mobile devices below\n• Select the car owner (for presence-based filtering)\n• All notifications use title **\"BORGO\"** for easy filtering\n• After setup, use dashboard switches to enable/disable per feature\n• Notifications are **enabled by default**, disable if not needed\n\n⚠️ **Optional:** Leave notify_services empty to skip notifications (can configure later)",
59
59
"data": {
60
-
"notify_services": "📱 Select Mobile Devices"
60
+
"notify_services": "📱 Select Mobile Devices",
61
+
"car_owner": "👤 Car Owner"
61
62
},
62
63
"data_description": {
63
-
"notify_services": "**Available:** All Home Assistant Mobile App devices\n**Examples:** mobile_app_johns_iphone, mobile_app_pixel_8\n\n✅ **Pro Tip:** Select all household devices for comprehensive monitoring"
64
+
"notify_services": "**Available:** All Home Assistant Mobile App devices\n**Examples:** mobile_app_johns_iphone, mobile_app_pixel_8\n\n✅ **Pro Tip:** Select all household devices for comprehensive monitoring",
65
+
"car_owner": "**Required:** Select the person entity representing the car owner\n**Domain:** person\n**Example:** person.john\n\n💡 **Smart Filtering:** Priority Balancer notifications will only be sent when this person is home. Prevents unnecessary alerts when away."
64
66
}
65
67
}
66
68
},
@@ -114,12 +116,14 @@
114
116
},
115
117
"notifications": {
116
118
"title": "📱 Update Mobile Notifications - Step {step}/{total_steps}",
117
-
"description": "**🔔 Update Notification Devices**\n\n**Current notification types:**\n• 🚫 Smart Blocker alerts\n• ⚖️ Priority Balancer changes\n• 🌙 Night Smart Charge status\n\n💡 **Notification title:** BORGO (for filtering)\n💡 **Dashboard control:** Use switches to enable/disable per feature\n\n⚠️ **Leave empty** to disable all mobile notifications\n\n---",
119
+
"description": "**🔔 Update Notification Devices**\n\n**Current notification types:**\n• 🚫 Smart Blocker alerts\n• ⚖️ Priority Balancer changes (only when car owner is home)\n• 🌙 Night Smart Charge status\n\n💡 **Notification title:** BORGO (for filtering)\n💡 **Dashboard control:** Use switches to enable/disable per feature\n\n⚠️ **Leave notify_services empty** to disable all mobile notifications\n\n---",
118
120
"data": {
119
-
"notify_services": "📱 Select Mobile Devices"
121
+
"notify_services": "📱 Select Mobile Devices",
122
+
"car_owner": "👤 Car Owner"
120
123
},
121
124
"data_description": {
122
-
"notify_services": "**Available:** All Home Assistant Mobile App devices\n**Note:** Changes apply immediately to new notifications"
125
+
"notify_services": "**Available:** All Home Assistant Mobile App devices\n**Note:** Changes apply immediately to new notifications",
126
+
"car_owner": "**Required:** Person entity for the car owner\n**Domain:** person\n**Smart Filtering:** Priority Balancer notifications only sent when this person is home"
0 commit comments