The Vera Community forums have moved!

Advanced => Plugins & Plugin Development => Programming => openLuup => Topic started by: RHCPNG on February 14, 2018, 12:59:28 pm

Title: Action House Mode in workflow state
Post by: RHCPNG on February 14, 2018, 12:59:28 pm
I noticed that there is no action for setting the house mode for openluup in a workflow state. Can this be added? I can set it with lua code, but shouldn?t it just be there as a basic feature? Or am I missing something?

Let me know.
Title: Re: Action House Mode in workflow state
Post by: RHCPNG on February 15, 2018, 03:31:53 am
@akbooer
I found another bug in the house mode functionality. When I set the variable of openLuup with this line:

luup.attr_set ("Mode", 2)

Then the house mode does change, but the variable on the openluup device doesn't change with it.
Title: Re: Action House Mode in workflow state
Post by: akbooer on February 15, 2018, 03:55:31 am
I haven't tried this on Vera, but I don't think you should use attr_set to change modes, that's why there's an action to do it.

I may be wrong, in which case I'll change this to work as you expect.

Title: Re: Action House Mode in workflow state
Post by: RHCPNG on February 15, 2018, 04:03:14 am
I haven't tried this on Vera, but I don't think you should use attr_set to change modes, that's why there's an action to do it.

I may be wrong, in which case I'll change this to work as you expect.



I'm not doing this on Vera, but in AltUI on openLuup. I'm setting the house mode in a workflow state. That's the problem, there is no predefined action here. So, I use lua.
Title: Re: Action House Mode in workflow state
Post by: akbooer on February 15, 2018, 05:25:54 am
I realise you're using openLuup, but was just trying to compare with Vera's native behaviour.

There is an action for this, see
http://wiki.micasaverde.com/index.php/Luup_UPnP_Variables_and_Actions#HomeAutomationGateway1

SetHouseMode
Title: Re: Action House Mode in workflow state
Post by: RHCPNG on February 15, 2018, 05:30:13 am
I realise you're using openLuup, but was just trying to compare with Vera's native behaviour.

There is an action for this, see
http://wiki.micasaverde.com/index.php/Luup_UPnP_Variables_and_Actions#HomeAutomationGateway1

SetHouseMode


Ah, no sorry. I'm not setting the house mode of Vera, but that of openLuup.
Title: Re: Action House Mode in workflow state
Post by: akbooer on February 15, 2018, 05:40:51 am
Sorry, I'm not being clear. 

In the spirit of trying to emulate Vera, if luup.attr_set() actually changes mode correctly on Vera, then then same should be so on openLuup.  As it is, there is an action which works correctly in both cases, so I think I'm simply saying that you shouldn't normally want use luup.attr_set() for this.

I know how to make it work, but I don't know if I should do that.  I will test when I can on Vera.
Title: Re: Action House Mode in workflow state
Post by: RHCPNG on February 15, 2018, 11:15:23 am
Ok, I will try the lua action command for the openluup device.

But the question remains. Can you make the action available in a workflow state? That way lua would?t be needed.
Title: Re: Action House Mode in workflow state
Post by: RHCPNG on February 15, 2018, 11:30:31 am
Or maybe it should be a house mode ALTUI action. I don?t know how the icons of AltUI relate to the variable of openluup. Just want to set the house mode of AltUI via a workflow state.
Title: Re: Action House Mode in workflow state
Post by: akbooer on February 15, 2018, 11:44:09 am
The house mode in not AltUI's, but Vera's or openLuup's.  The action IS already defined, but for device #0. 

I'm not familiar with workflows, but I imagine that device #0 is not a selectable option.  I could give the openLuup plugin an action to do this, if that helps.
Title: Re: Action House Mode in workflow state
Post by: amg0 on February 15, 2018, 11:47:04 am
The house mode in not AltUI's, but Vera's or openLuup's.  The action IS already defined, but for device #0. 

I'm not familiar with workflows, but I imagine that device #0 is not a selectable option.  I could give the openLuup plugin an action to do this, if that helps.

Yes that is Indeed the problem. I did not expose device 0. I need to check if that s possible. But personally I use the House mode plugin.why do not you use it ? It exposes conditions and actions for it
Title: Re: Action House Mode in workflow state
Post by: RHCPNG on February 15, 2018, 11:56:55 am
The house mode in not AltUI's, but Vera's or openLuup's.  The action IS already defined, but for device #0. 

I'm not familiar with workflows, but I imagine that device #0 is not a selectable option.  I could give the openLuup plugin an action to do this, if that helps.

Yes that is Indeed the problem. I did not expose device 0. I need to check if that s possible. But personally I use the House mode plugin.why do not you use it ? It exposes conditions and actions for it

That?s because I want Vera to follow openLuup with the house modes, openLuup should be the primary.
Title: Re: Action House Mode in workflow state
Post by: amg0 on February 15, 2018, 12:32:54 pm
The house mode in not AltUI's, but Vera's or openLuup's.  The action IS already defined, but for device #0. 

I'm not familiar with workflows, but I imagine that device #0 is not a selectable option.  I could give the openLuup plugin an action to do this, if that helps.

Yes that is Indeed the problem. I did not expose device 0. I need to check if that s possible. But personally I use the House mode plugin.why do not you use it ? It exposes conditions and actions for it

That?s because I want Vera to follow openLuup with the house modes, openLuup should be the primary.
What about an open Luup based house mode plugin and one on Vera mirrored by Vera bridge and setting house mode on both in your state actions ?
Title: Re: Action House Mode in workflow state
Post by: RHCPNG on February 15, 2018, 12:41:42 pm
I'm not familiar with workflows, but I imagine that device #0 is not a selectable option.  I could give the openLuup plugin an action to do this, if that helps.


I think this would be the ideal solution in this case. And probably the easiest?
Title: Re: Action House Mode in workflow state
Post by: RHCPNG on February 16, 2018, 03:16:49 am
What would the luup action command be for openluup? I've tried these two, but they won't work:

luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1","SetHouseMode", {Mode = 3}, 0)
luup.call_action("openLuup","SetHouseMode", {Mode = 3}, 2)

*UPDDATE*
Nevermind, forgot the quotation:

luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "SetHouseMode", { Mode="1" }, 0)

An action in the workflows would still be a very nice feature.
Title: Re: Action House Mode in workflow state
Post by: akbooer on February 16, 2018, 05:02:06 am
The latest development branch 2018.02.15 has added the following action to the openLuup device (#2):
hence:

Code: [Select]
luup.call_action("openLuup","SetHouseMode", {Mode = 3}, 2)

will change mode, in addition to the device #0 one you mentioned.

However, this also appears in the available Actions of the openLuup device, so, AFAIK, this should be usable from workflows (and, indeed, scenes.)

Title: Re: Action House Mode in workflow state
Post by: RHCPNG on February 16, 2018, 06:27:17 am
The latest development branch 2018.02.15 has added the following action to the openLuup device (#2):
  • serviceId = "openLuup" (note that this does not use urn: syntax)
  • action = "SetHouseMode"
  • parameter = "Mode"
hence:

Code: [Select]
luup.call_action("openLuup","SetHouseMode", {Mode = 3}, 2)

will change mode, in addition to the device #0 one you mentioned.

However, this also appears in the available Actions of the openLuup device, so, AFAIK, this should be usable from workflows (and, indeed, scenes.)
Very cool, thank you! I can confirm that the action is available in the workflows.

Sent from my SM-G930F using Tapatalk

Title: Re: Action House Mode in workflow state
Post by: Buxton on March 06, 2019, 12:38:58 am
AK, sorry to resurrect an old topic...   I have my house mode variable set to 2 on my two vera bridges, meaning that I want my veras to follow house mode changes that occur in openLuup.   I am trying to remotely trigger a house mode change in openLuup using the following syntax:
Code: [Select]
http://10.17.2.12:3480/data_request?id=lu_action&serviceId=openLuup&action=SetHouseMode,%20{Mode%20=%202}  where 10.17.2.12:3480 is my openLuup box.

But I receive an error message "ERROR: Invalid Service"  when trying to do so.  Is the request syntax wrong??  The error occurs both in a browser and in curl.
Title: Re: Action House Mode in workflow state
Post by: akbooer on March 06, 2019, 03:12:50 am
Well, yes, the syntax is invalid.  Where did you get it from?

You have:

Code: [Select]
http://10.17.2.12:3480/data_request?id=lu_action&serviceId=openLuup&action=SetHouseMode,%20{Mode%20=%202}

But it should, (from memory) be:

Code: [Select]
http://10.17.2.12:3480/data_request?id=lu_action&serviceId=openLuup&action=SetHouseMode&Mode=2&DeviceNum=2

I'm not near a system at the moment, to verify.
Title: Re: Action House Mode in workflow state
Post by: Buxton on March 06, 2019, 06:31:00 pm
OK, that works.

I culled the URL from multiple forum posts as I couldn't find any documentation.  Vera needs to clean-up/remove its scattered documents and create a centralized Wiki.  It's a bit absurd to have to intuit what a command should be....
Title: Re: Action House Mode in workflow state
Post by: akbooer on March 07, 2019, 02:32:48 am
Glad it works now.

You have to discriminate between the syntax of Lua-based action calls and the URLs needed for HTTP action requests.  Yes, the documentation is a complete mess.