Sync Home Mode Between Devices

I have a Vera Edge Plus and OpenLuup install.

I want to sync the home modes on each device and looking for suggestions on how to this…

Right now I built a workflow that Syncs the VeraPlus Home Mode but in building this I thought there must be an easier way…

also there is a problem with my logic in that the return to IDLE state never fires.

Here is the report

[code]Workflow Report

Sync OL Home Mode - (0-8)
6 States: Start, Sync Home, Sync Away, Sync Vacation, Sync Night, Idle
10 Transitions: home, away mode, 1sec, night, vacation, Clone of Any Change In Mode, Clone of Any Change In Mode, Clone of Any Change In Mode, Any Change In Mode, Return Every Minute
Details
Start - abd01561-ef5e-4161-b827-b4c607e2056c
Transitions
‘1sec’ - fc49adfc-5b20-437f-9328-bd17a4ae5b70
When
Timer: ‘1sec’ expiration 1s
Moves To
State: Idle
Sync Home - 1afac1a1-7f36-4a3a-acf1-026cd00b4792
OnEnter
on 0-5 urn:micasaverde-com:serviceId:HouseModes1-SetHMode [{“name”:“newHModeValue”,“value”:“1”}]
Transitions
‘Clone of Any Change In Mode’ - a766b627-03a5-4888-9408-f7eca60629b5
When
Schedule:
{0} {}
device:‘VeraPlus’ (0-12) when urn:akbooer-com:serviceId:VeraBridge1-HouseMode (new)
Moves To
State: Idle
‘Return Every Minute’ - 3165297a-2586-4a0b-9630-081b527f681f
When
Timer: ‘1min’ expiration 60s
Moves To
State: Idle
Sync Away - 5b62aa7b-a5c8-43df-af8b-f3401ca26754
OnEnter
on 0-5 urn:micasaverde-com:serviceId:HouseModes1-SetHMode [{“name”:“newHModeValue”,“value”:“2”}]
Transitions
‘Clone of Any Change In Mode’ - ed65f0eb-44bf-493c-a58c-e227da73e420
When
Schedule:
{0} {}
device:‘VeraPlus’ (0-12) when urn:akbooer-com:serviceId:VeraBridge1-HouseMode (new)
Moves To
State: Idle
Sync Vacation - 57dded3c-2a27-410d-a95f-7bc232c3b92d
OnEnter
on 0-5 urn:micasaverde-com:serviceId:HouseModes1-SetHMode [{“name”:“newHModeValue”,“value”:“4”}]
Transitions
‘Clone of Any Change In Mode’ - 2d403d10-dc54-4961-83a6-7b27a347aa16
When
Schedule:
{0} {}
device:‘VeraPlus’ (0-12) when urn:akbooer-com:serviceId:VeraBridge1-HouseMode (((luup.variable_get(“urn:akbooer-com:serviceId:VeraBridge1”, “HouseMode”, 12)) == new))
Moves To
State: Idle
Sync Night - 60b2f902-b306-494c-a4e6-7dbd4dd9be18
OnEnter
on 0-5 urn:micasaverde-com:serviceId:HouseModes1-SetHMode [{“name”:“newHModeValue”,“value”:“3”}]
Transitions
‘Any Change In Mode’ - a0938434-5d44-4bfb-8eaa-f7a4fa12e4a0
When
device:‘VeraPlus’ (0-12) when urn:akbooer-com:serviceId:VeraBridge1-HouseMode (new)
Moves To
State: Idle
Idle - 20e0b590-4f7f-4262-ae35-166e9cf6c2e4
Transitions
‘home’ - 29c38bd1-0ab3-43a9-a08c-c91ddf77a832
When
device:‘VeraPlus’ (0-12) when urn:akbooer-com:serviceId:VeraBridge1-HouseMode (new == ‘1’)
Moves To
State: Sync Home
‘away mode’ - d47b21ea-7a60-4cbc-8675-7567c331e2bb
When
Schedule:
{0} {}
device:‘VeraPlus’ (0-12) when urn:akbooer-com:serviceId:VeraBridge1-HouseMode (new == ‘2’)
Moves To
State: Sync Away
‘night’ - 48afb6ca-a3e5-42f8-9455-15f3cf9e27a4
When
Schedule:
{0} {}
device:‘VeraPlus’ (0-12) when urn:akbooer-com:serviceId:VeraBridge1-HouseMode (new == ‘3’)
Moves To
State: Sync Night
‘vacation’ - 390b8389-5c10-405d-b0b4-1fcc5a06d8f8
When
Schedule:
{0} {}
device:‘VeraPlus’ (0-12) when urn:akbooer-com:serviceId:VeraBridge1-HouseMode (new == ‘4’)
Moves To
State: Sync Vacation
[/code]

Which way around do you want to sync? I could certainly extend the mirror functionality of VeraBridge to make the remote Vera follow openLuup’s mode. The bridge also has a variable which exposes the remote machine’s mode, so it’s trivial to make a callback which sets openLuup’s mode to that of the remote.

I will be setting the mode on my Vera plus and wanted that to update VeraEdge and openluup

Sent from my ONE A2003 using Tapatalk

To add… The reason I want to set the mode on the plus is I can securely do this remotely

Sent from my ONE A2003 using Tapatalk

your workflow transition and all its clone are wrong

'Any Change In Mode' - a0938434-5d44-4bfb-8eaa-f7a4fa12e4a0 When device:'VeraPlus' (0-12) when urn:akbooer-com:serviceId:VeraBridge1-HouseMode (new) Moves To State: Idle

in your Syncxxxx state you already changed the mode so a) it wont trigger again and b) you just need to return to iddle state without any condition. just make it an empty transition with just a timer of 1 sec

other problem ( but maybe linked to a bug in ALTUI cloning of transition ) , I see a invalid schedule {0} {} in your report. remove these

so another way to write this workflow would be:

start state
transition of 1s to idle state

idle state
transition : trigger on your house mode device HouseMode variable to ‘true’. ( meaning any change will match )
Move to Sync Mode state

Sync Mode state
OnEnter Lua: a couple of lua lines to

  • get the current state which just changed in bag variable bag[“currentstate”]
  • set the mode on all your other vera ( wget calls … ) using that bag variable value bag[“currentstate”]

transition: just one transition of a timer of 1sec coming back to iddle state

I’ve updated the openLuup VeraBridge development branch to include House Mode mirroring.

It can work either way, so if you set the openLuup House Mode to mirror your Vera Plus, and your Vera Edge to mirror openLuup, then you have what you need.

Will post the details separately, on the openLuup board.

Excellent! Thanks for this

Sent from my ONE A2003 using Tapatalk