zubir2k

🔔 Doorbell AI

Jul 27th, 2025
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.40 KB | None | 0 0
  1. alias: 🔔 Doorbell - AI Alert
  2. description: ""
  3. triggers:
  4.   - entity_id:
  5.      - binary_sensor.doorbell
  6.     to: "on"
  7.     trigger: state
  8. conditions: []
  9. actions:
  10.   - target:
  11.       entity_id:
  12.        - media_player.allspeakers
  13.     data:
  14.       media_content_id: media-source://media/misc/dingdong.mp3
  15.       media_content_type: audio/mp3
  16.     action: media_player.play_media
  17.     continue_on_error: true
  18.     enabled: true
  19.   - action: camera.snapshot
  20.     target:
  21.       entity_id: camera.frontgate
  22.     data:
  23.       filename: /config/www/frontgate.jpg
  24.     continue_on_error: true
  25.   - action: google_generative_ai_conversation.generate_content
  26.     data:
  27.       prompt: >-
  28.         Describe the image in a single sentence. If you see a person, describe
  29.         them. If you see multiple people, give a count of the number of people
  30.         and describe them. If the person is wearing a helmet with pink
  31.         (FoodPanda) or green (GrabFood) or orange (ShoppeFood) shirt, it could
  32.         be delivery person. Try to determine if they are arriving or leaving and
  33.         state which if you can. Make the description a bit cheeky. Response
  34.         in json format with 2 info description and greeting. Make a suitable
  35.         greeting for the scene in local Malay. Respond only with raw JSON,
  36.         without any backticks or markdown formatting. Return response in the
  37.         following format: {
  38.           "greeting": "...",
  39.           "description": "..."
  40.         }
  41.       filenames:
  42.        - /config/www/frontgate.jpg
  43.     response_variable: doorbell_ai
  44.     continue_on_error: true
  45.   - action: tts.edge_say
  46.     data:
  47.       cache: false
  48.       entity_id: media_player.cctv_frontgate
  49.       message: >-
  50.         {{ (doorbell_ai.text | from_json(default={})).greeting }}
  51.     continue_on_error: true
  52.     enabled: true
  53.   - alias: WhatsApp Group
  54.     action: whatsapp.send_message
  55.     metadata: {}
  56.     data:
  57.       clientId: default
  58.       to: [email protected]
  59.       body:
  60.         image:
  61.           url: http://homeassistant.local:8123/local/frontgate.jpg
  62.         caption: >-
  63.           🔔 Doorbell - Someone is at your Front Gate @ {{ now().strftime('%I:%M
  64.           %p') }}{{ '\n\n' }}{{ (doorbell_ai.text |
  65.          from_json(default={})).description }} {{ '\n\n' }}I give this
  66.           greeting: {{ (doorbell_ai.text | from_json(default={})).greeting }}
  67.     continue_on_error: true
  68.     enabled: true
  69. mode: single
  70.  
Advertisement
Add Comment
Please, Sign In to add comment