# Discussion: taking photos on request

**URL:** <https://community.gladysassistant.com/t/discussion-prendre-des-photos-a-la-demande/11661>\
**Category:** Demande de fonctionnalités\
**Created:** [November 23, 2026, 7:56pm UTC](https://community.gladysassistant.com/t/discussion-prendre-des-photos-a-la-demande/11661 "2026-11-23T19:56:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [November 23, 2026, 7:56pm UTC](https://community.gladysassistant.com/t/discussion-prendre-des-photos-a-la-demande/11661/1 "2026-11-23T19:56:49Z")

</div>

Currently, when a photo is requested from the chat, Gladys only read photos saved within the last hour, without ever asking for a new photo.

With my “Karotz,” the “rabbit” only takes a photo after a capture, so the tool returned nothing, and the AI still responded « The photo has been taken » without displaying anything. With a classic camera (RTSP), Gladys already takes an image at regular intervals and keeps it.

Here are the logs and discussion:

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/d/6/d6a306f7a8532fbf5e2cc10b79367ced64a91018.jpeg)```json  
2026-11-23T19:41:03.754948072Z 2026-11-23T20:41:03+0100 gateway.forwardMessageToAiChat.js:587 (Gateway.forwardMessageToAiChat) [AI\_CHAT] Assistant turn iteration=2 tool\_calls=1 tool\_choice=auto tools=[camera\_get\_image] content=null  
2026-11-23T19:41:03.755113466Z 2026-11-23T20:41:03+0100 gateway.forwardMessageToAiChat.js:677 (Gateway.forwardMessageToAiChat) [AI\_CHAT] Running tool=camera\_get\_image  
2026-11-23T19:41:03.761354311Z 2026-11-23T20:41:03+0100 gateway.forwardMessageToAiChat.js:689 (Gateway.forwardMessageToAiChat) [AI\_CHAT] Tool finished tool=camera\_get\_image status=success resultLength=0  
2026-11-23T19:41:08.369028696Z 2026-11-23T20:41:08+0100 gateway.forwardMessageToAiChat.js:587 (Gateway.forwardMessageToAiChat) [AI\_CHAT] Assistant turn iteration=3 tool\_calls=1 tool\_choice=auto tools=[camera\_get\_image] content=null  
2026-11-23T19:41:08.369271706Z 2026-11-23T20:41:08+0100 gateway.forwardMessageToAiChat.js:677 (Gateway.forwardMessageToAiChat) [AI\_CHAT] Running tool=camera\_get\_image  
2026-11-23T19:41:08.373106359Z 2026-11-23T20:41:08+0100 gateway.forwardMessageToAiChat.js:689 (Gateway.forwardMessageToAiChat) [AI\_CHAT] Tool finished tool=camera\_get\_image status=success resultLength=0  
2026-11-23T19:41:17.967157672Z 2026-11-23T20:41:17+0100 gateway.forwardMessageToAiChat.js:587 (Gateway.forwardMessageToAiChat) [AI\_CHAT] Assistant turn iteration=4 tool\_calls=1 tool\_choice=auto tools=[camera\_get\_image] content=null  
2026-11-23T19:41:17.967357060Z 2026-11-23T20:41:17+0100 gateway.forwardMessageToAiChat.js:677 (Gateway.forwardMessageToAiChat) [AI\_CHAT] Running tool=camera\_get\_image  
2026-11-23T19:41:17.971052845Z 2026-11-23T20:41:17+0100 gateway.forwardMessageToAiChat.js:689 (Gateway.forwardMessageToAiChat) [AI\_CHAT] Tool finished tool=camera\_get\_image status=success resultLength=0  
2026-11-23T19:41:25.550656510Z 2026-11-23T20:41:25+0100 gateway.forwardMessageToAiChat.js:587 (Gateway.forwardMessageToAiChat) [AI\_CHAT] Assistant turn iteration=5 tool\_calls=1 tool\_choice=auto tools=[camera\_get\_image] content=null  
2026-11-23T19:41:25.550969965Z 2026-11-23T20:41:25+0100 gateway.forwardMessageToAiChat.js:677 (Gateway.forwardMessageToAiChat) [AI\_CHAT] Running tool=camera\_get\_image  
2026-11-23T19:41:25.554503616Z 2026-11-23T20:41:25+0100 gateway.forwardMessageToAiChat.js:689 (Gateway.forwardMessageToAiChat) [AI\_CHAT] Tool finished tool=camera\_get\_image status=success resultLength=0  
2026-11-23T19:41:25.566488982Z 2026-11-23T20:41:25+0100 gateway.forwardMessageToAiChat.js:760 (Gateway.forwardMessageToAiChat) [AI\_CHAT] Outcome toolIterations=5 imagesSent=0 shouldSendText=false answerLength=0 wasNoResponseSentinel=false isEmptyTurn=false  
2026-11-23T19:41:25.566571999Z 2026-11-23T20:41:25+0100 gateway.forwardMessageToAiChat.js:780 (Gateway.forwardMessageToAiChat) [AI\_CHAT] No reply sent to user: assistant had content but final answer is empty after processing  
2026-11-23T19:41:25.566687687Z 2026-11-23T20:41:25+0100 gateway.forwardMessageToAiChat.js:804 (Gateway.forwardMessageToAiChat) [AI\_CHAT] Completed answerLength=0 imagesSent=0

```auto

The ongoing modification will allow:
* **Live photo** : Gladys asks each camera in the room for a new photo, instead of just retrieving a stored image. This also works for cameras without a pre-loaded image, like the Karotz.
* **Fallback solution** : if a camera does not respond, Gladys sends its last recorded photo, provided it is less than an hour old.
* **Honest response** : if no photo is available, the AI states this instead of pretending it took a photo.
* **Respected privacy mode** : a disabled camera is never requested, and its last photo is not sent.
```

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [November 23, 2026, 7:59pm UTC](https://community.gladysassistant.com/t/discussion-prendre-des-photos-a-la-demande/11661/2 "2026-11-23T19:59:54Z")

</div>

The PR:

> <https://github.com/GladysAssistant/Gladys/pull/3444>
>
> \### Description
> 
> When a user asks the AI chat for a camera picture ("take a pict…ure of the living room"), the \`camera\_get\_image\` tool now asks each camera of the room for a \*\*new\*\* picture. Before, it only read the images stored less than one hour ago (\`camera.getImagesInRoom\`) and never asked a camera for anything.
> 
> An RTSP camera refreshes its stored image on its own, so it usually had one. A camera that only has an image once a picture is taken, such as an external integration camera, had none. The tool then returned an empty result, and the model told the user that the picture had been taken while nothing was shown. Seen with a Karotz rabbit (external integration) on a real Gladys.
> 
> \- \*\*New \`camera.getLiveImagesInRoom(roomId)\`\*\* (\`server/lib/device/camera/\`). It asks every enabled camera of the room for a live image (\`camera.getLiveImage\`, the path the "send camera image" and "ask AI with camera" scene actions already use), all at the same time. When a camera's live request fails or times out, it uses that camera's stored image instead, if it is less than one hour old (\`camera.getImage\`). A disabled camera is skipped completely: no live request, no stored image (\`docs/specs/camera-enable-disable.md\`).
> \- \*\*The MCP tool \`camera.get-image\` uses it.\*\* When no camera returns an image, the tool now answers \`camera.get-image: no camera image available in room "\<room\>". No picture was sent to the user, do not say that one was taken.\` (the same kind of text as \`device.get-battery-levels\`), so the model can no longer claim that a picture was sent.
> 
> \`camera.getImagesInRoom\` is unchanged and still used by the classic chat intent.
> 
> Specs updated: \`camera-enable-disable.md\` (section C, the new path and its disabled-camera rule) and \`external-integrations/contracts/websocket-protocol.md\` (who sends \`external-integration.camera.get-image\`).
> 
> \*\*Trade-off to know:\*\* an RTSP camera is now asked for a live capture (ffmpeg, bounded at 20 s) on each AI request, instead of returning its polled image at once. External integrations are bounded by \`CAMERA\_GET\_IMAGE\_TIMEOUT\_MS\` (15 s).
> 
> \### Tests
> 
> \- Server: \`camera.getLiveImagesInRoom.test.js\` (9 tests: live image, fallback to a recent stored image, stored image too old, disabled camera never asked, camera missing from the state manager, room without camera, cameras of no room, two cameras asked at the same time with their own fallback). \`buildSchemas.test.js\`: the stubs use the new method, plus 2 tests (the text when no image comes back, "No room"). 100% coverage of the new file and of the changed lines.
> \- Camera, MCP and AI chat gateway test files: 139 passing. Full server suite (\`npm test\`, \`TZ=UTC\`): 10260 passing; the only failure is \`jsonBodyMiddleware\` (\`EPIPE\`), which also fails locally without this change.
> \- ESLint and Prettier pass on the changed files.
> \- \*\*Real test\*\*, on a Gladys running the preview image of this branch, with a Karotz rabbit (external integration) as the living room camera: the \`camera\_get\_image\` tool, called through the Gladys MCP server, returned a picture of the living room. An object put in front of the rabbit just before the call was on the picture, so it was taken at that moment.
> \- Not tried: the same request through the Gladys Plus AI chat (that test instance has no Gladys Plus). The chat loop itself is unchanged.
> 
> \### Related request
> 
> Forum: https://community.gladysassistant.com/t/discussion-prendre-des-photos-a-la-demande/11661
> 
> \### Checklist
> 
> \- \[x\] If a forum topic or GitHub issue exists, the description links it (\`Forum: https://community.gladysassistant.com/t/...\` or \`Closes #...\`)
> \- \[x\] Tests pass: \`cd server && npm run coverage\` (Codecov requires 100% coverage on changed lines) and Cypress (\`npm run cypress:run\`) if the UI changed (run locally: the full server suite with \`npm test\` and the coverage of the changed files; no UI change)
> \- \[x\] Linter and prettier pass on both front and server (\`npm run eslint\`, \`npm run prettier\`)
> \- \[x\] No undocumented breaking change
> 
> 🤖 Generated with \[Claude Code\](https://claude.com/claude-code)
> 
> 
> 
> 
> 
> 
> \## Summary by CodeRabbit
> 
> \* \*\*New Features\*\*
> \* Camera image requests now skip disabled cameras and try a stored image when a live image is unavailable.
> \* If no image can be provided, the chat receives a clear message rather than an unavailable image.
> \* \*\*Documentation\*\*
> \* Updated camera guidance to describe image requests from chat and scene actions, including stored-image fallback behavior.
