diff --git a/frigate/comms/dispatcher.py b/frigate/comms/dispatcher.py
index d304509e4..447a35cb8 100644
--- a/frigate/comms/dispatcher.py
+++ b/frigate/comms/dispatcher.py
@@ -180,6 +180,12 @@ class Dispatcher:
record_settings = self.config.cameras[camera_name].record
if payload == "ON":
+ if not self.config.cameras[camera_name].record.enabled_in_config:
+ logger.error(
+ f"Recordings must be enabled in the config to be turned on via MQTT."
+ )
+ return
+
if not record_settings.enabled:
logger.info(f"Turning on recordings for {camera_name}")
record_settings.enabled = True
diff --git a/frigate/config.py b/frigate/config.py
index d19dfbfd0..d62c6efda 100644
--- a/frigate/config.py
+++ b/frigate/config.py
@@ -172,6 +172,9 @@ class RecordConfig(FrigateBaseModel):
events: EventsConfig = Field(
default_factory=EventsConfig, title="Event specific settings."
)
+ enabled_in_config: Optional[bool] = Field(
+ title="Keep track of original state of recording."
+ )
class MotionConfig(FrigateBaseModel):
@@ -952,6 +955,9 @@ class FrigateConfig(FrigateBaseModel):
for input in camera_config.ffmpeg.inputs:
input.path = input.path.format(**FRIGATE_ENV_VARS)
+ # set config recording value
+ camera_config.record.enabled_in_config = camera_config.record.enabled
+
# Add default filters
object_keys = camera_config.objects.track
if camera_config.objects.filters is None:
diff --git a/web/__test__/handlers.js b/web/__test__/handlers.js
index 23433d840..d7f2fb5a6 100644
--- a/web/__test__/handlers.js
+++ b/web/__test__/handlers.js
@@ -16,7 +16,7 @@ export const handlers = [
front: {
name: 'front',
objects: { track: ['taco', 'cat', 'dog'] },
- record: { enabled: true },
+ record: { enabled: true, enabled_in_config: true },
detect: { width: 1280, height: 720 },
snapshots: {},
restream: { enabled: true, jsmpeg: { height: 720 } },
@@ -25,7 +25,7 @@ export const handlers = [
side: {
name: 'side',
objects: { track: ['taco', 'cat', 'dog'] },
- record: { enabled: false },
+ record: { enabled: false, enabled_in_config: true },
detect: { width: 1280, height: 720 },
snapshots: {},
restream: { enabled: true, jsmpeg: { height: 720 } },
diff --git a/web/src/routes/Cameras.jsx b/web/src/routes/Cameras.jsx
index 4b1a5ed34..1e2bbf903 100644
--- a/web/src/routes/Cameras.jsx
+++ b/web/src/routes/Cameras.jsx
@@ -16,12 +16,12 @@ export default function Cameras() {