www.homeseer.com    
 

Go Back   HomeSeer Message Board > Audio / Video and Infra-red (IR) Plug-ins > Audio / Video and Infra-red (IR) Discussion

Reply
 
Thread Tools Display Modes
  #141  
Old August 8th, 2017, 02:15 AM
AshaiRey AshaiRey is offline
Seer Deluxe
 
Join Date: May 2009
Location: Netherlands
Posts: 426
With HS2 and HST i have noticed that the parameters where different when they where send from an Android or an iPad. I had a lot of trouble to get them in a right format and to see what was going on. At the moment i am at work but later i wil look at my notes and old code how to deal with this. I was hoping that this was solved by now.

In the meantime i found this old message on this forum that might help you
https://forums.homeseer.com/showpost...60&postcount=3

The message also points to another thread that probaly fails to load so here's the correct url
http://board.homeseer.com/showthread...ript+parameter
__________________
- Bram

Send from my Commodore VIC-20

Ashai_Rey__________________________________________________________ __________________
HSPro 2.5.0
PIugins: PowerTrigger | NetCam | HSTouch | WeatherXML | ZMC audio | ZMC VR | ZMC IR | ZMC NDS | RFXcom | AZ scripts | Jon00 Scripts | RFXCOM, | Is Speaking | BLBackup
Reply With Quote
  #142  
Old August 8th, 2017, 05:04 PM
ckellyusa's Avatar
ckellyusa ckellyusa is offline
Seer Deluxe
 
Join Date: Aug 2014
Location: DFW
Posts: 147
Quote:
Originally Posted by AshaiRey View Post
With HS2 and HST i have noticed that the parameters where different when they where send from an Android or an iPad. I had a lot of trouble to get them in a right format and to see what was going on. At the moment i am at work but later i wil look at my notes and old code how to deal with this. I was hoping that this was solved by now.

In the meantime i found this old message on this forum that might help you
https://forums.homeseer.com/showpost...60&postcount=3

The message also points to another thread that probaly fails to load so here's the correct url
http://board.homeseer.com/showthread...ript+parameter

Those links helped! I updated the script based on those hints and ended up with this:
Code:
'==============================
' SetGain via HSTouch
'==============================
'
' Sets the gain on the specified channel for the specified unit
' Data is now coming from HSTouch
'
' unitCode - the unit code of the target unit
' channel - the target channel (1-8, A-D, 1-2, or * for all)
' channelType - the type of channel (e.g. I for input, O for output,
'                                    S for subbus, p for processors)
' level - the amount of gain to apply in dB (-20 to 20).
' Type  - A for absolute or R for relative to current,
'
Sub SetGainHST(ByVal  Parm()  As String)
    Dim x As String = ""
    If  Parm  IsNot  Nothing Then
        Dim strdata As String = ""
        For i As Integer = 0 To Parm.Length - 1
            If  Not String.IsNullOrEmpty(Parm(i))  Then
                strdata = Parm(i)
                if i = 3  Then
'                    hs.WriteLog("Tests",strdata)
                    strdata = Right(strdata,  Len(strdata) -  InStr(1, strdata,  Chr(7))) - 66
                End  If
                strdata = Right(strdata,  Len(strdata) -  InStr(1, strdata,  Chr(7)))
                x = x + strdata + "|"
'                hs.WriteLog("Testx",x)
            End If
        Next
        x = Left(x, Len(x) - 1)
'        hs.WriteLog("Testx2",x)
    End If
    CMD = UNIT_CMD & GetUnitCode(x) & " GAIN " & GetParameter(x) & EOM
    If DEBUG = True Then hs.WriteLog(strScriptName, "SetGainHST request used : " & CMD)
    send(CMD)
'    hs.WriteLog(strScriptName, "SetGainHST request used : " & CMD)
End Sub
It seems to be sending the parameters correctly now. I'll have to get home to double verify, but it looks good in the logs.

Two things I learned:
  • Drop down lists still do not work, you have to use the list box
  • I think your script is going off real dB levels (i.e. -66 to 20). Sliders do not support negative values, so I had to add that line to subtract 66 and adjust the slider range appropriately.
If there is a cleaner way to script what I have, please let me know! Also, is there a way to read the values of each output from the matrix and store them in devices so I can always know at what values they're set to?


Lastly, I can't figure out why the sliders seem to double call the script. See attached log images. If I just click the slider to a value, it seems to call the script twice. That also seems to give me "script already running" warnings too.
Reply With Quote
  #143  
Old August 9th, 2017, 04:46 AM
AshaiRey AshaiRey is offline
Seer Deluxe
 
Join Date: May 2009
Location: Netherlands
Posts: 426
First of all i would like to say that i am very glad that you have programming skills. That make solving this a lot easier for me..

The ZMC script wasn't intented to work with HST or not at first. I had in the past also a lot of trouble with sliders and other scripts to such extend that i just dropped using them. Also due to the quirky behaviour of HST on Android/iPad/Windows. I do use a few sliders here but that is on my own controlled enviroment where i know what i have.

Having said that back to the sliders. When using them they trigger lots of events due to the nature of the device. If you slide the control you want to see/hear the effect at ounce. For a light you want it to change graduately from the previous value to the new value. This also means sending lots of control tokens hence that the control script is triggered often in a short time to reflect this change. However the connection,script, HomeSeer scripting engine, windows API's, serial connection, the XAP and the route through all these layer back isn't finished before the next one comes in.

I have some ideas how to prevent this but never tried them so they are just that, ideas.

Quote:
Also, is there a way to read the values of each output from the matrix and store them in devices so I can always know at what values they're set to?
I don't know exactly what you mean with this but most commands function also as information feedback if you send them with a special value in the parameter. You have to look in the manual of the XAP for the format. It might be needed that you have to make a new general function for this so you can send in any constructed command.

Last edited by AshaiRey; August 9th, 2017 at 04:52 AM. Reason: Additional information
Reply With Quote
  #144  
Old October 11th, 2017, 04:21 AM
Mwillis's Avatar
Mwillis Mwillis is offline
Seer Deluxe
 
Join Date: Sep 2015
Location: United States
Posts: 174
Quote:
Originally Posted by dtsouers View Post
It seems there a bug in Homeseer with my Prolific USB to Serial Adapter. What brand are other people using?

Hmm, tried an FTDI adapter too recently. Thinking this is a bug with either HS3 or Windows 10.
Funny thing Windows via the MODE command thinks the port is closed and G-Ware works...
I use
http://www.usconverters.com/rs232-ethernet-converter
works awesome for me
__________________
HS3 Pro Edition 3.0.0.297
Microsoft Windows 10 Enterprise - Work Station - Hyper-V VM
Number of Devices: 551
Number of Events: 116
Available Threads: 600
Enabled Plug-Ins
BLControl - BLCpuAdvisor - BLEditor - BLGarbage - BLLock - BLMapper - BLPlugins - BLReminders: BLSecurity - BLShutdown - BLSpeech - BLStat - BLTouchString - Blue-Iris - BLUPS - BLVolume - HSTouch Server - Insteon - Kinect - Restart - UltraECM3 - UltraGCIR3 - UltraLog3 - UltraMon3 - UltraPioneerAVR3 - weatherXML - XBMC - Z-Wave
Reply With Quote
  #145  
Old October 11th, 2017, 04:25 AM
Mwillis's Avatar
Mwillis Mwillis is offline
Seer Deluxe
 
Join Date: Sep 2015
Location: United States
Posts: 174
could you give examples of how you setup your events.

I am using kinects for my VR. But I wish to integrate the output control with this script.
Reply With Quote
  #146  
Old October 13th, 2017, 03:23 PM
Mwillis's Avatar
Mwillis Mwillis is offline
Seer Deluxe
 
Join Date: Sep 2015
Location: United States
Posts: 174
I had to take a break from working on all this automation. But I am back at it

I still can not get the unit to output speech

also how would you intergrate this into other things... like weatherxml speech output. How do I have the xap800 route audio traffic when another action is happening?


Oct-13 14:19:22

AZ_ZMC v4.0.4
Ignoring unexpected data received from the unit: OK>
Oct-13 14:19:22

AZ_ZMC v4.0.4
THIS IS THE DATA COMMING FROM UNIT : OK>
Oct-13 14:19:22

AZ_ZMC v4.0.4
Ignoring unexpected data received from the unit: ERROR - Argument error.
Oct-13 14:19:22

AZ_ZMC v4.0.4
THIS IS THE DATA COMMING FROM UNIT : ERROR - Argument error.
Oct-13 14:19:22

AZ_ZMC v4.0.4
Ignoring unexpected data received from the unit: >
Oct-13 14:19:22

AZ_ZMC v4.0.4
THIS IS THE DATA COMMING FROM UNIT : >
Oct-13 14:19:22

AZ_ZMC v4.0.4
Ignoring unexpected data received from the unit: OK>
Oct-13 14:19:22

AZ_ZMC v4.0.4
THIS IS THE DATA COMMING FROM UNIT : OK>
Oct-13 14:19:22

AZ_ZMC v4.0.4
Ignoring unexpected data received from the unit: ERROR - Argument error.
Oct-13 14:19:22

AZ_ZMC v4.0.4
THIS IS THE DATA COMMING FROM UNIT : ERROR - Argument error.
Oct-13 14:19:22

AZ_ZMC v4.0.4
Ignoring unexpected data received from the unit: OK>
Oct-13 14:19:22

AZ_ZMC v4.0.4
THIS IS THE DATA COMMING FROM UNIT : OK>
Oct-13 14:19:22

AZ_ZMC v4.0.4
DATA OUT [#50 MTRX 0 ] to port : 2
Oct-13 14:19:22

AZ_ZMC v4.0.4
SetMatrix request used : #50 MTRX 0
Oct-13 14:19:22

AZ_ZMC v4.0.4
Retry #2 to set the matrix : 50 MTRX B P 1 O 0
Oct-13 14:19:22

AZ_ZMC v4.0.4
Reply : 50 MTRX B P 1 O 0 <> CMD : #50 MTRX 0
Oct-13 14:19:22

AZ_ZMC v4.0.4
unitType : 5 and deviceID : 0
Oct-13 14:19:22

AZ_ZMC v4.0.4
THIS IS THE DATA COMMING FROM UNIT : > #50 MTRX B P 1 O 0
Oct-13 14:19:22

AZ_ZMC v4.0.4
Ignoring unexpected data received from the unit: OK>
Oct-13 14:19:22

AZ_ZMC v4.0.4
THIS IS THE DATA COMMING FROM UNIT : OK>
Oct-13 14:19:22

AZ_ZMC v4.0.4
Ignoring unexpected data received from the unit: OK>
Oct-13 14:19:22

AZ_ZMC v4.0.4
THIS IS THE DATA COMMING FROM UNIT : OK>
Oct-13 14:19:22

AZ_ZMC v4.0.4
DATA OUT [#50 MTRX 0 ] to port : 2
Oct-13 14:19:22

AZ_ZMC v4.0.4
SetMatrix request used : #50 MTRX 0
Oct-13 14:19:22

AZ_ZMC v4.0.4
Retry #1 to set the matrix : 50 MTRX B P 1 O 1
Oct-13 14:19:22

AZ_ZMC v4.0.4
Reply : 50 MTRX B P 1 O 1 <> CMD : #50 MTRX B P 1 O 0
Oct-13 14:19:22

TTS
Speak: (*:*):Some text the speak
Oct-13 14:19:22

AZ_ZMC v4.0.4
unitType : 5 and deviceID : 0
Oct-13 14:19:22

AZ_ZMC v4.0.4
THIS IS THE DATA COMMING FROM UNIT : OK> #50 MTRX B P 1 O 1
Oct-13 14:19:22

AZ_ZMC v4.0.4
FINISHED ZMC SCRIPT.
Oct-13 14:19:22

AZ_ZMC v4.0.4
Turn device OFF : 0and set state : RADIO
Oct-13 14:19:22

Warning
Not running script since its already running: AZ_ZMC4.vb Single instance option enabled in event properties
Oct-13 14:19:22

Warning
Not running script since its already running: AZ_ZMC4.vb Single instance option enabled in event properties
Oct-13 14:19:22

Warning
Not running script since its already running: AZ_ZMC4.vb Single instance option enabled in event properties
Oct-13 14:19:22

AZ_ZMC v4.0.4
DATA OUT [#50 MTRX B P 1 O 0 ] to port : 2
Oct-13 14:19:22

AZ_ZMC v4.0.4
SetMatrix request used : #50 MTRX B P 1 O 0
Oct-13 14:19:22

AZ_ZMC v4.0.4
Actionstring SetToSpeech : 0|B|P|1|O|0
Oct-13 14:19:22

AZ_ZMC v4.0.4
Audio in : MAIN(1)
Oct-13 14:19:22

AZ_ZMC v4.0.4
Turn device ON : 0and set state : SPEECH
Oct-13 14:19:22

AZ_ZMC v4.0.4
DATA OUT [#50 MTRX B P 1 O 1 ] to port : 2
Oct-13 14:19:22

AZ_ZMC v4.0.4
SetMatrix request used : #50 MTRX B P 1 O 1
Oct-13 14:19:22

AZ_ZMC v4.0.4
Actionstring SetToSpeech : 0|B|P|1|O|1
Oct-13 14:19:21

AZ_ZMC v4.0.4
DATA OUT [#50 MTRX C P 1 O 0 ] to port : 2
Oct-13 14:19:21

AZ_ZMC v4.0.4
SetMatrix request used : #50 MTRX C P 1 O 0
Oct-13 14:19:21

AZ_ZMC v4.0.4
Actionstring SetToSpeech : 0|C|P|1|O|0
Oct-13 14:19:21

AZ_ZMC v4.0.4
Speech in : MAIN(1)
Oct-13 14:19:21

AZ_ZMC v4.0.4
Saving state
Oct-13 14:19:21

AZ_ZMC v4.0.4
Speak parameters : Some text the speak
Oct-13 14:19:21

AZ_ZMC v4.0.4
Room (1) found named : MAIN
Oct-13 14:19:21

AZ_ZMC v4.0.4
STARTING ZMC SCRIPT.
Oct-13 14:19:21

Event
Running script in background: C:/Program Files (x86)/HomeSeer HS3/scripts/AZ_ZMC4.vb("Main","Main;SPEAK;Some text the speak")
Oct-13 14:19:21

Event
Event Trigger "Audio System Speaktest"
Oct-13 14:19:21

Event
Event Audio System Speaktest triggered by the event page 'Run' button.
Oct-13 14:18:59

Z-Wave
Device: Energy Garage Volts 2 Set to 122.129 (122.129 Volts)
Oct-13 14:18:59

Z-Wave
Device: Energy Garage Volts 1 Set to 122.129 (122.129 Volts)
Oct-13 14:18:24

Z-Wave
Device: Energy Garage kW Hours 2 Set to 4708.226 (4708.226 kW Hours)
Oct-13 14:18:24

Z-Wave
Device: Energy Garage kW Hours 1 Set to 2161.845 (2161.845 kW Hours)
Oct-13 14:18:24

Z-Wave
Device: Energy Garage Amperes 2 Set to 29.012 (29.012 Amperes)
Oct-13 14:18:24

Z-Wave
Device: Energy Garage Amperes 1 Set to 18.698 (18.698 Amperes)
Oct-13 14:18:08

AZ_ZMC v4.0.4
Connection to unit is now open
Oct-13 14:18:08

Loaded value :1e Device
Y10
Oct-13 14:18:08

Loaded value :migraine
B1
Oct-13 14:18:08

Loaded value :telco
Z49
Oct-13 14:18:08

Loaded value :gate
Z59
Oct-13 14:18:08

Loaded value :VR status
W70
Oct-13 14:18:08

Loaded value :# mics
7
Oct-13 14:18:08

Loaded value :# outputs
12
Oct-13 14:18:07

Event
Running script in background: C:/Program Files (x86)/HomeSeer HS3/scripts/AZ_ZMC4.vb("Connect")
Oct-13 14:18:07

Event
Event Trigger "Audio System XAP800 Connect"
Reply With Quote
  #147  
Old October 14th, 2017, 02:21 PM
AshaiRey AshaiRey is offline
Seer Deluxe
 
Join Date: May 2009
Location: Netherlands
Posts: 426
I see that the order of switching is correct however at this point things go wrong

(I've changed the order so it read from top to bottom)

AZ_ZMC v4.0.4
Turn device ON : 0and set state : SPEECH
Oct-13 14:19:22


Thing are setup here and speech to the room (Main) is ready.
The script will do now
hs.Speak("Some text the speak", True)

The True Boolean tells HS to wait till all speech is done before the script will continue.
At least so it works on HS2.
I really can't find any HS3 scripting documentation on their site anymore so they are doing an even worse job then back in the HS2 days. I can't check and see if hs.speak() is doing what it suppost to do.

Any way. The script just don't wait for speech to start and finish but breaking down the setup straight after it has build it up.
This can be seen happening below.

AZ_ZMC v4.0.4
Audio in : MAIN(1)
Oct-13 14:19:22

What you could try first is to put a delay in the script of say 10 seconds right after the hs.speak() command.
This will allow you to verify of this is the problem.

If this is the problem you have a few options.

1- Find the correct hs.speak() command used for HS3 that wait till speech is finished.

2- Hard code a fixed delay after hs.speak(). This gives trouble when you want to speak the weather for example.

3- The variable temp in hs.speak(temp,true) contains the text to speech.
Use temp.lenght() to get how many characters there are to speech and use that number to set the time to wait. For example delaymillisecond(temp.lenght() * 500) ## where 500 is in millisconds.

Please note that I don't know the right command for the delay in seconds or milliseconds. You could also use something like delay(temp.lenght()/2) if you want to use a delay that is in seconds.
Reply With Quote
  #148  
Old October 14th, 2017, 02:35 PM
Mwillis's Avatar
Mwillis Mwillis is offline
Seer Deluxe
 
Join Date: Sep 2015
Location: United States
Posts: 174
Quote:
Originally Posted by AshaiRey View Post
I see that the order of switching is correct however at this point things go wrong

(I've changed the order so it read from top to bottom)

AZ_ZMC v4.0.4
Turn device ON : 0and set state : SPEECH
Oct-13 14:19:22


Thing are setup here and speech to the room (Main) is ready.
The script will do now
hs.Speak("Some text the speak", True)

The True Boolean tells HS to wait till all speech is done before the script will continue.
At least so it works on HS2.
I really can't find any HS3 scripting documentation on their site anymore so they are doing an even worse job then back in the HS2 days. I can't check and see if hs.speak() is doing what it suppost to do.

Any way. The script just don't wait for speech to start and finish but breaking down the setup straight after it has build it up.
This can be seen happening below.

AZ_ZMC v4.0.4
Audio in : MAIN(1)
Oct-13 14:19:22

What you could try first is to put a delay in the script of say 10 seconds right after the hs.speak() command.
This will allow you to verify of this is the problem.

If this is the problem you have a few options.

1- Find the correct hs.speak() command used for HS3 that wait till speech is finished.

2- Hard code a fixed delay after hs.speak(). This gives trouble when you want to speak the weather for example.

3- The variable temp in hs.speak(temp,true) contains the text to speech.
Use temp.lenght() to get how many characters there are to speech and use that number to set the time to wait. For example delaymillisecond(temp.lenght() * 500) ## where 500 is in millisconds.

Please note that I don't know the right command for the delay in seconds or milliseconds. You could also use something like delay(temp.lenght()/2) if you want to use a delay that is in seconds.
The goal I was attempting to accomplish with this is to be able to have centralized control over everything. However, I just don't see how that's going to be possible at this point with my level of technical skill. So I think I'm going to have to go with my original plan and have dedicated small computers controlling the voice for every room... I was hoping to just have one, with the xap routing audio. after messing with this for a long time. I think its possible... but I don't have time to brush up on my programming and write a script or program to do what is needed...

Last edited by Mwillis; October 14th, 2017 at 02:53 PM.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
whole house audio milll36 Audio / Video and Infra-red (IR) Discussion 6 November 11th, 2009 07:29 PM
Whole House Audio nojstevens Audio / Video and Infra-red (IR) Discussion 10 January 7th, 2009 09:58 AM
whole house audio njabara Audio / Video and Infra-red (IR) Discussion 24 January 21st, 2006 05:29 AM
New way for whole house audio? pete1122 Audio / Video and Infra-red (IR) Discussion 6 May 23rd, 2003 07:36 AM
Whole House Audio johnf Audio / Video and Infra-red (IR) Discussion 1 September 10th, 2002 06:02 AM


All times are GMT -4. The time now is 11:46 PM.


Copyright HomeSeer Technologies, LLC