Please login or register.

Login with username, password and session length

Author Topic: Homegenie Script in Ha-Bridge  (Read 5685 times)

spacenut

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 24
Homegenie Script in Ha-Bridge
« on: December 30, 2022, 10:10:17 AM »

Hi Everyone;

I have a question about homegenie scripts in ha bridge. Here is an example:

{"moduleType":"HomeAutomation.X10","deviceId":"A8","command":{"command":"Control.On"}}

What I want to know is can I add multiple x10 modules to this one script or do I have to execute them as individual modules in ha bridge? If I can do this can someone give me an example or modify the above script so I know how to do it?

Thank You; John
Logged

guyl

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 35
Re: Homegenie Script in Ha-Bridge
« Reply #1 on: December 30, 2022, 02:50:56 PM »

I'm not sure what you mean by "as individual modules" but you can add multiple command lines to any device id in Ha Bridge. Fill in the first default one (under whatever Alexa command you want to use, like "on" or "off", then fill a second one underneath, and click on "Add" at the end of the line, which will add it and create an additional blank line for any extra item, which you can do repeatedly. In addition, Ha bridge allows you to specify a delay in milliseconds for any given line before the following line is executed. You can also mix and match command types. One can be a Homegenie line, the next an executable command line, etc. It's very flexible.
Logged

spacenut

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 24
Re: Homegenie Script in Ha-Bridge
« Reply #2 on: December 30, 2022, 03:39:33 PM »

Thanks for the response, what might clarify this better is:  Can I rum HG Macros in the Ha-Bridge? Instead of adding each step of the macro as a individual line? And if I can, How would I do this? I don't see my macros listed under the HG helper tab?
Logged

guyl

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 35
Re: Homegenie Script in Ha-Bridge
« Reply #3 on: December 30, 2022, 03:44:35 PM »

I don't use Homegenie so I can't answer that. If it's just a different way of defining the line, maybe. If the communication with Homegenie is different for a macro, then maybe not. Alternately, is there a way to trigger a Homegenie macro from the command line?
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Homegenie Script in Ha-Bridge
« Reply #4 on: December 31, 2022, 07:24:40 AM »

Yes you can add a HG macro 2 different ways.
1: HA-Bridge helper only sees module names, to add a HG macro you'd make a switch that runs your macro and give it a name. Then HA-Bridge will see it and you can select to add.
2: Manualy add the macro using a HG api call for your HG macro. The api call would be added as a http call in HA-Bridge.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

spacenut

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 24
Re: Homegenie Script in Ha-Bridge
« Reply #5 on: December 31, 2022, 09:41:05 AM »

Thank you for the reply,
 would it be too much to ask for an example of a HG api call using http? I named my macro "My Macro"
so how would I write the script in ha bridge? Then I can you the example to enter other macro scripts!
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Homegenie Script in Ha-Bridge
« Reply #6 on: January 01, 2023, 07:07:23 AM »

There is a whole page dedicated to macros using the api.
https://homegenie.it/api/mig/core_api_automation.html what your looking for is at the bottom of the page. Your api call would start with http://YOUR HG IP:PORT
You specify your macro using its program number.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

spacenut

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 24
Re: Homegenie Script in Ha-Bridge
« Reply #7 on: January 01, 2023, 12:17:41 PM »

Thank you for all the help, but something is not clicking in my brain about this. I made a small macro to test things program # is 1000. when I place this line into the( on line) in ha-bridge:https://localhost8080:/api/1000 and test,  ha-bridge is executing the command but none of the lights that are in the macro work? when I run macro from with in HG the macro works. I cannot figure out what I am dong wrong? I must Have read the page you referenced in the previous post 10 times, just not sinking in. Any more help would be greatly appreciated!!!
Logged

guyl

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 35
Re: Homegenie Script in Ha-Bridge
« Reply #8 on: January 01, 2023, 02:16:28 PM »

Could it be that you're misplacing the colon (usually goes before the port number instead of after) in your http line?

Try this:

https://localhost:8080/api/1000
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Homegenie Script in Ha-Bridge
« Reply #9 on: January 01, 2023, 06:39:48 PM »

I think your call would be. http://localhost:8080/api/HomeAutomation.HomeGenie/Automation/Programs.Toggle/1000  I no longer use HA-Bridge you may have to replace Toggle with Run. I've never used the api for macros.
You should be able to test directly from a browser if the browser isn't  on you HG machine you'd need to replace localhost with HG's ip
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

spacenut

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 24
Re: Homegenie Script in Ha-Bridge
« Reply #10 on: January 02, 2023, 06:20:26 PM »

Thank you very much Tuicemen for setting me straight. That was the correct script to use, and I have already logged it for future
use. Have I seen the script and went back to read how it is done it started to make more sense! Afain Than you to evryone who tried to help me out!!

Happy New Year!!  John
Logged
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.