Luup help please

Evening all

I have two luup codes and like to combine them but I don’t have a clue how.

1st one sends prowl message if tripped / 2nd will cancel the message sent to prowl if vswitch is in 1 position. I hope this will work.

– Inform me when the alarm system is armed.
luup.inet.wget(“http://www.prowlapp.com/publicapi/add?apikey=xxxxxxxx&application=Vera&event=Armed&description=Study+Light+On&priority=-1”)
return true

local AwayStatus = luup.variable_get(“urn:upnp-org:serviceId:VSwitch1”, “Status”, 153)
if (AwayStatus == “1”) then
return false

Thanks in advance

Rich
end

Sent from my iPad using Tapatalk

umm, are you sure u wanted to post your api key?

Corrected

Thanks

Sent from my iPad using Tapatalk

I changed code around and put the prowl code on bottom and seems to work as I need to but it kept coming up with failed in luup test? Any ideas?

Sent from my iPad using Tapatalk

Not working correctly.
Am currently wanting a code for the following. If I have virtual switch to HOME then it disables the prowl and Vera alert being sent. If have AWAY selected then it allows prowl and Vera alert to run if triggered. I know am not far away as code does work as I said BUT when selected HOME and run scene it doesn’t send the alerts and also doesn’t switch light on.

Any help would be great thanks.

Rich

Sent from my iPad using Tapatalk

Rich1983,

In your last post you are suddenly talking about a light, which you hadn’t mentioned before. Perhaps you’d better describe in better detail what you are trying to achieve, because it’s not at all obvious to me.

Include in your description:

  • What causes this scene to be triggered (or scheduled).
  • What the scene’s actions are.
  • How you want (each of) the actions to vary based on the virtual switch status.

Also you say you have modified your Luup code from the version that you posted at the top of the thread. What does your code look like now?

[quote=“futzle”]Rich1983,

In your last post you are suddenly talking about a light, which you hadn’t mentioned before. Perhaps you’d better describe in better detail what you are trying to achieve, because it’s not at all obvious to me.

Include in your description:

  • What causes this scene to be triggered (or scheduled).
  • What the scene’s actions are.
  • How you want (each of) the actions to vary based on the virtual switch status.

Also you say you have modified your Luup code from the version that you posted at the top of the thread. What does your code look like now?[/quote]

  1. am using a light for testing this with so just myself triggering the light manually. As will be used for gate etc
  2. actions, when virtual switch is in 0 position I like there to be prowl and vera alerts sent. When in position 1 I like prowl and Vera alerts to be cancelled.

Copy of code now.

local AwayStatus = luup.variable_get(“urn:upnp-org:serviceId:VSwitch1”, “Status”, 153)
if (AwayStatus == “1”) then
return false
end
– Inform me when the alarm system is armed.
luup.inet.wget(“http://www.prowlapp.com/publicapi/add?apikey=xxxxxxxxxxx&application=Vera&event=Armed&description=Study+Light+On&priority=-1”)
return true

Thank you for help

Rich

Sent from my iPad using Tapatalk

You’re testing with a light. Is the light something that you are using to cause the scene to run, or is the scene causing the light to change?

Myself switching light on to run scene

Sent from my iPhone using Tapatalk

So when the virtual switch is off (“AWAY”) you want the notifications sent. And you say this is happening fine.

When the virtual switch is on (“HOME”) you want no notifications sent. This should be happening already with your existing code. Yet you’re saying that it’s not, that you’re getting notifications anyway?

[quote=“futzle”]So when the virtual switch is off (“AWAY”) you want the notifications sent. And you say this is happening fine.

When the virtual switch is on (“HOME”) you want no notifications sent. This should be happening already with your existing code. Yet you’re saying that it’s not, that you’re getting notifications anyway?[/quote]

I see what I was doing wrong. I was trying to Run the scene from Automation tab to test and that’s why light wasn’t coming on, I now tested it with switching light on in devices and works a treat and doesn’t send prowl or Vera alerts

Working all good. Just operator error opps

Rich

Sent from my iPad using Tapatalk