ZMC v3. Whole house audio step by step Part 4

Show or discuss your existing Home automation project here, so a detailed explanation!.....
Post Reply
AshaiRey
Senior Member
Senior Member
Posts: 1310
Joined: Mon Feb 02, 2009 5:27 pm
Location: Netherlands
Contact:

ZMC v3. Whole house audio step by step Part 4

Post by AshaiRey »

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 26154 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 26154 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 26154 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 26154 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 26154 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 26154 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
Rutger
Member
Member
Posts: 339
Joined: Wed May 19, 2010 8:48 pm
Location: Netherlands

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

Post by Rutger »

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
AshaiRey
Senior Member
Senior Member
Posts: 1310
Joined: Mon Feb 02, 2009 5:27 pm
Location: Netherlands
Contact:

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

Post by AshaiRey »

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
raymonvdm
Senior Member
Senior Member
Posts: 1153
Joined: Sun Dec 18, 2011 1:23 am

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

Post by raymonvdm »

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
vincenttor
Member
Member
Posts: 344
Joined: Thu Jan 09, 2014 10:45 pm
Location: Netherlands

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

Post by vincenttor »

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.
AshaiRey
Senior Member
Senior Member
Posts: 1310
Joined: Mon Feb 02, 2009 5:27 pm
Location: Netherlands
Contact:

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

Post by AshaiRey »

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
raymonvdm
Senior Member
Senior Member
Posts: 1153
Joined: Sun Dec 18, 2011 1:23 am

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

Post by raymonvdm »

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
AshaiRey
Senior Member
Senior Member
Posts: 1310
Joined: Mon Feb 02, 2009 5:27 pm
Location: Netherlands
Contact:

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

Post by AshaiRey »

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
raymonvdm
Senior Member
Senior Member
Posts: 1153
Joined: Sun Dec 18, 2011 1:23 am

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

Post by raymonvdm »

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
AshaiRey
Senior Member
Senior Member
Posts: 1310
Joined: Mon Feb 02, 2009 5:27 pm
Location: Netherlands
Contact:

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

Post by AshaiRey »

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
vincenttor
Member
Member
Posts: 344
Joined: Thu Jan 09, 2014 10:45 pm
Location: Netherlands

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

Post by vincenttor »

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.
AshaiRey
Senior Member
Senior Member
Posts: 1310
Joined: Mon Feb 02, 2009 5:27 pm
Location: Netherlands
Contact:

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

Post by AshaiRey »

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
raymonvdm
Senior Member
Senior Member
Posts: 1153
Joined: Sun Dec 18, 2011 1:23 am

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

Post by raymonvdm »

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
AshaiRey
Senior Member
Senior Member
Posts: 1310
Joined: Mon Feb 02, 2009 5:27 pm
Location: Netherlands
Contact:

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

Post by AshaiRey »

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
Post Reply

Return to “Home Automation Projects”