Announcement
Collapse
No announcement yet.
***Arduino For HS3 Beta Now Available.***
Collapse
X
-
Guest
-
Originally posted by 8r1an View PostHi Greig
Did you have a chance to look at this?
Change log:
Fix for analogue divide %2f to /
Changed the API input to accept unlimited inputs.
Greig.Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
Scripts = Various
Comment
-
Originally posted by Automate_It View Post:
Next to wire up is the Sump Pump bilges
Regards
Mark________________________
Dell Zino HD - HSPRo 2.x
HSTouch - iPhone 3GS, 4S, iPad2 and iPad 3, 3xKindle Fire (Wall mounted)
2 x Brultech ECM1240 with UltraECM
USB UIRT
Cooper Aspire Z-Wave Switches
WGL800 w ACRF2 and 3xDS10a (Sump Level/Activity sensing)
HM ST812-2 Flood Sensor
HSM100 - Motion Detector with Light and Temperature
2GIG Thermostat
BLDSC - Alarm Plug-in
BLUPS
UltraLog (SQL2008)
Jon00 Plugins
Host XR3 BT and Jon00 BT Proximity
Global Cache IP2IR
Foscam FI8918W
Comment
-
Spark Core
Just wanted to pass alone some info on the spark core. I received mine this week and messed with it a bit today.
It is very nice, inexpensive and seems to work great. I wanted to see if I could get this plug-in running with it.
Although I'm sure it is possible, it is beyond me. Right now all of the include library would need to be copied directly into the build since (currently) there is no other way to get them onto the Spark board (at least not that I could see). Plus, I'm sure it would take a bit of tweaking to get it all working properly.
In any case, if someone can figure this out it would be amazing, the spark costs ~39 bucks and includes WiFi. It looks like it will run standard Arduino programs with the above mentioned limitations (for now) and has the same rich complement of GPIO.
I'm not a programmer so If I have any of this wrong feel free to correct or if anyone can get it working pls let me know...
Spark web site
https://www.spark.io
Comment
-
Originally posted by mark_anderson_us View PostI'm currently building an uber sump pump monitor: Monitors water level (with ultrasonic sensor), main and backup pump operation and will message HS and a web service with water levels and pump operations. Also has a tri-color LED strip that shows visual indication of water level. I went the netduino route as it has more interrupts and prefer C# and VisualStudio over the crappy arduino editor (I know there are 3rd party ones). Also, not using managed code seems like a step back to the 80's. Give me garbage collection over chasing your tail with memory issues any day. I think Netduino is amazing.
Regards
Markhuggy_d1
Automating made easy
Comment
-
API.ino
Greig,
I'm having a problem in compiling the API.ino for my wind sensor.
This is the working version loaded on Arduino:
Code:volatile byte count; unsigned int duration; unsigned long timePrevious; float windSpeed = 0; void setup() { Serial.begin(9600); attachInterrupt(0, arduino_anemometer, RISING); count = 0; duration = 0; timePrevious = 0; } void loop() { if (count >= 1) { duration = (millis() - timePrevious); timePrevious = millis(); count = 0; windSpeed = (1492/duration)*1.61; Serial.print(windSpeed,DEC); Serial.print(" Km/h"); Serial.print(","); } } void arduino_anemometer() { count++; }
This is the "API" HomeSeer version that gives me problems at compile.
I am trying to move the declarations of variables and functions but without success.
Code:#include <SPI.h> #include <Ethernet.h> #include <EthernetUdp.h> //my variable declaration------------ volatile byte count; unsigned int duration; unsigned long timePrevious; float windSpeed = 0; //---END OF MY VARIABLE DECLARATION /************************************************************ *Arduino to Homeseer 3 Plugin API writen by Enigma Theatre.* * V1.0.0.12 * * * *******Change the values below only************************* */ //Address of the board. int BoardAdd = 1; //For serial set to 0 and for Ethernet set to 1 int IsIP = 0; // Enter a MAC address and IP address for your board below. byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; // The IP address will be dependent on your local network. IPAddress ip(192,168,0,100); //IP entered in HS config. unsigned int localPort = 9000; //port entered in HS config. IPAddress HomeseerIP(192,168,0,123); //Homeseer IP address //************Do not change anything in Here***************** // * int IsConnected = false; // * char packetBuffer[UDP_TX_PACKET_MAX_SIZE]; // * EthernetUDP Udp; // * unsigned int ServerPort = 8888; // * //*********************************************************** void setup() { HSSetup(); //************************ //Add YOUR SETUP HERE; //************************ Serial.begin(9600); attachInterrupt(0, arduino_anemometer, RISING); count = 0; duration = 0; timePrevious = 0; } void loop() { IsUDP(); if (IsConnected == true) { //************************ //Add YOUR CODE HERE; //************************ /* To Send Data to Homeseer use SendToHS(Device,Value) Eg.. SendToHS(1,200); where 1 is the API device in homeseer and 200 is the value to send */ if (count >= 1) { duration = (millis() - timePrevious); timePrevious = millis(); count = 0; windSpeed = (1492/duration)*1.61; //Serial.print(windSpeed,DEC); //Serial.print(" Km/h"); //Serial.print(","); SendToHS(1,windSpeed) } } void arduino_anemometer() { count++; } } } char* Version = "API1.0.0.12"; int Byte1 ; int Space ; int Byte2 ; int Byte3 ; int Byte4 ; int Byte5 ; void HSSetup() { if (BoardAdd < 1){ BoardAdd=1; } if (IsIP == 1){ Ethernet.begin(mac,ip); Udp.begin(localPort); Udp.setTimeout(0); delay(1000); Udp.beginPacket(HomeseerIP, ServerPort); Udp.print("Connect "); Udp.println(BoardAdd); Udp.endPacket(); } // if (IsIP == 0){ Serial.begin(115200); Serial.flush(); Serial.setTimeout(0); delay(1000); Serial.print("Connect "); Serial.println(BoardAdd); // } IsConnected = false; } void IsUDP(){ if (IsIP == 1){ int packetSize = Udp.parsePacket(); if(packetSize) { IPAddress remote = Udp.remoteIP(); Byte1 =Udp.parseInt(); Space = Udp.read(); Byte2 =Udp.read(); Byte3 =Udp.parseInt(); Byte4 =Udp.parseInt(); Byte5 =Udp.parseInt(); DataEvent(); } } } int Available = Serial.available(); void serialEvent() { // Serial.println("serial event"); while (Serial.available() > 0) { delay(17); Byte1 = Serial.parseInt(); Space = Serial.read(); Byte2 = Serial.read(); Byte3 = Serial.parseInt(); Byte4 = Serial.parseInt(); Byte5 = Serial.parseInt(); DataEvent(); } } void DataEvent() { // Serial.println(Byte1); // Serial.println(Byte2); // Serial.println(Byte3); // Serial.println(Byte4); if (Byte1 == BoardAdd) { switch (Byte2) { case 'c': IsConnected = true; break; case 'C': if (IsIP == 0){ Serial.print("Version "); Serial.print(BoardAdd); Serial.print(" "); Serial.print(Version); Serial.println(" HS3"); delay(100); Serial.print("Connected "); Serial.println(BoardAdd); } if (IsIP == 1){ Udp.beginPacket(Udp.remoteIP(), ServerPort); Udp.print("Version "); Udp.print(BoardAdd); Udp.print(" "); Udp.print(Version); Udp.println(" HS3"); Udp.endPacket(); Udp.beginPacket(Udp.remoteIP(), ServerPort); delay(100); Udp.print("Connected "); Udp.println(BoardAdd); Udp.endPacket(); } delay(100); IsConnected = false; break; case 'K': delay(200); if (IsIP == 0){ Serial.print("Alive "); Serial.println(BoardAdd); } if (IsIP == 1){ Udp.beginPacket(Udp.remoteIP(), ServerPort); Udp.print("Alive "); Udp.println(BoardAdd); Udp.endPacket(); } break; case 'O': pinMode(Byte3, OUTPUT); digitalWrite(Byte3, Byte4); break; case 'D': IsConnected = false; break; } } } void SendToHS(int Device, long Data){ //if (Device > 0){ if (IsIP == 0){ Serial.print(BoardAdd); Serial.print(" API "); Serial.print(Device); Serial.print(" "); Serial.println(Data); } if (IsIP == 1){ Udp.beginPacket(Udp.remoteIP(), ServerPort); Udp.print(BoardAdd); Udp.print(" API "); Udp.print(Device); Udp.print(" "); Udp.print(Data); Udp.endPacket(); } }
Comment
-
Originally posted by khriss75 View PostGreig,
I'm having a problem in compiling the API.ino for my wind sensor.
Can You understand where I'm wrong?
one thing is you need a Semicolon after SendToHS(1,windSpeed)
and serial is declared as part of the connection to HS3 so this is not needed.
Try,
PHP Code:#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
//my variable declaration------------
volatile byte count;
unsigned int duration;
unsigned long timePrevious;
float windSpeed = 0;
//---END OF MY VARIABLE DECLARATION
/************************************************************
*Arduino to Homeseer 3 Plugin API writen by Enigma Theatre.*
* V1.0.0.12 *
* *
*******Change the values below only*************************
*/
//Address of the board.
int BoardAdd = 1;
//For serial set to 0 and for Ethernet set to 1
int IsIP = 0;
// Enter a MAC address and IP address for your board below.
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
// The IP address will be dependent on your local network.
IPAddress ip(192,168,0,100); //IP entered in HS config.
unsigned int localPort = 9000; //port entered in HS config.
IPAddress HomeseerIP(192,168,0,123); //Homeseer IP address
//************Do not change anything in Here*****************
// *
int IsConnected = false; // *
char packetBuffer[UDP_TX_PACKET_MAX_SIZE]; // *
EthernetUDP Udp; // *
unsigned int ServerPort = 8888; // *
//***********************************************************
void setup() {
HSSetup();
//************************
//Add YOUR SETUP HERE;
//************************
attachInterrupt(0, arduino_anemometer, RISING);
count = 0;
duration = 0;
timePrevious = 0;
}
void arduino_anemometer()
{
count++;
}
void loop() {
IsUDP();
if (IsConnected == true)
{
//************************
//Add YOUR CODE HERE;
//************************
/* To Send Data to Homeseer use SendToHS(Device,Value)
Eg.. SendToHS(1,200); where 1 is the API device in homeseer and 200 is the value to send
*/
if (count >= 1) {
duration = (millis() - timePrevious);
timePrevious = millis();
count = 0;
windSpeed = (1492/duration)*1.61;
//Serial.print(windSpeed,DEC);
//Serial.print(" Km/h");
//Serial.print(",");
SendToHS(1,windSpeed);
}
}
}
char* Version = "API1.0.0.12";
int Byte1 ;
int Space ;
int Byte2 ;
int Byte3 ;
int Byte4 ;
int Byte5 ;
void HSSetup() {
if (BoardAdd < 1){
BoardAdd=1;
}
if (IsIP == 1){
Ethernet.begin(mac,ip);
Udp.begin(localPort);
Udp.setTimeout(0);
delay(1000);
Udp.beginPacket(HomeseerIP, ServerPort);
Udp.print("Connect ");
Udp.println(BoardAdd);
Udp.endPacket();
}
// if (IsIP == 0){
Serial.begin(115200);
Serial.flush();
Serial.setTimeout(0);
delay(1000);
Serial.print("Connect ");
Serial.println(BoardAdd);
// }
IsConnected = false;
}
void IsUDP(){
if (IsIP == 1){
int packetSize = Udp.parsePacket();
if(packetSize)
{
IPAddress remote = Udp.remoteIP();
Byte1 =Udp.parseInt();
Space = Udp.read();
Byte2 =Udp.read();
Byte3 =Udp.parseInt();
Byte4 =Udp.parseInt();
Byte5 =Udp.parseInt();
DataEvent();
}
}
}
int Available = Serial.available();
void serialEvent() {
// Serial.println("serial event");
while (Serial.available() > 0) {
delay(17);
Byte1 = Serial.parseInt();
Space = Serial.read();
Byte2 = Serial.read();
Byte3 = Serial.parseInt();
Byte4 = Serial.parseInt();
Byte5 = Serial.parseInt();
DataEvent();
}
}
void DataEvent() {
// Serial.println(Byte1);
// Serial.println(Byte2);
// Serial.println(Byte3);
// Serial.println(Byte4);
if (Byte1 == BoardAdd) {
switch (Byte2) {
case 'c':
IsConnected = true;
break;
case 'C':
if (IsIP == 0){
Serial.print("Version ");
Serial.print(BoardAdd);
Serial.print(" ");
Serial.print(Version);
Serial.println(" HS3");
delay(100);
Serial.print("Connected ");
Serial.println(BoardAdd);
}
if (IsIP == 1){
Udp.beginPacket(Udp.remoteIP(), ServerPort);
Udp.print("Version ");
Udp.print(BoardAdd);
Udp.print(" ");
Udp.print(Version);
Udp.println(" HS3");
Udp.endPacket();
Udp.beginPacket(Udp.remoteIP(), ServerPort);
delay(100);
Udp.print("Connected ");
Udp.println(BoardAdd);
Udp.endPacket();
}
delay(100);
IsConnected = false;
break;
case 'K':
delay(200);
if (IsIP == 0){
Serial.print("Alive ");
Serial.println(BoardAdd);
}
if (IsIP == 1){
Udp.beginPacket(Udp.remoteIP(), ServerPort);
Udp.print("Alive ");
Udp.println(BoardAdd);
Udp.endPacket();
}
break;
case 'O':
pinMode(Byte3, OUTPUT);
digitalWrite(Byte3, Byte4);
break;
case 'D':
IsConnected = false;
break;
}
}
}
void SendToHS(int Device, long Data){
//if (Device > 0){
if (IsIP == 0){
Serial.print(BoardAdd);
Serial.print(" API ");
Serial.print(Device);
Serial.print(" ");
Serial.println(Data);
}
if (IsIP == 1){
Udp.beginPacket(Udp.remoteIP(), ServerPort);
Udp.print(BoardAdd);
Udp.print(" API ");
Udp.print(Device);
Udp.print(" ");
Udp.print(Data);
Udp.endPacket();
}
}
Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
Scripts = Various
Comment
-
Hello Greig,
I have now 2 boards running 1 usb and 1 Ethernet.
Installation is a piece of cake.
I nothis while aim making some devices, that when I unplug the power
From the Ethernet node
And after more then 5 minutes mostly the node is not reconnecting
When I press the button connect he is reconnecting (not always)
The usb seems to working fine in this way
The plugin is standing on reconnect.
Are there more people that having that behavior.
Thanks
Ed
Comment
-
Originally posted by enigmatheatre View PostHI Khiss,
one thing is you need a Semicolon after SendToHS(1,windSpeed)
and serial is declared as part of the connection to HS3 so this is not needed.
Greig.
The error was just the semicolon.
I can now confirm the excellent work that you have done for the API version. It works perfectly!
Thanks again!
Cris
P.S.: Could you verify the update to version 1.0.0.14? I'm having problems installing ... (the update is still seen as x.x.0.13)
Comment
-
Im glad this works for you. I thought long and hard about this on how to customize it so you can use it with any sensor. I would like to thank Morten for the Idea on the API.ino and help getting this plugin going.
I will have a look at the install file. When you say you still see x.x.0.13 is this in the Homeseer plugin page? Can you look at the top of the Arduino config page and tell me what is there. I have seen this before and it requires you to restart HS3 before it updates the plugin page but it will still be running .14. If this is the case I will file a bug report on this or if not I will fix the install problem.
Sent from my HTC One using TapatalkZwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
Scripts = Various
Comment
-
Re: ***Arduino For HS3 Beta Now Available.***
Originally posted by ESSCHENK View PostHello Greig,
I have now 2 boards running 1 usb and 1 Ethernet.
Installation is a piece of cake.
I nothis while aim making some devices, that when I unplug the power
From the Ethernet node
And after more then 5 minutes mostly the node is not reconnecting
When I press the button connect he is reconnecting (not always)
The usb seems to working fine in this way
The plugin is standing on reconnect.
Are there more people that having that behavior.
Thanks
Ed
Thanks
Greig.
Sent from my HTC One using TapatalkZwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
Scripts = Various
Comment
-
Originally posted by enigmatheatre View PostIm glad this works for you. I thought long and hard about this on how to customize it so you can use it with any sensor. I would like to thank Morten for the Idea on the API.ino and help getting this plugin going.
I will have a look at the install file. When you say you still see x.x.0.13 is this in the Homeseer plugin page? Can you look at the top of the Arduino config page and tell me what is there. I have seen this before and it requires you to restart HS3 before it updates the plugin page but it will still be running .14. If this is the case I will file a bug report on this or if not I will fix the install problem.
Sent from my HTC One using Tapatalk
Hy Greig,
I've tried but without success. This my step:
This is the page of installed plugin (it's ok):
I copied the files 1.0.0.14 in the HS folder "update3/zip".
Restarted HS.
Plugins-->Manage-->Update listing.
This is the situation:
I'm sure the .zip file copied in homeseer update folder is the .14 (dawonloaded from the first page of this topic).
Selected the update-->pressed "install" and this is the result: FAIL
In the update3 homeseer folder, was created the "arduino plugins1.0.0.13" (Before the update this folder does not exist...). Why .13? The folder is empty.
If you have problems with the pictures, these are the link:
https://www.dropbox.com/s/whixhxtlze...alled%20OK.jpg
https://www.dropbox.com/s/c3xtj6jyzr...20is%20.13.jpg
https://www.dropbox.com/s/cj1i6uc1d8...ATE%20FAIL.jpg
https://www.dropbox.com/s/b0ltd39qqgtyw7d/04_folder.jpg
thanks
Comment
-
I can not test this at the moment but all you need to do to update is download the .14 zip then put it in to the updates3/zips folder then download the new updater_override.txt and put it in to your HS3 folder. Then check the update in the config page.
Looking at the pictures your updater_override.txt is wrong. Try and download it and replace it again.
Sent from my HTC One using TapatalkZwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
Scripts = Various
Comment
-
I can confirm the update works here.
Remember and click update listing. It looks like you still have the old updater_override.txt.
After the update remove the updater_override.txt.
Please try the steps found here
Greig.Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
Scripts = Various
Comment
Comment