Multihub strategy

Hi,

After playing with extenders with little success, I've decided to install a hub for on each floor. I'm planning on having 3 'client' hubs ( 1 for the basement, 1 for the ground floor, 1 for the first floor) and 1 'controller' hub for cloud apps and devices, mode controller, shared RM rules etc.

My idea is to keep within each 'client' hub devices that are used only on each floor plus 'local' rules that apply only to that 'client' hub.

With this setup in mind, how do you recomend me to go with the Amazon Echo Skill? As per my logic above, this should go to the 'controller' hub, but this will mean that all the lights and shutters should be shared with the controller hub, which kind of defeats the local strategy. I'm also concerned whether the traffic would be too much and will bring additional delays.

On the other hand, having the Echo Skill on each client seems a lot of extra work...

Is anyone with a similar setup? What are you doing/would you recommend?

Daniel

I am pretty sure you can only have one hub linked in the Echo skill so you would need all of your devices shared using Hub Mesh to your controller hub.

4 Likes

What stephen said. I do this, and like you I have three hubs. I have the echo skill installed on one of my hubs and then share any device through hub mesh that I want to use with Alexa. It works great.

1 Like

How do you get around the while X DEVCE _on HUBID? I really don't want to have to say "Alexa, Turn on bedroom_on Wils 617.2"... (yeah , the master bedroom is the one room that "Automation" doesn't work . too many variables).

You can just change the Label field on each of the Hub Mesh devices, I believe. Or, in Alexa, you can rename them, IIRC.

2 Likes

Yeah that is a bit of an inconvenience. It would be nice to have the option in hub mesh to add the hub name or not, but as of now you just have to rename.

1 Like

I guess this answers the question :slight_smile:

Thanks, good to know it works!

I do local automation locally. But i have linked all devices to a single hub. I use that hub to export devices to alexa. Works like a charm. I use the label for device names in alexa.

I have pretty much the same setup.. and I have amazon alexa on main "controller" hub
to remove the "xxx on controller hub" suffix... I did the following steps..
(1) temporarily removed the hub password
(2) copy pasted the entire device list table from the "[hub-ip]/device/list" into a Excel sheet.
(3) created an excel macro to go to each of the device id page link and programatically removed the "on HUB-ABCD" from the device label and saved the devices ( I filtered this list based on whether it is "Linked" or not...
(4) run the macro.. and couple of minutes later.. all the device labels were without the "on hub-controller" etc..

I have tested it on 2.2.8.. things do change between versions.. so cant say for sure if it will work in the future.. or on older versions.

take a backup before running the full script just to be sure..

here is the macro.. if you would like to copy paste it to excel and run it after changing the appropriate strings.


the pasted data should look something like this

. on Hub-Controller Virtual Button Linked 73455667-8888-8888-9999-112233445566-1234 2-15 7:34pm
(. on Hub-Controller)

where cells in column 2-5 are merged vertically, and column 1 has 2 separate cells.


Sub update_names()
Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")

hub_ip = "IP ADDRESS OF THE HUB WITH LINKED DEVICES"

CHANGE THE COMMENT CODE TO DO ALL, AFTER TESTING that 1 RENAMING WORKS PROPERLY
For dev_num = 1 To 1
' For dev_num = 1 To ActiveSheet.UsedRange.Rows.Count

If Cells(dev_num, 3) = "Linked" And Left(Cells(dev_num, 1), 1) <> "(" Then

Get_URL = Cells(dev_num, 1).Hyperlinks(1).Address
objHTTP.Open "GET", Get_URL, False
objHTTP.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
objHTTP.send ("")
res1 = objHTTP.responseText

'find_states_text1 = "var currentStates = "
find_states_text1 = "}},"
find_states_text2 = ";"

st1 = InStr(1, res1, find_states_text1, vbTextCompare)
st2 = InStr(st1 + 1, res1, find_states_text2, vbTextCompare)

json_val = Mid(res1, st1 + Len(find_states_text1), st2 - st1 - Len(find_states_text1))
json_val = Replace(json_val, Chr(34) & Chr(34), Chr(34), , 1000)
json_val = Replace(json_val, Chr(34), Chr(39), , 1000)

id_st = "'id':"
ed_en = ","
st1 = InStr(1, json_val, id_st, vbTextCompare)
st2 = InStr(st1 + 1, json_val, ed_en, vbTextCompare)
my_deviceTypeId = Mid(json_val, st1 + Len(id_st), st2 - st1 - Len(id_st))

id_st = "'version':"
ed_en = ",'"
st1 = InStr(1, json_val, id_st, vbTextCompare)
st2 = InStr(st1 + 1, json_val, ed_en, vbTextCompare)
my_version = Mid(json_val, st1 + Len(id_st), st2 - st1 - Len(id_st))

id_st = "'deviceNetworkId':"
ed_en = ",'"
st1 = InStr(1, json_val, id_st, vbTextCompare)
st2 = InStr(st1 + 1, json_val, ed_en, vbTextCompare)
my_deviceNetworkId = Mid(json_val, st1 + Len(id_st), st2 - st1 - Len(id_st))

id_st = "'name':"
ed_en = ",'"
st1 = InStr(1, json_val, id_st, vbTextCompare)
st2 = InStr(st1 + 1, json_val, ed_en, vbTextCompare)
my_name = Mid(json_val, st1 + Len(id_st), st2 - st1 - Len(id_st))

id_st = "'label':"
ed_en = ",'"
st1 = InStr(1, json_val, id_st, vbTextCompare)
st2 = InStr(st1 + 1, json_val, ed_en, vbTextCompare)
my_label = Mid(json_val, st1 + Len(id_st), st2 - st1 - Len(id_st))
my_label = Replace(my_label, "'", "")

CHANGE THE FOLLOWING BASED ON YOUR HUB NAMES THAT YOU WANT TO REMOVE
new_label = Replace(my_name, " on Hub-MAIN-LEVEL", "")
new_label = Replace(new_label, " on Hub-UPPER-LEVEL", "")
new_label = Replace(new_label, " on Hub-CONTROLLER", "")
new_label = Replace(new_label, "'", "")

If my_label <> new_label Then
Post_URL = "http://" & hub_ip & "/device/update"
Post_URL_Suffix = "id=" & my_deviceTypeId & "&version=" & my_version & "&controllerType=LNK&label=" & new_label & "&deviceNetworkId=" & my_deviceNetworkId & "&meshFullSync=on&locationId=1&hubId=1&groupId=&_action_update=Save+Device"

objHTTP.Open "POST", Post_URL & "?" & Post_URL_Suffix, False
objHTTP.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
objHTTP.send (Post_URL_Suffix)
res1 = objHTTP.responseText
End if
End If
Next dev_num
End Sub


1 Like