ZMC v3. Whole house audio step by step Part 4

Show or discuss your existing Home automation project here, so a detailed explanation!.....

ZMC v3. Whole house audio step by step Part 4

Postby AshaiRey » Sun Feb 23, 2014 10:20 am

Announcements

Making announcements is always fun. They come in all kind of forms, telling time, giving feedback or just telling you the state of your system. ZMC can also do announcements. It is able to make an announcement in any single room without disturbing music output in the other rooms or make an announcement to all rooms in one go. If you followed the information this far you have most of your system prepared for this.

What you need is an extra soundcard. Don't be put off by this. You just need the cheapest USB sound stick you can find and that will be around Euro 12,-. You don't need anything more advanced. If you haven't yet installed the HS speaker client then do it now. Make sure that the output will go to the second soundcard and that there is actually sound coming out of it.

Here's the matrix again.
matrix.png
matrix.png (64.51 KiB) Viewed 13381 times

Connect the sound card to input 11 (Speech in) on the XAP800. Open up GWare and open the Input 9-12 screen and check the box next to the Post Gain meter to see if any sound is coming in into the XAP800.

Follow the same pattern as before. In the matrix connect Input 11 to Processor B and D by marking the crossings green. Next on the left find Processor D and mark all the cross point green to your outputs that are in use. You should have green boxes as shown in the matrx image above.

processors.jpg
processors.jpg (96.45 KiB) Viewed 13381 times

Open the Process A-H window and unmute all except Processor D. What you got now is one button to mute all audio (Processor C), one to mute single announcements (Processor B) and one mute button to mute all room announcements (Processor D). This will simplify the number of calls to make to the serial port.

macro200.png
macro200.png (14.63 KiB) Viewed 13381 times

Now it's also time to make a few macros on the XAP900.
Any one who tried the ZMC Reset function have noticed by now that there was something missing. That will be corrected now. We are going to add 5 macros in total.
Open the macro editor in GWare.
Select macro 200 and fill the required fields as shown in the image.
Note: I have 9 rooms in use your number may vary.
Select macro 201 and fill in the same arguments but this time use for Arg3 a one instead of zero.
Note: Arg2 is the letter O

macro202.png
macro202.png (54.9 KiB) Viewed 13381 times

Select macro 202 and set it up as shown in the next image.
For the last one select macro 203 and fill it in just like the previous on but this time use a one for Arg 5 instead of zero

macro204.png
macro204.png (56.56 KiB) Viewed 13381 times

Macro 204 will be our last macro for now.
Create it like to image shown.

Now the fun part, creating some events in HomeSeer.
Make an event, trigger it manually and for the action select the script AZ_ZMC3.vb. Put this in the Optional parameter field

("Main","KITCHEN;OMROEP;This is a test message $$DS:W16 |2|warning.wav").
This will give you something like this.
testmessage.png
testmessage.png (21.4 KiB) Viewed 13381 times

I will explain this example.
"Main" is the function to call in the script.
You don't have to change this"KITCHEN" is the room name as you filled it in the INI file.
Next there must be a ; to separate the location from the command. The command here in OMROEP (Dutch for announcement).
Again a ; but now to separate the command and the parameters.
"This is a test message $$DS:W16" is the text to be spoken.
As you can see you can use the HS replacement variables here. In this case the string of device W16 is spoken.
Then you got a separator mark |
Next you get the volume. The example will put the volume at 2dB. Leaving it at 0 will not alter the volume level. Instead you can leave it blank also. This will do the same ("Main","KITCHEN;OMROEP;This is a test message $$DS:W16")
And for last you can also play a wav file before the announcement to get the listeners attention.

To speak an announcement to all rooms instead of the room name use the keyword ALLES (Dutch for All)
e.g. ("Main","ALLES;OMROEP;This is a test message $$DS:W16 |0|warning.wav")

Some more examples:
("Main","ALLES;OMROEP;Attention! The door of the fridge is still open!")

An hourly trigger gives you a cuckoo clock in the house.
("Main","ALLES;OMROEP;.|0|cuckoo_clock.wav")

At special occasions I change this also
- At Christmas time to santa.wav.
- Valentine ’s Day to kisses.wav.
- Or when I am in a naughty mood then to cow.wav

Setting up a reminder to not to forget some special date such as your wedding day, the birthday of your spouse or an appointment to name a few.

What else can you do?
You can also turn this speech channel into a second audio channel by streaming music to it. That way you can have each room the choice of one or the other audio source.

In the INI file there is a place where you can define a device house code that is like a master switch for the whole system.
The field is called MIGRAINE_STATE_DEVICE. What it actually do is the script will look at the ON/OFF state of this device to determine if an audio channel will be opened or not. A very nice feature when you have someone at home with migraine, hence the naming

That covers the audio system.
I still have to talk about voice recognition and how to deal with that.
I 'hear' a next article coming up about VR.
Bram
AshaiRey
Senior Member
Senior Member
 
Posts: 1299
Joined: February 2009
Location: Netherlands

Re: ZMC v3. Whole house audio step by step Part 4

Postby Rutger » Tue Mar 18, 2014 7:34 pm

Part 4 is at the moment not yet implemented, but the announcements work well via the speakers I have activated at that moment. I can't wait for more explanation about the voice recognition, that would be a amazing upgrade of the system.
Many thanks sofar for this amazing documentation.
My home automation blog: https://rutg3r.com
Rutger
Member
Member
 
Posts: 332
Joined: May 2010
Location: Netherlands

Re: ZMC v3. Whole house audio step by step Part 4

Postby AshaiRey » Wed Mar 19, 2014 8:47 am

Thank you for the update. These guides is are ment to get you started and isn't set in stone. I do want you to think about your own situation and alter this setup so it will work best for you.

The guide about voice recognition is coming up soon
Bram
AshaiRey
Senior Member
Senior Member
 
Posts: 1299
Joined: February 2009
Location: Netherlands

Re: ZMC v3. Whole house audio step by step Part 4

Postby raymonvdm » Fri Apr 03, 2015 9:47 pm

Last week i have followed this guide again and now i have my own NS announcement system on HS2. The downfall is that is also updated to HS3, will this script be working on HS3 ?
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
raymonvdm
Senior Member
Senior Member
 
Posts: 1145
Joined: December 2011

Re: ZMC v3. Whole house audio step by step Part 4

Postby vincenttor » Fri Apr 03, 2015 11:13 pm

Bram told my in PM that there is someone that made it working, there is a plugin for HS3 from Blade for the clearone.
Not sure how much it can replicate as the script from Bram can.
vincenttor
Member
Member
 
Posts: 341
Joined: January 2014
Location: Netherlands

Re: ZMC v3. Whole house audio step by step Part 4

Postby AshaiRey » Sat Apr 04, 2015 8:25 am

raymonvdm wrote:Last week i have followed this guide again and now i have my own NS announcement system on HS2. The downfall is that is also updated to HS3, will this script be working on HS3 ?


The scripting engine of HS3 is slightly different then that of HS2 so it won't work right out of the box. You have to make a few minor updates to the vbscript commands to make it work. I helped someone with this before and asked him to send me the update script since i don't have HS3 to make/test it on. Sadly after a few emails i didn't hear a think anymore from him. However if you need help feel free to ask.
Bram
AshaiRey
Senior Member
Senior Member
 
Posts: 1299
Joined: February 2009
Location: Netherlands

Re: ZMC v3. Whole house audio step by step Part 4

Postby raymonvdm » Thu Apr 09, 2015 9:04 pm

I really need some help with this :D

The first issue that i experience is the lack of script optional parameters which can not be used in HS3?

For example

Code: Select all
AZ_ZMC3.vb("SetMute","0|4|O|1")


Hmm maybe i just found out the function of the airplane button :-)

So here is my first issue

Code: Select all

Running script C:\Program Files\HomeSeer HS3\scripts\AZ_ZMC3.vb :Exception has been thrown by the target of an invocation.Het openbare lid StringItem voor type hsapplication is niet gevonden.

Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
raymonvdm
Senior Member
Senior Member
 
Posts: 1145
Joined: December 2011

Re: ZMC v3. Whole house audio step by step Part 4

Postby AshaiRey » Fri Apr 10, 2015 10:16 am

A quick google gave me this

hs.stringitem no longer exists in HS3. hs.devicestring now needs a device reference to be passed to it (which is a numerical value rather than 'I98') rather than the older HS2 style device code. IF you click on the device in the advanced tab you should have a line saying reference and then a four digit number which the reference is. You would need to substitute this reference in hs.devicestring.

Or use this instead
http://board.homeseer.com/showpost.php? ... ostcount=8
Bram
AshaiRey
Senior Member
Senior Member
 
Posts: 1299
Joined: February 2009
Location: Netherlands

Re: ZMC v3. Whole house audio step by step Part 4

Postby raymonvdm » Fri Apr 10, 2015 10:21 am

AshaiRey wrote:A quick google gave me this

hs.stringitem no longer exists in HS3. hs.devicestring now needs a device reference to be passed to it (which is a numerical value rather than 'I98') rather than the older HS2 style device code. IF you click on the device in the advanced tab you should have a line saying reference and then a four digit number which the reference is. You would need to substitute this reference in hs.devicestring.

Or use this instead
http://board.homeseer.com/showpost.php? ... ostcount=8



Note i don`t know anything about VB, please fix it for me :oops:

However i have replaced hs.stringitem with hs.devicestring in the script and now the error changed

Code: Select all

Running script C:\Program Files\HomeSeer HS3\scripts\AZ_ZMC3.vb :Exception has been thrown by the target of an invocation.Het oplossen van de overbelasting is mislukt omdat dit aantal argumenten door geen enkele toegankelijke devicestring wordt geaccepteerd.



Maybe i now need to replace device codes in the config file with the new ID`s #workinprogress

but i don`t know how to fix this


; The following devices must ALL have the same device letter
FIRST_VOLUME_DEVICE="Z71"
FIRST_RADIO_SPEECH_DEVICE="Z81"
FIRST_MUTE_DEVICE="Z91"
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
raymonvdm
Senior Member
Senior Member
 
Posts: 1145
Joined: December 2011

Re: ZMC v3. Whole house audio step by step Part 4

Postby AshaiRey » Fri Apr 10, 2015 6:30 pm

raymonvdm wrote:Note i don`t know anything about VB, please fix it for me :oops:

I don't think so. :D
Learn VBscript or forget. I don't have HS3 so i will be a very hard excercise for me to figure out what you do. So you need some VBscript knowledge otherwise i can't help

raymonvdm wrote:However i have replaced hs.stringitem with hs.devicestring in the script and now the error changed

Code: Select all

Running script C:\Program Files\HomeSeer HS3\scripts\AZ_ZMC3.vb :Exception has been thrown by the target of an invocation.Het oplossen van de overbelasting is mislukt omdat dit aantal argumenten door geen enkele toegankelijke devicestring wordt geaccepteerd.



the answer is given there. you are passing the wrong number of arguments to devicestring.
Here is what you have to do and you have to change hs.Stringitem instead devicestring
board.homeseer.com/showpost.php?p=10906 ... ostcount=8
Bram
AshaiRey
Senior Member
Senior Member
 
Posts: 1299
Joined: February 2009
Location: Netherlands

Re: ZMC v3. Whole house audio step by step Part 4

Postby vincenttor » Sat Apr 11, 2015 8:55 am

Raymond, have you looked into HS2 to HS3 connector from jon00 ?
Maybe it is a possibility to run h2 next to hs3, only consumes a few percent cpu as if it is this much already.
Then you can pretty easily connect them to each other and maybe this still gives the functions you want.
you can let it trigger events and change statuses from real sensors and virtual.
vincenttor
Member
Member
 
Posts: 341
Joined: January 2014
Location: Netherlands

Re: ZMC v3. Whole house audio step by step Part 4

Postby AshaiRey » Thu Apr 23, 2015 7:54 am

Because there is so much interest in my script i would like to make a request here.

Is there anyone that has HS3 installed, got some VBScript knowledge and is willing to do some testing and give me feedback? In addition if you got a XAP800 that would be nice but it isn't a requierment. If so i am willing to spend time into this to convert the script to HS3 but i need commitment to this otherwise it can't be done. What i will ask from you is to put the script in your system and start it. If it crash (it will at first) then report back to me clearly what you have done, copy paste the error and if possible take a screenshot. If you can resolve it yourself then tell me also about it so i can implement it. This process repeats untill it's working.

Ps, we can do the private conversation in Dutch. :D
Bram
AshaiRey
Senior Member
Senior Member
 
Posts: 1299
Joined: February 2009
Location: Netherlands

Re: ZMC v3. Whole house audio step by step Part 4

Postby raymonvdm » Thu Apr 23, 2015 8:10 am

I would like to do so but i have no VBScript knowledge and therefore i cannot help you :-(

Maybe i have some resources available to create a virtual machine with HS3 (Trial) and i can help you in that way ?
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
raymonvdm
Senior Member
Senior Member
 
Posts: 1145
Joined: December 2011

Re: ZMC v3. Whole house audio step by step Part 4

Postby AshaiRey » Thu Apr 23, 2015 2:06 pm

Scripting knowledge would speedup the refactoring process when it is a minor error that you might solve on your own so testing can go further. That would reduce some email back and forth. I will keep your offer in mind, thx
Bram
AshaiRey
Senior Member
Senior Member
 
Posts: 1299
Joined: February 2009
Location: Netherlands


Return to Home Automation Projects

Who is online

Users browsing this forum: No registered users and 1 guest

cron