mirror of
https://github.com/myronblair/jarvis
synced 2026-06-30 17:50:23 -05:00
feat: HA tab — filter konnected/energy/camera/media_player, add 30s auto-refresh
- Added to skipDomains: media_player - Added to skipKeywords: konnected, energy/power/voltage/current, camera controls (infrared, email, FTP, push, siren, hub ringtone, manual record), system noise (CEC scanner, ESPHome builder, Echo DND) - Auto-refresh every 30s when HA tab is active
This commit is contained in:
+20
-9
@@ -83,15 +83,26 @@ if ($method === 'POST' && $action === 'service') {
|
||||
// Serve entities from ha_entities table (real-time agent push data)
|
||||
$skipDomains = ['sensor','binary_sensor','button','update','select','number',
|
||||
'device_tracker','event','image','person','zone','tts','conversation',
|
||||
'assist_satellite','input_button'];
|
||||
$skipKeywords = ['pre_release','_record','_ftp_','_push_','_hub_ringtone',
|
||||
'_siren_on','_email_on','_manual_record','_infrared_',
|
||||
'do_not_disturb','matter_server','zerotier','mariadb',
|
||||
'spotify_connect','file_editor','ssh_web','uptime_kuma',
|
||||
'adguard_','folding_home','music_assistant','get_hacs','mealie',
|
||||
'mosquitto','social_to','motion_detection',
|
||||
'front_yard_record','down_hill_record','camera1_record',
|
||||
'back_yard_record','nvr_','assist_microphone'];
|
||||
'assist_satellite','input_button','media_player'];
|
||||
$skipKeywords = [
|
||||
// HACS / system toggles
|
||||
'pre_release','get_hacs','matter_server','zerotier','mariadb',
|
||||
'spotify_connect','file_editor','ssh_web','uptime_kuma','adguard_',
|
||||
'folding_home','music_assistant','mealie','mosquitto','social_to',
|
||||
'assist_microphone','cec_scanner','esphome_device_builder',
|
||||
// Camera controls
|
||||
'_record','_ftp_','_push_','_hub_ringtone','_siren_on',
|
||||
'_email_on','_manual_record','_infrared_','motion_detection',
|
||||
'front_yard_record','down_hill_record','camera1_record',
|
||||
'back_yard_record','nvr_',
|
||||
// Echo / smart display noise
|
||||
'do_not_disturb',
|
||||
// Konnected security panel switches
|
||||
'konnected',
|
||||
// Energy / power monitoring (sensors, not controls)
|
||||
'_energy','_power','_voltage','_current','_consumption',
|
||||
'electricity_maps',
|
||||
];
|
||||
|
||||
$rows = JarvisDB::query(
|
||||
"SELECT entity_id, entity_name, domain, state, UNIX_TIMESTAMP(updated_at) as updated_ts
|
||||
|
||||
@@ -698,6 +698,16 @@ async function loadProxmox() {
|
||||
}
|
||||
|
||||
// ── HOME ASSISTANT ────────────────────────────────────────────────────
|
||||
let _haRefreshTimer = null;
|
||||
function _startHARefresh() {
|
||||
if (_haRefreshTimer) return;
|
||||
_haRefreshTimer = setInterval(() => {
|
||||
if (document.getElementById('tab-ha')?.classList.contains('active') ||
|
||||
document.getElementById('tab-home')?.classList.contains('active')) {
|
||||
loadHA();
|
||||
}
|
||||
}, 30000);
|
||||
}
|
||||
async function loadHA() {
|
||||
const data = await api('ha');
|
||||
const el = document.getElementById('ha-list');
|
||||
@@ -723,6 +733,7 @@ async function loadHA() {
|
||||
}
|
||||
|
||||
renderHATable(entities);
|
||||
_startHARefresh();
|
||||
}
|
||||
|
||||
const _domainIcon = {
|
||||
|
||||
Reference in New Issue
Block a user