hassio-addons / addon-node-red

Node-RED - Home Assistant Community Add-ons
https://addons.community
MIT License
529 stars 122 forks source link

Call Service: camera.snapshot won't save file #1804

Closed detroitgoose closed 8 months ago

detroitgoose commented 8 months ago

Describe the bug

I'm unable to save camera snapshots.

I was previously saving a file to /config/www/snapshot/drive.jpg and then sending a service call notification to my phone using the path /local/snapshot/drive.jpg. Recently since about 6pm EST on 1/6/24 all of my phone notifications from this flow (and all other snapshot flows) have been sending the same image.

Looking for solutions, and seeing that I apparently missed the update about the "new" addon_configs folder, I attempted saving the file to a number of different paths, including homeassistant/www/snapshot/drive.jpg and variations of /share/snapshot/drive.jpg, including trying only the root directory of share and config.

The majority of my file saves are camera snapshot related. The only file saves that work without issue (at least to save them in the addon_configs folder) are ones that use the native "write file" node.

I'm pretty sure that I should no longer be using the /config/www/ path for saving these temporary files to later be viewed via notifications, but as I'm not able to save any snapshot to any path it's making it difficult to find a more suitable location.

Lastly, I am unable to find anything of value in either a debug node or the nodered addon logs.

To Reproduce

1) Create service call 2) Input Domain: camera, Service: snapshot, Entity: camera.entityID, Data: {"filename":"/config/www/drive.jpg"} 3) Test with inject

Expected behavior

A saved file, in the case of the above file path, found in /addon_configs/a0d7b954_nodered/www/

Example Flow

[
    {
        "id": "3a87d04c7c5dc735",
        "type": "inject",
        "z": "eabfdfbeb39d1869",
        "name": "TEST",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 1070,
        "y": 560,
        "wires": [
            [
                "a94d2617fdfdb801"
            ]
        ]
    },
    {
        "id": "a94d2617fdfdb801",
        "type": "api-call-service",
        "z": "eabfdfbeb39d1869",
        "name": "Take Snapshot",
        "server": "36a52212.74ceee",
        "version": 5,
        "debugenabled": false,
        "domain": "camera",
        "service": "snapshot",
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "camera.drive"
        ],
        "data": "{\"filename\":\"/config/www/snapshot/drive.jpg\"}",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 1230,
        "y": 560,
        "wires": [
            [
                "d8b66a4973fe2f12"
            ]
        ]
    },
    {
        "id": "d8b66a4973fe2f12",
        "type": "debug",
        "z": "eabfdfbeb39d1869",
        "name": "debug 75",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1400,
        "y": 560,
        "wires": []
    },
    {
        "id": "36a52212.74ceee",
        "type": "server",
        "name": "Home Assistant",
        "version": 5,
        "addon": true,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true,
        "heartbeat": false,
        "heartbeatInterval": "30",
        "areaSelector": "friendlyName",
        "deviceSelector": "friendlyName",
        "entitySelector": "friendlyName",
        "statusSeparator": "at: ",
        "statusYear": "hidden",
        "statusMonth": "short",
        "statusDay": "numeric",
        "statusHourCycle": "h23",
        "statusTimeFormat": "h:m",
        "enableGlobalContextStore": true
    }
]

Environment Information

Addon Version: 17.0.2

Home Assistant version: 2024.1.3 OS: 11.4 using Generic x86-64

Node-RED version: 3.1.3 Docker: no Add-on: yes

detroitgoose commented 8 months ago

Issue remains the same on version 17.0.3

detroitgoose commented 8 months ago

My bad!

My camera entities were disabled for some reason. Issue resolved...