Announcement

Collapse
No announcement yet.

2.Need help with: speak by receive any X-10 signal

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • fungun
    replied
    Could you use something like this?

    PHP Code:
    sub main() 
      
    dim icount
      icount 
    0
      
    for 1 to 16    'Unit codes
        for j = 65 to 80    '
    ascii codes for A through P
            
    If hs.DeviceExists(chr(j)&i) <> -1 then
                
    If hs.IsOn(chr(j)&i) = True then
                    icount 
    icount 1
                End 
    if
            
    End if
        
    Next
      Next
    ' hs.WriteLog Counter,"THERE ARE " &   icount   &   "  DEVICES IN THE ON STATE"  
      hs.SetDeviceString "z99", "THERE ARE " & iCount & " DEVICES IN THE ON STATE"     
    End sub 
    Don't remember who wrote for me now

    Tim

    Leave a comment:


  • eaba
    replied
    Ooh,

    ok that I was n`t knowing.


    Than it is in dead better that I use those 16 events apart.


    But if I set a global event with a trigger "A" "All X-10" and I will exclude this "A 15" ?

    How I do that without setting up 15 events from A-1 to A-14 and A-16 ?


    Eric

    Leave a comment:


  • jon00
    replied
    Scripts cannot listen. They have to be executed by an event or some other means and then act on the information they have at that time.

    It could be done but very inefficient and not recommended.

    You would have to set-up a recurring event every second to trigger the script and then check for X10 activity.

    It would be much easier if you just set up the 16 events as described earlier but get this to run a script to check the last X10 activity and then run the event you want if the House code or House codes are not excluded:

    Example:

    PHP Code:
    Sub main()
    Dim strLast
    Dim strEvent

    strLast
    =hs.LastX10
    If Instr(strLast,"A15"then Exit sub
    If Instr(strLast,"C10"then Exit sub
    strEvent
    =hs.TriggerEvent ("Name of your event you wish to trigger")

    end sub 
    In this example, when the script is triggered by an X10 code, it will trigger the event apart from a house code A15 or C10

    Leave a comment:


  • eaba
    replied
    Sorry, but I know nothing about scripting yet.

    Can you give me an example how I can do this, please.


    I was thinking this script can run always and listen to all x-10 signals and then execute an event.

    Eric

    Leave a comment:


  • jon00
    replied
    Yes, but the script still needs to be triggered by an event.

    If your actions are scriptable then you would just put a check at the beginning of the script using hs.LastX10 to detect the house code sent. If this matches (e.g A15) then it would just exit the script without taking any action.

    Leave a comment:


  • eaba
    replied
    Yeah, thanks a lot.

    Thats one way.

    I'll do this for the moment.

    But:

    Can I also do this with a script and maybe exclude same X-10 codes such as my motion sensor "A15" ?


    Eric

    Leave a comment:


  • jon00
    replied
    Your right! - never tried it so assumed

    Looks like you can only trigger all on an individual house letter code. This would mean setting up 16 events for all 16 letters.

    It's done the same way but choose your house letter code and set the unit code to 'Any'

    Leave a comment:


  • eaba
    replied
    Hi, thank you.

    Yes, I am on HS 2.


    Just tried this, but it doesn't work.


    I choose triggering by "receive x-10" leave the housecode on "A 1 " and set " Any X10".


    Eric

    Leave a comment:


  • jon00
    replied
    If you are using HS2, just set the trigger to "Received X10".

    On the command pull down, just select "Any X10"

    Ignore the house and unit code.

    Leave a comment:


  • eaba
    started a topic 2.Need help with: speak by receive any X-10 signal

    2.Need help with: speak by receive any X-10 signal

    Hello, how can I set up an event that fires if HS is receiving a x-10 signal (any signal )?


    In the Trigger section I can only set one specific house and device code.

    I need to fire this event as HS receive any X-10 code.

    Or maybe better: Can I made a list of codes therefore ?


    I not want to set up this event multiple for each code apart.


    Thanks


    Eric
Working...
X