I’m making progress, I’ve added the appropriate categories and I have my image on the dashboard.
However, while adding categories, I also added:
CAMERA: {
IMAGE: 'image',
MODE: 'mode',
MOTIONS: 'integer',
POWER: 'power'
}
MODE = the camera mode (motion capture, continuous recording, etc.)
MOTIONS = the number of captured events (read only)
POWER = whether the camera is on or off (from a Zoneminder perspective)
This is good, but on the Box side, I see this:
// for now, we only supports binary on/off and sensors
if (feature.read_only || SUPPORTED_FEATURE_TYPES.includes(feature.type)) {
roomDeviceFeatures.push(featureOption);
}
Therefore, I cannot modify the camera’s state or mode in the dashboard.
Similarly, I had tested at the beginning by setting the mode to type SWITCH, but it’s not ideal to know that 1 = recording, 2 = surveillance, etc.
So, how can I have a dropdown menu, for example, with the proposed modes in the dashboard? I think this is not yet planned/coded/started?
But can I manage this in a scene anyway?
On the model side, the min and max are mandatory in the feature. Does this mean that a numerical value must always be recorded, and that we need to do the mapping on the integration side?
Edit:
I added the Zoneminder alarm state, i.e., whether the camera is in Alarm due to an intrusion detection.
And so I looked for which category.type to put. On the box (SensorDeviceFeature.js), I see that currently if it’s not a Motion, Presence, or Opening sensor, the rendering is the default one.
<td>{props.deviceFeature.name}</td>
{SPECIAL_SENSORS.indexOf(props.deviceFeature.category) === -1 && (
<td class={cx('text-right', { 'text-nowrap': props.deviceFeature.last_value !== null })}>
{props.deviceFeature.last_value !== null && props.deviceFeature.last_value}
{props.deviceFeature.last_value === null && <Text id="dashboard.boxes.devicesInRoom.noValue" />}
{props.deviceFeature.last_value !== null && (
<span>
{' '}
<Text id={`deviceFeatureUnitShort.${props.deviceFeature.unit}`} />
</span>
)}
</td>
)}
Is there a dedicated type for Alarm (in general), I saw a Category « Siren » .. I await your feedback before going further with my classification.