Het is eigenlijk Home-Assistant maar omdat er een unifi deurbel in het spel zit denk ik dat moderatie dit wel toestaat ;-)
Hier is de flow. Als voorbereiding: maak een map callers aan in map config\www In die www map moet ook de map music en image staan.
In callers komen de snapshots en in de andere mappen de wav met belgeluid en een plaatje van een bel. De rest wijst zich wel.
Let er wel op dat bij import je mijn servergegevens/IP adressen van HA hebt. Vermoedelijk ook een 2e HA server. Dat zie bij configuratie: "on all flows" Daar staat dan 2x Home Assistant. De jouwe met een getal en de mijne met een 0. Die kan je verwijderen door dubbelklikken erop en (grijze) button delete.
Die delay van 1/2 seconde is om het filesysteem tijd te geven de file op te slaan. Laat even weten of het gelukt is.
[
{
"id": "5635f168d88aa154",
"type": "server-state-changed",
"z": "56a706780a560af9",
"name": "Aanbellen Deurbel",
"server": "87938c66.b7f77",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"binary_sensor.deurbel_binnendeur_doorbell"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 190,
"y": 120,
"wires": [
[
"741c31a4c15e6fca",
"547b9416628347fd"
],
[]
]
},
{
"id": "741c31a4c15e6fca",
"type": "moment",
"z": "56a706780a560af9",
"name": "tijd nu",
"topic": "",
"input": "",
"inputType": "date",
"inTz": "Europe/Amsterdam",
"adjAmount": 0,
"adjType": "days",
"adjDir": "add",
"format": "YYYYMMDD_HHmmss",
"locale": "nl",
"output": "",
"outputType": "msg",
"outTz": "Europe/Amsterdam",
"x": 370,
"y": 80,
"wires": [
[
"8589a5f53147239f"
]
]
},
{
"id": "8589a5f53147239f",
"type": "string",
"z": "56a706780a560af9",
"name": "Filenaam op basis van tijd",
"methods": [
{
"name": "append",
"params": [
{
"type": "str",
"value": "_call.jpg"
}
]
}
],
"prop": "payload",
"propout": "payload",
"object": "msg",
"objectout": "msg",
"x": 550,
"y": 80,
"wires": [
[
"474bb300817294c0"
]
]
},
{
"id": "589173e4552ece6b",
"type": "cast-to-client",
"z": "56a706780a560af9",
"name": "Belgeluid op Google",
"url": "",
"contentType": "",
"message": "",
"language": "",
"ip": "192.168.33.185",
"port": "8009",
"volume": "",
"x": 640,
"y": 140,
"wires": [
[]
]
},
{
"id": "547b9416628347fd",
"type": "trigger",
"z": "56a706780a560af9",
"name": "Geluid van de bel",
"op1": "{\"volume\":40,\"contentTitle\":\"Er staat iemand voor de deur\",\"url\":\"
http://192.168.33.4:8123/local/music/Chime_aanbellen.wav\",\"contentType\":\"audio/wav\",\"imageUrl\":\"
http://192.168.33.4:8123/local/image/bel2.jpg\",\"enqueue\":\"play\"}",
"op2": "",
"op1type": "json",
"op2type": "nul",
"duration": "10",
"extend": false,
"overrideDelay": false,
"units": "s",
"reset": "",
"bytopic": "all",
"topic": "topic",
"outputs": 1,
"x": 410,
"y": 140,
"wires": [
[
"589173e4552ece6b"
]
],
"outputLabels": [
"Afspelen"
]
},
{
"id": "e85afdbb32cc4b85",
"type": "api-call-service",
"z": "56a706780a560af9",
"name": "",
"server": "87938c66.b7f77",
"version": 7,
"debugenabled": false,
"action": "camera.snapshot",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"camera.deurbel_binnendeur_high"
],
"labelId": [],
"data": "{\"filename\" : \"www/callers/\" & payload }",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "{\t \"url\" : \"
http://192.168.33.4:8123/local/callers/\" & payload,\t \"media_content_type\": \"image/jpeg\",\t \"enqueue\": \"play\"\t }",
"valueType": "jsonata"
}
],
"queue": "none",
"blockInputOverrides": false,
"domain": "camera",
"service": "snapshot",
"x": 930,
"y": 80,
"wires": [
[
"2d5e243021849eaf",
"e9acaeb8a5031270"
]
]
},
{
"id": "474bb300817294c0",
"type": "delay",
"z": "56a706780a560af9",
"name": "2 seconden",
"pauseType": "delay",
"timeout": "2",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 750,
"y": 80,
"wires": [
[
"e85afdbb32cc4b85"
]
]
},
{
"id": "2d5e243021849eaf",
"type": "delay",
"z": "56a706780a560af9",
"name": "1/2 seconde wachten",
"pauseType": "delay",
"timeout": "500",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1140,
"y": 80,
"wires": [
[
"8e01df24a87fe451"
]
]
},
{
"id": "8e01df24a87fe451",
"type": "cast-to-client",
"z": "56a706780a560af9",
"name": "Snapshot op Google",
"url": "",
"contentType": "image/jpeg",
"message": "",
"language": "",
"ip": "192.168.33.185",
"port": "8009",
"volume": "",
"x": 1360,
"y": 80,
"wires": [
[]
]
},
{
"id": "027a8da3834ad8c6",
"type": "api-call-service",
"z": "56a706780a560af9",
"name": "Google Player weer uit",
"server": "87938c66.b7f77",
"version": 7,
"debugenabled": false,
"action": "media_player.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"media_player.woonkamer_google_nest_hub"
],
"labelId": [],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": false,
"domain": "media_player",
"service": "turn_off",
"x": 1300,
"y": 120,
"wires": [
[]
]
},
{
"id": "e9acaeb8a5031270",
"type": "delay",
"z": "56a706780a560af9",
"name": "30 seconden",
"pauseType": "delay",
"timeout": "30",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1110,
"y": 120,
"wires": [
[
"027a8da3834ad8c6"
]
]
},
{
"id": "64b8eed3b337e6c0",
"type": "comment",
"z": "56a706780a560af9",
"name": "Wat als er wordt aangebeld",
"info": "",
"x": 170,
"y": 80,
"wires": []
},
{
"id": "87938c66.b7f77",
"type": "server",
"name": "Home Assistant",
"addon": true
}
]