We have moved at community.getvera.com

Author Topic: Hub child Device status  (Read 382 times)

Offline Buxton

  • Full Member
  • ***
  • Posts: 209
  • Karma: +12/-0
Hub child Device status
« on: December 04, 2018, 07:25:23 pm »
Hey Rene,

One more question if you could.  Is it possible to get the device status of a given harmony hub child device.  For example, I turn on my AV receiver that is connected to a zwave power outlet.  My harmony hub is always on and controls the AV receiver.  It takes several seconds for the receiver to boot from power-up, and several more seconds for each HDMI device connected to the receiver to become fully operational.  These boot times are somewhat arbitrary.  So I'm looking for a way in which the harmony hub can poll devices to know exactly when they come on line--so that I can then send the individual devices commands.

Thx again.

Online rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: Hub child Device status
« Reply #1 on: December 04, 2018, 10:35:23 pm »
For this, you would have to have openLuup connect to the device directly and get the status from the device. The Harmony hub actually does not know the status of the device. It is a one way remote. The device does not feedback to the hub. I have something similar where I have my openLuup connect to the receiver through a plugin and I get status from the receiver directly.
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline Buxton

  • Full Member
  • ***
  • Posts: 209
  • Karma: +12/-0
Re: Hub child Device status
« Reply #2 on: December 06, 2018, 07:34:48 pm »
OK, I thought as much.  Was hoping there was some way to verify if a call was made successfully to the hub.  Then I could test for that.  Looks like I will have to go with arbitrary timings.

Offline reneboer

  • Moderator
  • Hero Member
  • *****
  • Posts: 1574
  • Karma: +110/-31
Re: Hub child Device status
« Reply #3 on: January 21, 2019, 12:30:07 pm »
Hi Buxton,

I do something similar and I took the approach that once the activity is fully started, all devices are ready to send the commands to. With the 3.0 release there is a new variable activityStatus. This is zero(0) what the hub is off (after PowerOff command), 1 when an activity is starting (other than -1, PowerOff), 2 when an activity is fully started, and 3 when the hub is powering off, i.e. running the PowerOff activity.

Maybe this can help.

I could take this one level further if you need. Each activity is build of a number of steps (devices to turn on, commands to send). The hub reports the total number of steps and each step completion, but right now those messages are ignored. I could put those in a variable as well and you can then monitor that whilst an activity is starting, i.e. activityStatus == 1.

Let me know.

Cheers Rene
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline Buxton

  • Full Member
  • ***
  • Posts: 209
  • Karma: +12/-0
Re: Hub child Device status
« Reply #4 on: January 21, 2019, 04:57:14 pm »
Quote
hub reports the total number of steps and each step completion

That would be cool.  I'm thinking of a return lua table with a field for step number and the step completion as a field with a Boolean value.  That way, I could watch/test for activityStatus as 2, and then I could iterate through the return table, and if the total count of true values did not match the total number of steps, I'd know to reset the hub to a start state, and then retry the sequence.

It might seem like a lot of extra work to go through to just turn on your TV, but in my case, the important activity event sequence occurs when my alarm panel enters an alarm state. When in alarm, via the Harmony hub, I'm able to bring up my surveillance cameras on my TV via a sequence of steps saved in the Harmony activity, --- and of course this scenario could happen in the middle of the night when one is not thinking too clearly so the more robust the response, the better .....

Offline reneboer

  • Moderator
  • Hero Member
  • *****
  • Posts: 1574
  • Karma: +110/-31
Re: Hub child Device status
« Reply #5 on: January 22, 2019, 04:33:31 am »
Hi Buxton,

Ok, I'll add it to the next release.

BTW, You should be able to figure out the steps by studying the configuration for the activity. If you run the get_config http request (see manual) that you get a json with all those details.

Cheers Rene
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline Buxton

  • Full Member
  • ***
  • Posts: 209
  • Karma: +12/-0
Re: Hub child Device status
« Reply #6 on: January 22, 2019, 09:59:08 pm »
Awesome Rene,
I'll take a look at the http json call this weekend.  Thx for looking into this.

Offline reneboer

  • Moderator
  • Hero Member
  • *****
  • Posts: 1574
  • Karma: +110/-31
Re: Hub child Device status
« Reply #7 on: January 26, 2019, 11:36:54 am »
Hi Buxton,

I put V3.2 in my github development branch https://github.com/reneboer/vera-Harmony-Hub/tree/development. You can get the L_Harmony.lua and S_Harmony.xml files from there.

Added is a variable StartingActivityStep that reports the step details. It holds three numbers: d,n,m. D is the device number of device being started, n is the step number and m is the total number of steps. E.g. "12345678,2,6"

Let me know if it works for you.

Cheers Rene
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline Buxton

  • Full Member
  • ***
  • Posts: 209
  • Karma: +12/-0
Re: Hub child Device status
« Reply #8 on: January 26, 2019, 05:48:19 pm »
OK great, will let you know when I get things running.  Thx a bunch.

Offline Buxton

  • Full Member
  • ***
  • Posts: 209
  • Karma: +12/-0
Re: Hub child Device status
« Reply #9 on: January 31, 2019, 10:46:43 pm »
My StartingActivityStep  variable =50702784,3,3.    I don't express my devices at the moment as I only need to activate activities via reactor triggers.  So it's difficult to tell if the first number refers to a device, and if so, which device.  Is there a way to determine the device correlation to number without actually creating devices?

Offline reneboer

  • Moderator
  • Hero Member
  • *****
  • Posts: 1574
  • Karma: +110/-31
Re: Hub child Device status
« Reply #10 on: February 01, 2019, 04:35:40 am »
Hi,

I added a four new actions FindActivityByID, FindActivityByName, FindDeviceByID and FindDeviceByName. Easiest use is with ALTUI. Just select the actions tab, Put in the device ID next to the FindDeviceByID and click. It will tell you the device name.

Other way is to use the http handler. You can find the details in the manual. Last there are new variables in the Plugin; Activities, and Devices. They hold the details of what is found on your Hub whether you created devices on you Vera for it or not.

Cheers Rene
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline Buxton

  • Full Member
  • ***
  • Posts: 209
  • Karma: +12/-0
Re: Hub child Device status
« Reply #11 on: February 01, 2019, 04:30:52 pm »
OK got it  Thx