diff --git a/futurehome/config.yaml b/futurehome/config.yaml index b10b2b5..b68efb6 100644 --- a/futurehome/config.yaml +++ b/futurehome/config.yaml @@ -22,6 +22,7 @@ options: tp_username: '' tp_password: '' tp_allow_empty: false + ignore_availability_reports: false demo_mode: false show_debug_log: false @@ -32,6 +33,7 @@ schema: tp_username: 'str?' tp_password: 'password?' tp_allow_empty: 'bool?' + ignore_availability_reports: 'bool?' demo_mode: 'bool?' show_debug_log: 'bool?' diff --git a/futurehome/rootfs/etc/services.d/futurehome/run b/futurehome/rootfs/etc/services.d/futurehome/run index 2654ed1..489e8ae 100755 --- a/futurehome/rootfs/etc/services.d/futurehome/run +++ b/futurehome/rootfs/etc/services.d/futurehome/run @@ -11,6 +11,7 @@ export FH_PASSWORD=$(bashio::config 'fh_password') export TP_USERNAME=$(bashio::config 'tp_username') export TP_PASSWORD=$(bashio::config 'tp_password') export TP_ALLOW_EMPTY=$(bashio::config 'tp_allow_empty') +export IGNORE_AVAILABILITY_REPORTS=$(bashio::config 'ignore_availability_reports') export DEMO_MODE=$(bashio::config 'demo_mode') export SHOW_DEBUG_LOG=$(bashio::config 'show_debug_log') diff --git a/futurehome/src/index.ts b/futurehome/src/index.ts index 90a6c9a..f22deb4 100644 --- a/futurehome/src/index.ts +++ b/futurehome/src/index.ts @@ -22,7 +22,14 @@ import { pollVinculum } from './fimp/vinculum'; const localApiPassword = process.env.FH_PASSWORD || ''; const thingsplexUsername = process.env.TP_USERNAME || ''; const thingsplexPassword = process.env.TP_PASSWORD || ''; - const thingsplexAllowEmpty = (process.env.TP_ALLOW_EMPTY || '').toLowerCase().includes('true'); + const thingsplexAllowEmpty = (process.env.TP_ALLOW_EMPTY || '') + .toLowerCase() + .includes('true'); + const ignoreAvailabilityReports = ( + process.env.IGNORE_AVAILABILITY_REPORTS || '' + ) + .toLowerCase() + .includes('true'); const demoMode = (process.env.DEMO_MODE || '').toLowerCase().includes('true'); const showDebugLog = (process.env.SHOW_DEBUG_LOG || '') .toLowerCase() @@ -263,7 +270,7 @@ import { pollVinculum } from './fimp/vinculum'; case 'evt.network.all_nodes_report': { const devicesAvailability = msg.val; - if (!devicesAvailability) { + if (!devicesAvailability || ignoreAvailabilityReports) { return; } for (const deviceAvailability of devicesAvailability) { diff --git a/futurehome/translations/en.yaml b/futurehome/translations/en.yaml index 683bc56..ffcc22b 100644 --- a/futurehome/translations/en.yaml +++ b/futurehome/translations/en.yaml @@ -17,6 +17,9 @@ configuration: tp_allow_empty: name: Allow Empty Thingsplex Credentials description: Allow empty Thingsplex username and/or password. + ignore_availability_reports: + name: Ignore Availability Reports + description: Sometimes the hub incorrectly reports some devices as down. This setting forces all devices to always be treated as up. demo_mode: name: Demo Mode description: Use a sample recorded state from a real Futurehome Smarthub to simulate devices.