Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias: 🔔 Doorbell - AI Alert
- description: ""
- triggers:
- - entity_id:
- - binary_sensor.doorbell
- to: "on"
- trigger: state
- conditions: []
- actions:
- - target:
- entity_id:
- - media_player.allspeakers
- data:
- media_content_id: media-source://media/misc/dingdong.mp3
- media_content_type: audio/mp3
- action: media_player.play_media
- continue_on_error: true
- enabled: true
- - action: camera.snapshot
- target:
- entity_id: camera.frontgate
- data:
- filename: /config/www/frontgate.jpg
- continue_on_error: true
- - action: google_generative_ai_conversation.generate_content
- data:
- prompt: >-
- Describe the image in a single sentence. If you see a person, describe
- them. If you see multiple people, give a count of the number of people
- and describe them. If the person is wearing a helmet with pink
- (FoodPanda) or green (GrabFood) or orange (ShoppeFood) shirt, it could
- be delivery person. Try to determine if they are arriving or leaving and
- state which if you can. Make the description a bit cheeky. Response
- in json format with 2 info description and greeting. Make a suitable
- greeting for the scene in local Malay. Respond only with raw JSON,
- without any backticks or markdown formatting. Return response in the
- following format: {
- "greeting": "...",
- "description": "..."
- }
- filenames:
- - /config/www/frontgate.jpg
- response_variable: doorbell_ai
- continue_on_error: true
- - action: tts.edge_say
- data:
- cache: false
- entity_id: media_player.cctv_frontgate
- message: >-
- {{ (doorbell_ai.text | from_json(default={})).greeting }}
- continue_on_error: true
- enabled: true
- - alias: WhatsApp Group
- action: whatsapp.send_message
- metadata: {}
- data:
- clientId: default
- body:
- image:
- url: http://homeassistant.local:8123/local/frontgate.jpg
- caption: >-
- 🔔 Doorbell - Someone is at your Front Gate @ {{ now().strftime('%I:%M
- %p') }}{{ '\n\n' }}{{ (doorbell_ai.text |
- from_json(default={})).description }} {{ '\n\n' }}I give this
- greeting: {{ (doorbell_ai.text | from_json(default={})).greeting }}
- continue_on_error: true
- enabled: true
- mode: single
Advertisement
Add Comment
Please, Sign In to add comment