We have moved at community.getvera.com

Author Topic: House Modes plugin triggers scenes before House Mode is actually changed  (Read 399 times)

Offline blacey

  • Sr. Member
  • ****
  • Posts: 251
  • Karma: +30/-1
I have several scenes that trigger when the house mode changes from Away to Home on a Vera Plus running the latest 1.7.4001 firmware.  I use an external Geofence to run a Return scene when I re-enter the geofence - the Return scene simply sets the House Mode to Home using the House Modes plugin.  The problem I am seeing is that setting the house mode to Home triggers the scenes but they won't run because the house mode is not yet home (1), is it still away (2).  In other words, the house mode plugin changes the mode that triggers the scenes BEFORE the house mode is actually changed.

If you examine the log below, you see the following:
  • External request to run Return scene (due to luup http request when entering Geofence) - OK
  • House Mode plugin device 17 changes from 2 (Away) to 1 (Home) as a result of Return scene running - OK
  • Several scenes are triggered due to the House Mode change? - OK
  • Scenes 1, 8 and 18 do not run because they "think" that the House Mode is 2 (Away) and not 1 (Home) - WRONG / BUG?
  • Device 17 Job 9299 to set house mode completes - OK
Either I am missing something pretty basic or this is a bug where scenes configured to trigger on House Mode change to Home are triggered before the value of the House Mode plugin actually changes to from Away to Home.  Anyone know a good way to work around it?

Code: [Select]
08      01/08/19 19:18:37.343   JobHandler_LuaUPnP::HandleActionRequest device: 0 service: urn:micasaverde-com:serviceId:HomeAutomationGateway1 action: ^[[36;1mRunScene^[[0m <0x728f7520>                                                                                                           
08      01/08/19 19:18:37.343   JobHandler_LuaUPnP::HandleActionRequest argument action=RunScene <0x728f7520>                                                                                                                                                                                       
08      01/08/19 19:18:37.344   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1 <0x728f7520>                                                                                                                                         
08      01/08/19 19:18:37.344   JobHandler_LuaUPnP::HandleActionRequest argument SceneNum=14 <0x728f7520>                                                                                                                                                                                           
08      01/08/19 19:18:37.344   Scene::RunScene running 14 Return <0x728f7520>                                                                                                                                                                                                                       
08      01/08/19 19:18:37.349   JobHandler_LuaUPnP::HandleActionRequest device: 17 service: urn:micasaverde-com:serviceId:HouseModes1 action: ^[[36;1mSetHMode^[[0m <0x728f7520>                                                                                                                     
08      01/08/19 19:18:37.349   JobHandler_LuaUPnP::HandleActionRequest argument newHModeValue=1 <0x728f7520>                                                                                                                                                                                       
06      01/08/19 19:18:37.363   Device_Variable::m_szValue_set device: 17 service: urn:micasaverde-com:serviceId:HouseModes1 variable: ^[[35;1mHMode^[[0m was: 2 now: 1 #hooks: 8 upnp: 0 skip: 0 v:0x1004820/NONE duplicate:0 <0x775c8320>                                                         
07      01/08/19 19:18:37.363   Event::Evaluate 1  scene Sunset-50m Lighting wrong house mode 2 repeat 0/0 <0x775c8320>                                                                                                                                                                             
07      01/08/19 19:18:37.363   Event::Evaluate 9  scene Sunset+20m Evening Lighting wrong house mode 2 repeat 0/0 <0x775c8320>                                                                                                                                                                     
07      01/08/19 19:18:37.364   Event::Evaluate 13  scene HVAC @Sleep is false repeat 0/0 <0x775c8320>                                                                                                                                                                                               
07      01/08/19 19:18:37.364   Event::Evaluate 14  scene HVAC @Wake/Home is true users: allow:1 <0x775c8320>                                                                                                                                                                                       
08      01/08/19 19:18:37.364   Scene::RunScene running 21 HVAC @Wake/Home <0x775c8320>                                                                                                                                                                                                             
08      01/08/19 19:18:37.364   JobHandler_LuaUPnP::HandleActionRequest device: 9 service: urn:upnp-org:serviceId:TemperatureSetpoint1_Heat action: ^[[36;1mSetCurrentSetpoint^[[0m <0x775c8320>                                                                                                     
08      01/08/19 19:18:37.365   JobHandler_LuaUPnP::HandleActionRequest argument NewCurrentSetpoint=73 <0x775c8320>                                                                                                                                                                                 
08      01/08/19 19:18:37.366   JobHandler_LuaUPnP::HandleActionRequest device: 9 service: urn:upnp-org:serviceId:TemperatureSetpoint1_Cool action: ^[[36;1mSetCurrentSetpoint^[[0m <0x775c8320>                                                                                                     
08      01/08/19 19:18:37.366   JobHandler_LuaUPnP::HandleActionRequest argument NewCurrentSetpoint=74 <0x775c8320>                                                                                                                                                                                 
08      01/08/19 19:18:37.367   JobHandler_LuaUPnP::HandleActionRequest device: 7 service: urn:upnp-org:serviceId:TemperatureSetpoint1_Heat action: ^[[36;1mSetCurrentSetpoint^[[0m <0x775c8320>                                                                                                     
08      01/08/19 19:18:37.367   JobHandler_LuaUPnP::HandleActionRequest argument NewCurrentSetpoint=72 <0x775c8320>                                                                                                                                                                                 
08      01/08/19 19:18:37.368   JobHandler_LuaUPnP::HandleActionRequest device: 7 service: urn:upnp-org:serviceId:TemperatureSetpoint1_Cool action: ^[[36;1mSetCurrentSetpoint^[[0m <0x775c8320>                                                                                                     
08      01/08/19 19:18:37.368   JobHandler_LuaUPnP::HandleActionRequest argument NewCurrentSetpoint=74 <0x775c8320>                                                                                                                                                                                 
07      01/08/19 19:18:37.369   Event::Evaluate 17  scene Palm Christmas OFF is false repeat 0/0 <0x775c8320>                                                                                                                                                                                       
07      01/08/19 19:18:37.369   Event::Evaluate 18  scene Sunset-20m Lighting wrong house mode 2 repeat 0/0 <0x775c8320>                                                                                                                                                                             
07      01/08/19 19:18:37.370   Event::Evaluate 19  scene Ground-Level @night is true users: allow:1 <0x775c8320>                                                                                                                                                                                   
08      01/08/19 19:18:37.370   Scene::RunScene running 27 Ground-Level @night <0x775c8320>                                                                                                                                                                                                         
08      01/08/19 19:18:37.370   JobHandler_LuaUPnP::HandleActionRequest device: 101 service: urn:upnp-org:serviceId:Dimming1 action: ^[[36;1mSetLoadLevelTarget^[[0m <0x775c8320>                                                                                                                   
08      01/08/19 19:18:37.370   JobHandler_LuaUPnP::HandleActionRequest argument newLoadlevelTarget=15 <0x775c8320>                                                                                                                                                                                 
06      01/08/19 19:18:37.371   Device_Variable::m_szValue_set device: 101 service: urn:upnp-org:serviceId:Dimming1 variable: ^[[35;1mLoadLevelTarget^[[0m was: 0 now: 15 #hooks: 0 upnp: 0 skip: 0 v:0xfd6e30/NONE duplicate:0 <0x775c8320>                                                         
01      01/08/19 19:18:37.373   ^[[31;1mluup_log:20: SensorMqtt plugin: Device: 17 Variable: HMode Value 2 => 1^[[0m <0x775c8320>                                                                                                                                                                   
01      01/08/19 19:18:37.376   ^[[31;1mluup_log:20: SensorMqtt plugin: Publish MQTT message on topic: Vera/50000796/HouseModes1/17 with value:{"DeviceId":17,"DeviceName":"House Modes Plugin","DeviceType":"urn:schemas-micasaverde-com:device:HouseModes:1","HMode":1,"OldHMode":2,"RoomId":0,"Roo
06      01/08/19 19:18:37.378   Device_Variable::m_szValue_set device: 20 service: urn:upnp-sensor-mqtt-se:serviceId:SensorMqtt1 variable: ^[[35;1mmqttLastMessage^[[0m was: {"Payload":{"Alias":87,"City":"Wrightsville Beach","DeviceId":87,"DeviceName":"Landscape 1-4","DeviceType":"urn:schemas-
08      01/08/19 19:18:37.379   JobHandler_LuaUPnP::HandleActionRequest device: 0 service: urn:micasaverde-com:serviceId:HomeAutomationGateway1 action: ^[[36;1mSetHouseMode^[[0m <0x775c8320>                                                                                                       
08      01/08/19 19:18:37.379   JobHandler_LuaUPnP::HandleActionRequest argument Mode=1 <0x775c8320>                                                                                                                                                                                                 
06      01/08/19 19:18:37.380   Device_Variable::m_szValue_set device: 46 service: urn:micasaverde-com:serviceId:SecuritySensor1 variable: ^[[35;1mArmed^[[0m was: 1 now: 0 #hooks: 0 upnp: 0 skip: 0 v:0xcb82a8/NONE duplicate:0 <0x775c8320>                                                       
06      01/08/19 19:18:37.381   Device_Variable::m_szValue_set device: 56 service: urn:micasaverde-com:serviceId:SecuritySensor1 variable: ^[[35;1mArmed^[[0m was: 1 now: 0 #hooks: 0 upnp: 0 skip: 0 v:0xcb82a8/NONE duplicate:0 <0x775c8320>                                                       
06      01/08/19 19:18:37.382   Device_Variable::m_szValue_set device: 52 service: urn:micasaverde-com:serviceId:SecuritySensor1 variable: ^[[35;1mArmed^[[0m was: 1 now: 0 #hooks: 0 upnp: 0 skip: 0 v:0xcb82a8/NONE duplicate:0 <0x775c8320>                                                       
06      01/08/19 19:18:37.383   Device_Variable::m_szValue_set device: 41 service: urn:micasaverde-com:serviceId:SecuritySensor1 variable: ^[[35;1mArmed^[[0m was: 1 now: 0 #hooks: 0 upnp: 0 skip: 0 v:0xcb82a8/NONE duplicate:0 <0x775c8320>                                                       
06      01/08/19 19:18:37.385   Device_Variable::m_szValue_set device: 17 service: urn:micasaverde-com:serviceId:HouseModes1 variable: ^[[35;1mMessage^[[0m was:  now:  #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:1 <0x775c8320>                                                             
04      01/08/19 19:18:37.386   <Job ID="9299" Name="" Device="17" Created="2019-01-08 19:18:37" Started="2019-01-08 19:18:37" Completed="2019-01-08 19:18:37" Duration="0.35969000" Runtime="0.23410000" Status="Successful" LastNote=""/> <0x775c8320>                                             
Three Vera-3 (Home, Seasonal 1 & 2) - Firmware: 1.5.622,   Zwave: 3.20 L:1
One Vera-Edge (Dependent) - Firmware: 1.7.1707, Zwave: 4.5 L:1

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: House Modes plugin triggers scenes before House Mode is actually changed
« Reply #1 on: January 08, 2019, 11:08:08 pm »
Reading through your log I am concluding that you assume that the device variable change of the house mode plugin is equal to your vera's housemode attribute.
They are in fact two different variables and the plugin syncs the variable to the attribute. Unfortunately the more time I spend on the vera, the more I am convinced that the luup engine was written and tested on a much faster machine and then built for openWRT MIPS without consideration of a lot of timing issues due to the much slower CPU.

Your house mode triggered scenes are triggered by the housemode plugin device variable but the scenes are checking for the vera's housemode which has not yet been updated by the plugin yet.

My suggestion to you would be to put a delay in the lua code for these scene to trigger.
For example, trigger these scenes from the return scene using the following code:

Code: [Select]
local scnid= ##your scene number##
luup.sleep (200)
luup.call_action("urn.micasaverde-com:serviceId:HomeAutomationGateway1","RunScene",{SceneNum="scnid"},0)

or maybe a luup.call_delay.
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 akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +290/-70
  • "Less is more"
Re: House Modes plugin triggers scenes before House Mode is actually changed
« Reply #2 on: January 09, 2019, 03:08:27 am »
Definitely not a luup.sleep().  A delay of that long will likely restart the Luup engine.  Use luup.delay() every time.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: House Modes plugin triggers scenes before House Mode is actually changed
« Reply #3 on: January 09, 2019, 03:28:08 am »
200 is only 200ms... It works for one of my plugins. And it seems like it is not freezing
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 akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +290/-70
  • "Less is more"
Re: House Modes plugin triggers scenes before House Mode is actually changed
« Reply #4 on: January 09, 2019, 03:32:49 am »
Oops, yes.  Not paying attention!  However, I do always try to avoid luup.sleep() as a matter of policy!
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: House Modes plugin triggers scenes before House Mode is actually changed
« Reply #5 on: January 09, 2019, 03:47:29 am »
Oops, yes.  Not paying attention!  However, I do always try to avoid luup.sleep() as a matter of policy!

Yeah I am with you. It is just a lazy way to do it. I generally would recommend the luup.call_delay which requires creating a function. In later version of the luup engine it seems like luup.sleep no longer gets the entire thread to sleep but I may be wrong.
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 akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +290/-70
  • "Less is more"
Re: House Modes plugin triggers scenes before House Mode is actually changed
« Reply #6 on: January 09, 2019, 05:07:55 am »
There are two threads per device plugin.   Not sure how the work is allocated between, but there is some specialisation.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline blacey

  • Sr. Member
  • ****
  • Posts: 251
  • Karma: +30/-1
Re: House Modes plugin triggers scenes before House Mode is actually changed
« Reply #7 on: January 09, 2019, 08:39:32 am »
Reading through your log I am concluding that you assume that the device variable change of the house mode plugin is equal to your vera's housemode attribute.
They are in fact two different variables and the plugin syncs the variable to the attribute.
Your house mode triggered scenes are triggered by the housemode plugin device variable but the scenes are checking for the vera's housemode which has not yet been updated by the plugin yet.

Hi Patrick,

Thanks for the suggestion.  Yes, I realize that the plugin device 17 ultimately sets the house mode on device 0 (the controller) after some delay that can be configured under Modes; the delay defaults to 30 seconds and is currently set to 1. 

That said, IMHO the settings, triggering and mode querying should be self-consistent because the scenes are all configured to either set or trigger on the House Modes Plugin (device 17). I have included screenshots below for a pretty simple event-driven scene execution scenario.

Return (manually run in this use case) - sets House Mode Plugin to Home
Sunset-50m Lighting (triggers on House Mode change Home, valid in Home mode)

If the scene mode short-circuiting uses device 0 for scenes that are hooked / triggers on device 17, then I would consider that a bug with either the house modes plugin or the scene mode filtering because they should be semantically equivalent - if you guys agree, I will contact Support to confirm.

As a work-around I considered using luup to run the scenes directly using the Return scene luup code but that usurps the foundational event triggering and filtering paradigm built into the Vera eliminating the possibility to use luup code within the house mode change trigger on the "triggered" scenes (like only continue after dark) and buries the triggering logic in scene Luup blocks making it difficult to review/debug - I so wish the Vera had built-in support for documenting scenes using markup. 

In order to try to preserve the scene triggering as closely to what I think Vera intended, I will try changing the Return scene Luup Code to set the house mode on device 0 (controller ).  However, given that the scene triggers are hooked to the House Modes device 17 variable, I suspect that I will need to set the plugin value after setting is on device 0 so I suspect I will have to move it from the Return scene's "Immediately" to the luup code block or change immediately to use a 1 second delay (yuck).

Thanks,
Bruce
Three Vera-3 (Home, Seasonal 1 & 2) - Firmware: 1.5.622,   Zwave: 3.20 L:1
One Vera-Edge (Dependent) - Firmware: 1.7.1707, Zwave: 4.5 L:1

Offline rigpapa

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1121
  • Karma: +187/-3
Re: House Modes plugin triggers scenes before House Mode is actually changed
« Reply #8 on: January 09, 2019, 09:27:23 am »
Looking at the code for the HouseModes plugin, it looks like if you use the SetHMode action on that plugin to set the house mode, it immediately changes its own variable HMode. That in turn will trigger scenes that use the HouseModes plugin as a trigger (immediately).

This is defective, IMO, because it ignores the time delay that Vera goes through when changing the house mode. It is also very odd because the plugin also attempts to go into a wait loop to wait until the delay expires, and then does nothing when it does--the code that sets the plugin's HMode variable there is commented out. So it looks like the intent was there to handle it right, but the way it works now is either an original bug, or a well-intentioned change made later that isn't correct.

The remainder of the plugin works properly (scanning for house mode changes made by facilities other than the plugin). So, I would simply not use the SetHMode action on the plugin to change the house mode--do not use the HouseModes plugin to change the house mode, just to monitor/trigger on it. Use the HomeAutomationGateway action SetHouseMode to change the house mode instead.
Author of Reactor, DelayLight, SiteSensor, Rachio, Deus Ex Machina II, Intesis WMP Gateway, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3, Lite. Hassio, Slapdash.

Offline rigpapa

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1121
  • Karma: +187/-3
Re: House Modes plugin triggers scenes before House Mode is actually changed
« Reply #9 on: January 09, 2019, 11:37:42 am »
Looking at the code for the HouseModes plugin, it looks like if you use the SetHMode action on that plugin to set the house mode, it immediately changes its own variable HMode. That in turn will trigger scenes that use the HouseModes plugin as a trigger (immediately).

This is defective, IMO, because it ignores the time delay that Vera goes through when changing the house mode. It is also very odd because the plugin also attempts to go into a wait loop to wait until the delay expires, and then does nothing when it does--the code that sets the plugin's HMode variable there is commented out. So it looks like the intent was there to handle it right, but the way it works now is either an original bug, or a well-intentioned change made later that isn't correct.

The remainder of the plugin works properly (scanning for house mode changes made by facilities other than the plugin). So, I would simply not use the SetHMode action on the plugin to change the house mode--do not use the HouseModes plugin to change the house mode, just to monitor/trigger on it. Use the HomeAutomationGateway action SetHouseMode to change the house mode instead.

I could be a huge cad and just recommend Reactor as a fix for this, since Reactor handles housemodes with aplomb, but I'll readily admit if you're already using the HouseModes plugin in conjunction with... ahem... other tools... installing Reactor is a big hammer for a small nail.

It appears the original author of this plugin is no longer here (messages now associated with a locked guest account), so in the interest of being a good community citizen, here is my take at an update HouseModes plugin. Changes made:

* The plugin's house mode state variable HMode is now only set when it changes, at the point where the change is detected, meaning scenes will only fire on actual change and when Vera has completed the delay and any attribute-based references or triggers will align;
* Improve the messages displayed by the plugin and those logged (both debug and non-debug modes);
* Separate current state from target state on the UI7 dashboard/control panel buttons so they're not jumping around during the delay period;
* Add a new PrevHMode state variable containing the previous house mode, so you can check in your code for specific transitions (e.g. went from Night to Home);
* Cleaned up the code. It's much smaller.

ZIP attached.

EDIT: Note for future readers: install the plugin from the plugin marketplace before updating with this ZIP file; the ZIP file is not a complete set of files, it's just an update.
« Last Edit: January 09, 2019, 11:48:04 am by rigpapa »
Author of Reactor, DelayLight, SiteSensor, Rachio, Deus Ex Machina II, Intesis WMP Gateway, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3, Lite. Hassio, Slapdash.

Offline blacey

  • Sr. Member
  • ****
  • Posts: 251
  • Karma: +30/-1
Re: House Modes plugin triggers scenes before House Mode is actually changed
« Reply #10 on: January 09, 2019, 11:46:26 am »
It appears the original author of this plugin is no longer here (messages now associated with a locked guest account), so in the interest of being a good community citizen, here is my take at an update HouseModes plugin.

Thanks Patrick - I'll take a look at your refactored plugin.  For now, changing my Return scene to simply use Luup Code, and only that, as follows:

Code: [Select]
local homeMode = 1
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "SetHouseMode", { Mode=homeMode }, 0)

actually triggers the cascade of events needed to run all my scenes as can be seen below.

Code: [Select]
08      01/09/19 11:31:58.110   JobHandler_LuaUPnP::HandleActionRequest device: 0 service: urn:micasaverde-com:serviceId:HomeAutomationGateway1 action: RunScene <0x73229520>
08      01/09/19 11:31:58.110   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1 <0x73229520>
08      01/09/19 11:31:58.110   JobHandler_LuaUPnP::HandleActionRequest argument action=RunScene <0x73229520>
08      01/09/19 11:31:58.111   JobHandler_LuaUPnP::HandleActionRequest argument SceneNum=14 <0x73229520>
08      01/09/19 11:31:58.111   JobHandler_LuaUPnP::HandleActionRequest argument rand=0.9434472640243414 <0x73229520>
08      01/09/19 11:31:58.111   Scene::RunScene running 14 Return <0x73229520>
08      01/09/19 11:31:58.112   JobHandler_LuaUPnP::HandleActionRequest device: 0 service: urn:micasaverde-com:serviceId:HomeAutomationGateway1 action: SetHouseMode <0x73229520>
08      01/09/19 11:31:58.112   JobHandler_LuaUPnP::HandleActionRequest argument Mode=1 <0x73229520>
06      01/09/19 11:31:58.113   Device_Variable::m_szValue_set device: 46 service: urn:micasaverde-com:serviceId:SecuritySensor1 variable: Armed was: 1 now: 0 #hooks: 0 upnp: 0 skip: 0 v:0xa4b270/NONE duplicate:0 <0x73229520>
07      01/09/19 11:31:58.939   RAServerSync::SendAlert 0xfb5db0 PK_Event 20244025572 retries 0 URL https://vera-us-oem-event11.mios.com/event/event/event age: 0 file:  err: 0 sess: 000000006C89005C36463CFF4336B13D1293E8 serv: vera-us-oem-event11.mios.com/vera-us-oem-event11.mios.com <0x7746a520>
06      01/09/19 11:32:03.348   Device_Variable::m_szValue_set device: 31 service: urn:micasaverde-com:serviceId:EnergyMetering1 variable: Watts was: 0.000 now: 0.000 #hooks: 1 upnp: 0 skip: 0 v:0xd59fa8/NONE duplicate:1 <0x7726a520>
06      01/09/19 11:32:05.101   Device_Variable::m_szValue_set device: 17 service: urn:micasaverde-com:serviceId:HouseModes1 variable: HMode was: 2 now: 1 #hooks: 8 upnp: 0 skip: 0 v:0xd972f0/NONE duplicate:0 <0x75a6a520>
07      01/09/19 11:32:05.101   Event::Evaluate 1  scene Sunset-50m Lighting lua returned false repeat 0/0 <0x75a6a520>
07      01/09/19 11:32:05.101   Event::Evaluate 9  scene Sunset+20m Evening Lighting is true users: allow:1 <0x75a6a520>
08      01/09/19 11:32:05.102   Scene::RunScene running 12 Sunset+20m Evening Lighting <0x75a6a520>
07      01/09/19 11:32:05.111   Event::Evaluate 13  scene HVAC @Sleep is false repeat 0/0 <0x75a6a520>
07      01/09/19 11:32:05.111   Event::Evaluate 14  scene HVAC @Wake/Home is true users: allow:1 <0x75a6a520>
08      01/09/19 11:32:05.112   Scene::RunScene running 21 HVAC @Wake/Home <0x75a6a520>
07      01/09/19 11:32:05.129   Event::Evaluate 17  scene Palm Christmas OFF is false repeat 0/0 <0x75a6a520>
07      01/09/19 11:32:05.130   Event::Evaluate 18  scene Sunset-20m Lighting lua returned false repeat 0/0 <0x75a6a520>
07      01/09/19 11:32:05.130   Event::Evaluate 19  scene Ground-Level @night lua returned false repeat 0/0 <0x75a6a520>
01      01/09/19 11:32:05.131   luup_log:20: SensorMqtt plugin: Device: 17 Variable: HMode Value 2 => 1 <0x75a6a520>
01      01/09/19 11:32:05.137   luup_log:20: SensorMqtt plugin: Publish MQTT message on topic: Vera/50000796/HouseModes1/17 with value:{"DeviceId":17,"DeviceName":"House Modes Plugin","DeviceType":"urn:schemas-micasaverde-com:device:HouseModes:1","HMode":1,"OldHMode":2,"RoomId":0,"RoomName":"No Room","ServiceId":"urn:micasaverde-com:serviceId:HouseModes1","Time":1547051525,"Variable":"HMode"} <0x75a6a520>

I was under the impression that the HouseModes plugin was developed/maintained by MIOS/Vera.
« Last Edit: January 09, 2019, 01:41:03 pm by blacey »
Three Vera-3 (Home, Seasonal 1 & 2) - Firmware: 1.5.622,   Zwave: 3.20 L:1
One Vera-Edge (Dependent) - Firmware: 1.7.1707, Zwave: 4.5 L:1

Offline blacey

  • Sr. Member
  • ****
  • Posts: 251
  • Karma: +30/-1
Re: House Modes plugin triggers scenes before House Mode is actually changed
« Reply #11 on: January 09, 2019, 01:51:11 pm »
It appears the original author of this plugin is no longer here (messages now associated with a locked guest account), so in the interest of being a good community citizen, here is my take at an update HouseModes plugin.

Hi Patrick, I reviewed your plugin changes and the improvements are good.  It is unfortunate that the house mode is an attribute of the vera and not a variable that can be hooked to avoid polling.  Any thoughts on making your changes more broadly available?

I could be a huge cad and just recommend Reactor as a fix for this, since Reactor handles housemodes with aplomb, but I'll readily admit if you're already using the HouseModes plugin in conjunction with... ahem... other tools... installing Reactor is a big hammer for a small nail.

I have stumbled across your Reactor plugin in the past and really liked what I saw but haven't taken the time to install it or play with it because I tend to keep my Vera close to bare metal and have found that simply decorating triggers and scenes with a little bit of lua typically works well for me.  I'll try to take Reactor for a spin in the near future...

Thanks again for your help.
Three Vera-3 (Home, Seasonal 1 & 2) - Firmware: 1.5.622,   Zwave: 3.20 L:1
One Vera-Edge (Dependent) - Firmware: 1.7.1707, Zwave: 4.5 L:1

Offline rigpapa

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1121
  • Karma: +187/-3
Re: House Modes plugin triggers scenes before House Mode is actually changed
« Reply #12 on: January 09, 2019, 02:02:55 pm »
It appears the original author of this plugin is no longer here (messages now associated with a locked guest account), so in the interest of being a good community citizen, here is my take at an update HouseModes plugin.

Any thoughts on making your changes more broadly available?

I have no problems distributing the changes. I'm not sure what the original author's license is, and it's not listed in the plugin marketplace. If you're talking about putting it in the marketplace, I'll leave that to others, I was just trying to help out quickly here.
Author of Reactor, DelayLight, SiteSensor, Rachio, Deus Ex Machina II, Intesis WMP Gateway, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3, Lite. Hassio, Slapdash.