Home Assistant smart plug improvements:

- Add search parameter to /ha/entities endpoint for searching all entities
- Replace entity dropdown with searchable combobox (type to filter)
- Default shows switch/light/input_boolean; search queries all domains
- Make all three energy sensor dropdowns searchable (Power, Energy Today, Total)
- Each dropdown filters by entity_id or friendly_name
- Shows entity details (name, id, state, unit) in dropdown options

Fixes issue where HA plugs with non-standard entity naming couldn't
find their related power/energy sensors.
This commit is contained in:
maziggy
2026-01-23 07:52:56 +01:00
parent f9915237a2
commit 4a3e42db36
6 changed files with 508 additions and 195 deletions
+4 -2
View File
@@ -2211,8 +2211,10 @@ export const api = {
method: 'POST',
body: JSON.stringify({ url, token }),
}),
getHAEntities: () =>
request<HAEntity[]>('/smart-plugs/ha/entities'),
getHAEntities: (search?: string) => {
const params = search ? `?search=${encodeURIComponent(search)}` : '';
return request<HAEntity[]>(`/smart-plugs/ha/entities${params}`);
},
getHASensorEntities: () =>
request<HASensorEntity[]>('/smart-plugs/ha/sensors'),