Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bell-pressed, then play a custom sound on another machine. #9

Closed
Buster14 opened this issue Nov 13, 2021 · 6 comments
Closed

Bell-pressed, then play a custom sound on another machine. #9

Buster14 opened this issue Nov 13, 2021 · 6 comments

Comments

@Buster14
Copy link

Buster14 commented Nov 13, 2021

Hi, i was wondering if this is possible,
So i bought vt2202fp-S2, but i didn't buy their VTH since i already got a LAN-connected viewing station using intel NUC + AOC 16 inch usb monitor. It runs windows now but i could change it to linux since i only need it to run VLC streams (which is available on both windows and linux).
Now I'm trying to figure out how to play a custom sound on that viewing station (connected to a speaker) whenever a doorbell is pressed.
I'm completely new at HA so please bear with me,
I installed HA on my main 24/7 working machine (not the viewing station) using VMware player.
And i Just finished installing your integrations, but i'm a bit lost at event trigger and playing sound on that NUC afterwards. thanks

@myhomeiot
Copy link
Owner

I think in your case it's will be much easyer to use Dahua SmartPSS for Windows from Dahua ToolBox
Using SmartPSS you will also get bi-directional audio from/to VTO and better user experience.

@Buster14
Copy link
Author

Hmm i just tested it, there are 2 version, smartpss and ac. But neither of them allow vto operation.
From my understanding, dahua vto requires DSS express app, i have also tested it but the free version doesn't allow VTO operation.. so i guess i'm stuck with HA..
I did try memu emulator but strangely it wont accept any calls from VTO... it's also unstable.
I even tried windows 11 subsystem, but my nuc's spec is too low.
Something i forgot to mention, I have to keep the NUC low spec'ed so that i can power it using POE converter

@myhomeiot
Copy link
Owner

If you are new to HA, try to find Telegram or Discord channel with another HA users where you can get knowledge faster. HA yaml configuration it's little bit tricky but when you understand it you will be able to do many things ;-)

Examples of getting doorbell and unlock the door you probably seen at readme but until you get some knowledge in HA yaml configuration it's useless :-(

At YouTube you can also found many video about HA yaml programming like this one

Unfortunately this integration receives events from VTO and translate it to HA events but HA doesn't have simple GUI to make automation for events using mouse without understating yaml :-(

You can try this integration which as I can see exposes doorbell as binary sensor at HA which will allow you to use HA automation GUI in order to program playing sound. This integration also has Config Flow so it's will be much easier to install and configure.

One of example of playing sound you can found here

I hope this information will help you.

@Buster14
Copy link
Author

Just want to update, luckily dss express s version works with VTO.
Any version after that wont work
Video calling works.. Haven't got 2 way audio to work yet, but probably cause i havent got webcam with mic yet.. will try again once i have it. But at least i can get it to sound the ring bell.

Thanks for your help though, you're right this method is less headache for beginner like me :)

@Buster14
Copy link
Author

Buster14 commented Dec 25, 2021

Hi, thought i'd give this an update, unfortunately DSS express S is not stable.
Vidcall stops working after a while.
Also not sure if it's related but i'm also experiencing strange issue where my vto would send a duplicated open command, e.g :open then open, instead of open and close. Even though the wiring is only open-close

Fortunately I managed to get audio sound working through MPD plugin and MPD server.
My setup is as follows, My OS are both windows so if you use other OS you might need different files.

Machine 1 : Windows hosting home assistant OS through vmware player
Machine 2 : NUC as my lovelace dashboard running windows as well.
Machine 1 :
Configuration.yaml

sensor:

  • platform: dahua_vto
    name: Dahua VTO
    host: VTO ip
    username: admin
    password: pass
    scan_interval: 5

media_player:

  • platform: mpd
    host: machine 2 ip
    port: 6600
    name: any

Automations.yaml :
alias: Dahua VTO
description: ''
trigger:

  • platform: event
    event_type: dahua_vto
    condition:
  • condition: template
    value_template: '{{ trigger.event.data.Data.State | int in [1, 2] }}'
    action:
  • service: media_player.media_play
    target:
    entity_id: media_player.gmpc
    mode: queued
    max: 10

Now on machine 2 :

  1. Download : https://www.musicpd.org/download/win32/0.23.5/mpd.exe
  2. and follow the tutorial :
    https://www.daangemist.nl/installing-mpd-on-windows/?fbclid=IwAR3qH10oRxAv27nc8ecwXvi9z8jbdl-UOJmNi__1oZ-50fsbLSE_QjVU3_0
    (their mpd server link is wrong)
  3. You also need to create a playlist using mpd player such as this one, https://sourceforge.net/projects/musicpd/files/latest/download
  4. Cmd line, run mpd.exe mpd.conf make sure the configs are correct, i want the doorbell to sound from machine 2 so the speaker is the one in machine 2
  5. Test the automation on dashboard, if its correct it should make the bell sound you assigned, you Might need to restart HA
  6. Optionally you might want to create service for mpd. I havent done so cause i'm still observing its stability.

@myhomeiot
Copy link
Owner

Thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants