Using Json to activate a scene

Hi is there anyone out there who know how to activate a scene using Json?

Never mind, I found out.

Hi,

Could you post your findings ? I need to perform a similar task…

Thanks !!

From the wiki: http://wiki.micasaverde.com/index.php/Data_Provider_Catalog_Plugin

To execute a Scene (aka CommandGroup), send a command 370 (Execute Command Group) with the parameter 28 (PK_CommandGroup) set to the scene number, which you got from the user_data request. For example, scene_5 in the json is scene id 5. Send it to the ‘general info plugin’, which is a device with the category 61 (DEVICECATEGORY_General_Info_Plugins_CONST), and get a return response:

http://192.168.80.1:3451/messagesend?from=1&to=61&target=c&response=r&type=1&id=370&28=5

Cool ;D

Thats a quick interface to set devices or activate scenes.
(I put some usefull ones in my bookmarks!)

Now if I could use something similar to enable/disable scene timers, I might not need to learn Lua… ???

HF, Chris

Is there a way to issue this request outside of the local network when not using the findvera.com service?

I tried:

http://my.domain.com:3451/sendmessage?blah
https://my.domain.com:3451/sendmessage?blah
http://my.domain.com/user/password/3451/sendmessage?blah
https://my.domain.com/user/password/3451/sendmessage?blah

but could not connect. Is this not possible without the service or must I be doing something wrong?

My understanding of how FindVera works, and its intimate tie-in with Vera through port forwarding (more likely an outbound port established by Vera!) at your home network, leads me to believe none of the URL constructs you’ve tried would “make sense” outside of that context.

In particular, port 3451 is not “special” except to Vera, and surely will not conjure up a service/server - much less a Vera-aware one - anywhere else.

Let us all know if you discover a “way in” though!

[quote=“neilios, post:6, topic:164260”]Is there a way to issue this request outside of the local network when not using the findvera.com service?

I tried:

http://my.domain.com:3451/sendmessage?blah
https://my.domain.com:3451/sendmessage?blah
http://my.domain.com/user/password/3451/sendmessage?blah
https://my.domain.com/user/password/3451/sendmessage?blah

but could not connect. Is this not possible without the service or must I be doing something wrong?[/quote]

Search wiki on exact syntax.
Vera doesn’t care where the command come from, so as long as you setup port forwarding you should be fine. The only thing is - if you can send a command from outside - someone else can too.

While I concur with 325xi’s assessment, it bears noting (for the uninitiated) that “port forwarding” is non-trivial at best, and made slightly more difficult if your home router’s IP address tends to change over time. That would necessitate a DynDNS.org account, and a router capable of “reporting in” periodically with that system.

Lastly, there are routers and Internet service providers out there whose IP addressing scheme makes “phoning home” near impossible, because they use proxying and non-routable external IP’s like 10.xxx.xxx.xxx. Just another hurdle the unsuspecting hobbyist might encounter.

Meanwhile, FindVera.com - being Vera’s only known “beacon” destination - will always work because Vera elects to handshake directly with that service, and most importantly, does so through a secure HTTPS connection!

I have forwarding all set up - I was trying the mentioned tests from outside my network yesterday and when I try them within my network I get the same issue!

This fails with a no connection error:

http://192.168.81.1:3451/data_request?id=alldata&output_format=xml

Looks like port 3451 is not active/working or the syntax has changed? I have the latest firmware version - did the port number or syntax change? Do I need to enable something for this to happen?

I have been able to use requests on port 49451 without any issues, it’s just this one that seems odd.

Neilios

Neilios, from a command prompt in Windows, can you PING Vera’s 192.168.81.1 address successfully?

Does the request work at all with output_format=json?

Just curious. Sounds like you know what you’re doing, network-wise.

Thanks for checking…

I can log in over SSL on port 22, get to the web interface on port 80, send GET requests to port 49451 all without issue. No format on this port 3451 works, I just get a no connection error - it’s like the port is not being listened to.

Neilios

Vera’s LISTEN ports, in 1.0.862, are as follows:

root@HomeControl:/tmp/log/cmh# netstat -a | grep LIST tcp 0 0 0.0.0.0:49451 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN tcp 0 0 localhost:8081 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:3481 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:3482 0.0.0.0:* LISTEN
The last two, [tt]348x[/tt], are because I have two Serial/USB devices connected and [tt]serproxy[/tt]/[tt]ser2net[/tt] has setup Listeners to handle. Port 80 is the in-build webserver for Admin, 22 is SSH, and 53 is DNS (from memory). Not sure what Port 8081 is, but it’s been localized.

That leaves Port 49451. Searching for 49451 in the Wiki results in what you need.

For example, a URL like:

http://192.168.x.yyy:49451/data_request?id=user_data&output_format=xml

will return data about your Vera config (at least, it does for me). I suspect the other commands referenced above will also work, but haven’t tried them.

MCV: Can you fixup the http://wiki.micasaverde.com/index.php/Data_Provider_Catalog_Plugin with the port changes in the Luup versions? Not sure if there are other changes outside of the port# stuff, so I wasn’t game to touch it :wink:

I have been able to use requests on port 49451 without any issues

Port 3451 is pre-Luup, and it’s now port 49451. There’s probably tons of stuff in the wiki that doesn’t apply to Luup. The entire data provider catalog page no longer applies–that module doesn’t even exist in Luup. Look at the Luup requests and Luup extensions pages.