GET, POST Requests with C#

  • 144 Views
  • Last Post 01 February 2014
Rod posted this 07 January 2014

Okay,

I've added this to uservoice so those who are keen to see it comment and vote it up. I've added 3.

http://incontrolha.uservoice.com/forums/218427-general/suggestions/5390053-add-actions-to-incontrol-http-get-post-run-file

Any other suggestions post here.

This may be a bit more complex but I was also thinking about adding the the ability to Set Variables, like the Android App Tasker. This would allow better control of Conditions.

Josh

Order By: Standard | Newest | Votes
monkey-magic posted this 09 January 2014

This is about as far as I've gotten.

Now I'm no programmer, just a hack but this code works in Visual Studio Express 2013.

When saved via notepad as xxx.cs and put in pre or post script it doesn't seem to work so I'm not sure what I'm missing.
The http get request goes into sURL = "http"; that line.

Josh


[code]using System;
using System.Net;
using System.IO;

namespace MakeAGETRequest_charp
{
///


/// Summary description for Class1.
///

class Class1
{
static void Main(string[] args)
{
string sURL;
sURL = "http";

WebRequest wrGETURL;
wrGETURL = WebRequest.Create(sURL);

Stream objStream;
objStream = wrGETURL.GetResponse().GetResponseStream();

StreamReader objReader = new StreamReader(objStream);

}
}
}[/code]

Rod posted this 11 January 2014

I'm thinking that the UI should have native support for this instead of writing a script for it(drop down selector to pick type and then a field for information) . It's the backbone of communication to the Internet of things. Ryan, what are your thoughts? Plugins for other wifi devices aren't necessary with this as all(?) have web hooks of some kind.

monkey-magic posted this 11 January 2014

I'm thinking that the UI should have native support for this instead of writing a script for it(drop down selector to pick type and then a field for information) . It's the backbone of communication to the Internet of things. Ryan, what are your thoughts? Plugins for other wifi devices aren't necessary with this as all(?) have web hooks of some kind.


Looking around it appears that there is a chance WiFi makes the 'standard' of Internet of Things. Apparently a lot of home automation things at the CES this year.

I'd agree with a plugin of some sort built into the software to allow control of other items would expand the use of the software and help to mitigate if Z wave doesn't make it.

Josh

Ryan-Scott posted this 14 January 2014

I'm thinking that the UI should have native support for this instead of writing a script for it(drop down selector to pick type and then a field for information) . It's the backbone of communication to the Internet of things. Ryan, what are your thoughts? Plugins for other wifi devices aren't necessary with this as all(?) have web hooks of some kind.


Interesting idea... how do you envision it integrating into InControl?

Rod posted this 14 January 2014

So instead of the two options to insert a file for pre and post you have a tab called actions which you can add actions to the scene like tasker.

Ie. Tasks like tasker

So the options are:

Get
Post
Run file
Pre script
Post script
Etc

You can add as many as you like. Like your conditions. This way you have a nice GUI for scripts.

Rod posted this 14 January 2014

I also agree that Zwave might die off. I'm not sure we need it vs such an already available and secure infrastructure such as Wifi.

Ryan-Scott posted this 14 January 2014

So instead of the two options to insert a file for pre and post you have a tab called actions which you can add actions to the scene like tasker.

Ie. Tasks like tasker

So the options are:

Get
Post
Run file
Pre script
Post script
Etc

You can add as many as you like. Like your conditions. This way you have a nice GUI for scripts.



So you'd want to have the activation of a scene be able to execute HTTP commands? Or are you talking a new device that does an HTTP command to get the status of a device, or perform a POST to turn on/off, etc.?

Ryan-Scott posted this 14 January 2014

I also agree that Zwave might die off. I'm not sure we need it vs such an already available and secure infrastructure such as Wifi.


It's strange to hear these musings about z-wave not making it. Z-wave is strong right now... I just got back from CES and they had by far the largest amount of floor space and booths when compared to anything wifi in the home automation arena. Are there other articles that you guys have seen to suggest it's struggling?

Rod posted this 14 January 2014

"So you'd want to have the activation of a scene be able to execute HTTP commands? Or are you talking a new device that does an HTTP command to get the status of a device, or perform a POST to turn on/off, etc.?"

Could be HTTP commands, running files... etc. It's going to be almost impossible to keep up with the WIFI devices in a year creating plugins for each one when almost all support some sort of POST or GET command. Updating your plugins might be difficult too when they add new wifi devices (WeMo plugin) like the new Belkin Slow Cooker...

" from CES and they had by far the largest amount of floor space and booths when compared to anything wifi in the home automation arena. "

No, I haven't looked for any articles, this is just an extrapolation from my head Z-wave is definitely the widest used protocol with home automation products at the moment but you're creating two wireless communication networks in your house... Why not just create one (wifi) that's used for all your devices. AC dual band networks are eliminating a lot of the old issues of Wifi. Ie. Philips Hue and LimitlessLED are pretty awesome and the current Zwave solution doesn't really work with it (needs constant power) and that zwave dimmer becomes just a communication device to set the level of the LED's (not the colors).

This is obviously just IMHO and I'm just trying to come up with the best use of your development of this awesome product Ryan.

jonfrance posted this 14 January 2014

I don’t think that the home automation market has decided on a single communication protocol, and probably won’t for a long time if it does. I’m not even sure if I could say that I’ve read that it is even leaning one way or another.
I agree that zwave is around to stay for a long while, which is why I decided to start my investment in those products. With large company names manufacturing zwave products and other companies like ADT using them in their systems etc. I don’t see it going anyway anytime soon.

That being said, it is not going to be the only device that I will want to use, and the market is starting to respond to this with things like the Staples Connect System which appears to support multiple protocols (including zwave).
I recently ordered some of the LimitlessLED bulbs to try out as they looked to be the best solution for where I want to put them.
The best thing about InControl software, the company and its developers; and the main reason that I choice this software in the first place, is because of the flexibility. LimitlessLED offer an API (another reason I’m trying them), so I know that I will be able to integrate them into InControl. If I had invested in nearly any other zwave controller software, or dedicated hardware hub, I’m sure that it would be a struggle to do anything not out-the-box zwave specific.

Ryan-Scott posted this 14 January 2014


I recently ordered some of the LimitlessLED bulbs to try out as they looked to be the best solution for where I want to put them.
The best thing about InControl software, the company and its developers; and the main reason that I choice this software in the first place, is because of the flexibility. LimitlessLED offer an API (another reason I’m trying them), so I know that I will be able to integrate them into InControl. If I had invested in nearly any other zwave controller software, or dedicated hardware hub, I’m sure that it would be a struggle to do anything not out-the-box zwave specific.


Those look cool. I picked up some of the Phillips HUE bulbs and have started on a plugin for them as well. These LimitlessLED's are much cheaper though - let me know how they work and I'll gladly help contribute to a plugin for them as well.

Do they require a bridge of some type or do they work as stand-alone devices?

Rod posted this 14 January 2014

I agree with you, Zwave is here to stay for some time to come but as a manufacturer (say a Kickstarter campaign) of a new product my options are:

1. Build a product that works with WifI or Zwave? Why would I build a product to Zwave when everyone already has wifi and a phone in their hand. I understand there are some security benefits but there is a larger potential audience available with Wifi. Building an API can have much more features with wifi.

Sorry about this post going sideways. I just think that easy WIfi device support could easily be integrated. C# scripts are giving me an ulcer .

jonfrance posted this 14 January 2014


Do they require a bridge of some type or do they work as stand-alone devices?


Yes, they require a bridge....but at the moment it's on sale for $17, can't really go wrong for that price.

FYI - API details are here.
http://www.limitlessled.com/dev/

Rod posted this 14 January 2014



Do they require a bridge of some type or do they work as stand-alone devices?


Yes. They communicate rf to the wifi bridge. The downside is that they don't have any par30 or mr16 replacement like the HUE

Ryan-Scott posted this 14 January 2014



The downside is that they don't have any par30 or mr16 replacement like the HUE


What's par30/mr16?

Rod posted this 14 January 2014

Ceiling / pot lights.

monkey-magic posted this 14 January 2014

So instead of the two options to insert a file for pre and post you have a tab called actions which you can add actions to the scene like tasker.

Ie. Tasks like tasker

So the options are:

Get
Post
Run file
Pre script
Post script
Etc

You can add as many as you like. Like your conditions. This way you have a nice GUI for scripts.


I like Rod's idea, in the activate scene a drop down box to select, if you see two pre scripts you like you can add them both in and not be limited to just one.

I also think it would increase the usability of InControl as it would make adding a plugin for every web connected device less necessary as most will have HTTP support.

I mentioned the article (although it was more someone's opinion) that mentioned that WiFi is likely to be the internet of things. I'll try and find it if I can but I read it on Flipboard.

I think the gist of his thoughts was that WiFi is the most recognised by the average person and most people already have a WiFi router. Early adopters, who most people here are, know z wave.
Personally Z wave in Australia is a lot more expensive (possibly due to licensing of the the Z wave chips, being on a different MHz and size of market) but the main reason I'm on it currently is the in wall controls of lights. I can already get WiFi control plug in power points for about a third of the Z wave costs.

If you want the idea added to the uservoice I'll happily move some of my votes to Rod's ideas.

Josh

monkey-magic posted this 14 January 2014

Here it is:

http://gigaom.com/2014/01/07/heres-why-smart-devices-without-wi-fi-face-an-uphill-battle-in-the-home/

http://gigaom.com/2013/12/31/whats-ahead-for-the-internet-of-things-our-ces-preview-podcast/

This was an older one I read:

http://gigaom.com/2013/05/29/zigbee-and-z-wave-are-out-broadcoms-new-chips-bet-on-bluetooth-and-wi-fi-for-iot/

I really like InControl, esp with Ryan on here and the feedback that gets taken on board and I'd really like it to succeed.

If I had the option to add multiple HTTP get requests in the activate scenes, I'd have IR control, squeezebox control all done. If there was a wiki, I'd be more than happy to add how to's in as well.

It just really expands what the software is capable of and would get it out to a larger audience.

Josh

Rod posted this 14 January 2014

I was thinking having a tab like at the bottom where you have conditions have another called actions. Here you have a add or delete button to add as many scripts/gets/posts etc and either attach it to "pre" or "post".

Rod posted this 14 January 2014

Josh

Which one is this "get WiFi control plug in power points for about a third of the Z wave costs."

?

monkey-magic posted this 14 January 2014

[quote=Rod]Josh

Which one is this "get WiFi control plug in power points for about a third of the Z wave costs."

? [/quote]

I've backed the kickstarter one:

http://www.kickstarter.com/projects/plugaway/plugaway-your-smart-home-on-your-smart-phone

I remember reading it will have an open API and possibly HTTP support but that was a while ago. I could be wrong. It's about a third what Z wave here costs.

The other one was: http://easysmart.com/ I haven't had time to have a look. I got as far as finding a forum for the broadlink company and I did email them about HTTP Get but I haven't heard a response.

It can also be done with a Raspberry pi if you want to play around with live wires but I'm not game.

[quote=Rod]I was thinking having a tab like at the bottom where you have conditions have another called actions. Here you have a add or delete button to add as many scripts/gets/posts etc and either attach it to "pre" or "post". [/quote]

I'm happy with that too, as long as it has: 1) multiple actions (allows running more than one thing) 2) Scripts, HTTP GET, POST, run file (they are the main ones I can think of)

I'm sure Ryan will think of a way to make it neat and tidy. I'll try and paintshop something up when I'm home and can get a screenshot.

Josh

Rod posted this 15 January 2014

Great find Josh. I'm looking for something similar in NA. I'd actually love to find a wifi Switch with a bunch of WiFi buttons on it that fits into a single or double gang switch. Seems like it should exist. The goal is to always run power to whatever was there (to some philips hues or LimitlessLED's) and then control it with those switches locally.

monkey-magic posted this 15 January 2014

Great find Josh. I'm looking for something similar in NA. I'd actually love to find a wifi Switch with a bunch of WiFi buttons on it that fits into a single or double gang switch. Seems like it should exist. The goal is to always run power to whatever was there (to some philips hues or LimitlessLED's) and then control it with those switches locally.


NA I'm assuming is North America?

Do you mean like a powerboard with individually controllable sockets or are you just trying to run one item?
Sorry off topic a bit.

Josh

ftsikogi posted this 15 January 2014

I like the idea of make incontrol even more interoperable and compatible to future home automation standards but at the moment I can't see who and if there will be a winner sometime.
Maybe we would stick to many different protocols for quite a long time. But even if we had a standard wifi protocol for all home automation products we would need a great software that could add the "control" and the "logic" for all these to operate smoothly.
Another reason for not seeing wifi as a replacement of zwave (at this time) is that there are no battery operated wifi devices (power cosumption of wifi is high) , wifi doesn't utilize the mesh architecture and also wifi uses higher frequencies. These high frequencies are not designed to penetrated building materials and that is why "dead spots" occurs in some places. Note that wireless alarm systems uses lower frequencies that provide better range for the same power.
We have to admit though that wifi devices could be cheaper and much more user friendly for the majority of the users.

jrichards posted this 15 January 2014

In my opinion (for what it’s worth), I really don’t see z-wave falling to the wayside. There have been generations of technology in home automation. It hasn't been until late that these cool little devices have been out there. The integration with the Internet and phone have made them even more appealing. The good and bad about z-wave is it is a single chip manufacturer. The good is there are standards !!! The bad is that there is one manufacturer of the chip. The serious person for home automation wants a product that comes together in a central location (ie software and/app). With so many different devices coming out with WiFi integration, I don’t see them standardizing anytime soon. They are just throwing the product out there to see how it does. Who want to come home and have to use six apps to do things around the house. I can easily see z-wave devices adapting to the new WiFi devices as they come out. Just my 2 cents! Here is an interesting link for you. http://www.z-wavealliance.org/

Thanks,
Jim

monkey-magic posted this 15 January 2014

My personal opinion, I don't think Z wave is a doomed. I think for serious home automaters (more than a few single devices) Z wave is still the go. But I also think more and more people will buy just one item to try like the nest. The biggest thing with WiFi is that more items are added like you mentioned there will be more and more Apps to control each individual item.

Back onto topic a little I really think the ability to have extra actions will expand InControl a lot. Allow it to be the one App to manage actual Home Automation rather than just Zwave.

Josh

jonfrance posted this 15 January 2014

The biggest thing with WiFi is that more items are added like you mentioned there will be more and more Apps to control each individual item.


the ability to have extra actions will expand InControl a lot. Allow it to be the one App to manage actual Home Automation rather than just Zwave.
Josh


You've hit the nail on the head there! That will definitely be the issue with all the different technologies and blinkered development at the moment. I may choose to mix and match technologies, not just now but for years to come, but you can bet your life I don’t want 10 different phone apps or computer programs to control them all. I want just the one. Plus it isn’t just about the personal control, it’s about automated interaction. My wifi lights turn on when my zwave sensor is triggered; for example.

monkey-magic posted this 15 January 2014

http://imgur.com/WBtxUAJ

Back on topic a bit, Is this how people envision it?

An Actions tab, a radio button to place the action in Pre or Post and a list of actions?

I'm happy if Ryan needs this on the Uservoice and I'll move as many votes as I can towards this, mainly because the HTTP and run file would allow control of a lot of other things.

Josh

Rod posted this 16 January 2014

Great mock up Josh.... Adding to that list (Get Post etc) could be a timeout to specify in seconds. Have your garage door open and give you 30 seconds before the lights turn off.

Zapier (ifttt on steroids) just opened their service to allow anyone to create a service. This might be an easy way to connect every device to incontrol.

Wifi devices usually all have APIs so having 10 apps for controlling your devices isn't really the case. If you dont know how I guess that's the current issue over zwave.



monkey-magic posted this 16 January 2014

A wait between pre/post actions isn't a bad idea. Between the actual z wave devices like open garage door 5secs after motion trips from memory is already in there.
Josh

Ryan-Scott posted this 16 January 2014

I think a good place to put these would be in with the devices itself; that way you could build a list of devices with pauses and other actions. You may end up with a scene that has this:

Turn zwave device off
pause 5 seconds
execute http POST
pause 5 seconds
Turn zwave device on

Rod posted this 16 January 2014

Ignore... =)

monkey-magic posted this 16 January 2014

I think a good place to put these would be in with the devices itself; that way you could build a list of devices with pauses and other actions. You may end up with a scene that has this:

Turn zwave device off
pause 5 seconds
execute http POST
pause 5 seconds
Turn zwave device on


That would be a good place to put it. Is this what you're thinking?

http://imgur.com/tP5dbQw

Maybe the only other thing to add would be to run another Scene?

If/AND/OR statements would be nice but I'd like to see HTTP first. I'm not sure how it would get integrated as Conditions are kind of like IF.

Rod: Are you thinking more like Tasker where Scenes are like Profiles and this stuff above (currrently called devices) is like Tasks?

Thanks Josh

Rod posted this 16 January 2014

Sorry, I misinterpreted what you meant by devices. What Josh did would be great.

monkey-magic posted this 20 January 2014

Okay,

I've added this to uservoice so those who are keen to see it comment and vote it up. I've added 3.

http://incontrolha.uservoice.com/forums/218427-general/suggestions/5390053-add-actions-to-incontrol-http-get-post-run-file

Any other suggestions post here.

This may be a bit more complex but I was also thinking about adding the the ability to Set Variables, like the Android App Tasker. This would allow better control of Conditions.

Josh

Axial-User posted this 01 February 2014

I also agree that Zwave might die off. I'm not sure we need it vs such an already available and secure infrastructure such as Wifi.


I find one of the benefits of z-wave to be the completely wireless (battery) powered sensors. I am a proponent of the wi-fi connected devices, it just seems it is every vendor for themselves, leaving a gap in the ability to integrate across product lines.

My perfect solution would be what I think the original post is getting at, seamless integration/automation between z-wave and wi-fi with InControl at the center of it all, providing simple post/get operations on the fly and the optional plug-in if additional functionality for any given wifi device is needed.

Close