Announcement

Collapse
No announcement yet.

How to pass to devices the information of sensors coming from arduino serial port?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ANTOLIVEIRA
    replied
    Ok!

    I will have to connect an oscilloscope to see the signal and decide on the approach. I also ordered two nodemcu to test

    Thanks again for sharing your sketch it will be very useful

    I was thinking of decentralizing my system to have an arduino per division connected by ethernet to the HS (node zero) and in this way acquire temperature, humidity, luminosity, detection of movement and command heating and blinds.However, before I proceed I need to test functionality and reliability.

    I think the plugin will allow a maximum of 9 arduinos... I am particularly concerned about any connection losses between the Arduinos and the plugin,..

    I already have work for the next weeks ...

    Leave a comment:


  • khriss75
    replied
    Originally posted by ANTOLIVEIRA View Post
    [The analogue inputs are digital inputs with the added functionality of analogue.

    sensor = digitalRead(14); // reads a digital signal on pin A0 …
    The idea came from here:


    http://www.smartofthehome.com/2013/0...eters-arduino/[/SIZE]
    Ok, I know that analog inputs can be used as digital input! But if I have digital pin free I prefer use that.
    In the link, is used a analogue pin because is used a photo-transistor and led. I think he want read the led light reflection on wheel of meter, so use analogue to determinate the threshold.
    In my case, I have a watt meter that return a pulse (+5V) for every Watt, so I use a digital pin...

    Here my sketch:

    Code:
    /************************************************************
      Arduino to Homeseer 3 Plugin API written by Enigma Theatre.
       V1.0.0.118
       6/12/2016 Utilizzato nuovamente il GETPULSEIN
                 aggiunto controllo sicurezza di 3 secondi prima
                 di inviare valore se power > 3000
       2/1/2017 inseriti ingressi analogici con invio dati solo se
                valore è differente dal precedente
    
     *******Change the values below only**************************/
    
    // Pin pulse
    const int getpulsepin = 2;
    
    // variable
    int power = 0;
    unsigned long startime = 0;
    unsigned long duration = 0;
    int state = 0;
    int pinval = 0;
    unsigned long tempoPrecedente = millis();
    unsigned long tempoPrecedente1 = millis();
    unsigned long tempoPrecedente2 = millis();
    unsigned long tempoPrecedente3 = millis();
    unsigned long tempoPrecedente4 = millis();
    unsigned long tempoAllerta = millis();
    float duration3 = 0;
    boolean allerta = false;
    
    int consumo_generale = 0;
    int sens_allagamento_lavastoviglie = 0;
    int sens_vasi_bagnati = 0;
    int sens_luminosita_rep_giorno = 0;
    float sens_batteria_UPS = 0;
    int consumo_generale_old = 0;
    int sens_allagamento_lavastoviglie_old = 0;
    int sens_vasi_bagnati_old = 0;
    int sens_luminosita_rep_giorno_old = 0;
    float sens_batteria_UPS_old = 0;
    
    
    
    
    
    //************Do not change anything in Here*****************
    
    #define ISIP 0
    #if ISIP == 1
    #include <EEPROM.h>
    #include <SPI.h>
    #endif
    
    
    const byte BoardAdd = 4;
    
    #include <Ethernet.h>
    #include <EthernetUdp.h>
    
    #if ISIP == 1
    byte mac[] = {0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x04};
    IPAddress ip(***********);  //IP entered In HS config.
    const unsigned int localPort = 8903;      //port entered In HS config.
    IPAddress HomeseerIP(**********); //Homeseer IP address
    IPAddress ServerIP(EEPROM.read(2), EEPROM.read(3), EEPROM.read(4), EEPROM.read(5));
    IPAddress gateway(192, 168, 178, 1);
    IPAddress subnet(255, 255, 255, 0);
    byte EEpromVersion = EEPROM.read(250);
    #endif
    
    int FromHS[10];                                          // *
    boolean IsConnected = false;                             // *
    #if ISIP == 1                                            // *
    char packetBuffer[UDP_TX_PACKET_MAX_SIZE];               // *
    EthernetUDP Udp;                                         // *
    const unsigned int ServerPort = 8888;                    // *
    #endif                                                   // *
    void(* resetFunc) (void) = 0;                            // *
    //***********************************************************
    
    
    void setup() {
      HSSetup();
      //************************
      //Add YOUR SETUP HERE;
    
      pinMode(getpulsepin, INPUT_PULLUP); // pin del sensore + pullUP
    
      //************************
    
    
    
    
    }
    
    
    
    
    void loop() {
    #if ISIP == 1
      IsUDP();
    #endif
    
      //************************
      //Add YOUR CODE HERE;
    
      pinval = digitalRead(getpulsepin);   // legge il pin del sensore
    
      if ((state == 1) & (pinval == 0)) { // punto di transizione
        duration = millis() - startime;       // calcola la duration della pulsazione
        startime = millis();            // setta il nuovo tempo di partenza
        power = 3600.0 / duration * 1000; // calcola consumo
        duration3 = duration / 1000.0;  //duration in seconds
    
        if (power <= 3000) {
          SendToHS(1, power);
          SendToHS(2, duration3);
          allerta = false;
        } else {
          // se power è > 3000
          if (allerta) {
            //era > 3000 anche prima
            if ((millis() - tempoAllerta) > 3000) {
              // sono passati più di 3 secondi
              SendToHS(1, power);
              SendToHS(2, duration3);
            }
          } else {
            // è la prima volta che è > 3000
            allerta = true;
            tempoAllerta = millis();
          }
        }
    
      }
      state = pinval;         // imposta lo stato uguale alla lettura del pin
    
    
    
    
      if (millis() - tempoPrecedente > 5000) {
        tempoPrecedente = millis();
        consumo_generale = analogRead(A0) * (100 / 1023.0 * 6);
        if (consumo_generale != consumo_generale_old) {
          SendToHS(3, consumo_generale);
          consumo_generale_old = consumo_generale;
        }
      }
    
      if (millis() - tempoPrecedente1 > 5100) {
        tempoPrecedente1 = millis();
        sens_batteria_UPS = (analogRead(A1) / 56.39);
        if (sens_batteria_UPS != sens_batteria_UPS_old) {
          SendToHS(4, sens_batteria_UPS);
          sens_batteria_UPS_old = sens_batteria_UPS;
        }
      }
    
      if (millis() - tempoPrecedente2 > 5200) {
        tempoPrecedente2 = millis();
        sens_luminosita_rep_giorno = (analogRead(A2) * 100 / 1023 * 4);
        if (sens_luminosita_rep_giorno != sens_luminosita_rep_giorno_old) {
          SendToHS(5, sens_luminosita_rep_giorno);
          sens_luminosita_rep_giorno_old = sens_luminosita_rep_giorno;
        }
      }
    
      if (millis() - tempoPrecedente3 > 5300) {
        tempoPrecedente3 = millis();
        sens_allagamento_lavastoviglie = (analogRead(A3) * 100 / 1023);
        if (sens_allagamento_lavastoviglie != sens_allagamento_lavastoviglie_old) {
          SendToHS(6, sens_allagamento_lavastoviglie);
          sens_allagamento_lavastoviglie_old = sens_allagamento_lavastoviglie;
        }
      }
    
      if (millis() - tempoPrecedente4 > 5400) {
        tempoPrecedente4 = millis();
        sens_vasi_bagnati = (analogRead(A4) * 100 / 1023);
        if (sens_vasi_bagnati != sens_vasi_bagnati_old) {
          SendToHS(7, sens_vasi_bagnati);
          sens_vasi_bagnati_old = sens_vasi_bagnati;
        }
      }
    
    
      //************************
      /* 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
        To Recieve data from Homeseer look up the FromHS array that is updated when the device value changes.
        Eg.. FromHS[5] would be the data from API Output device 5
        All code that is located just below this block will execute regardless of connection status!
        You can include SendToHS() calls, however when there isn't an active connection, it will just return and continue.
        If you only want code to execute when HomeSeer is connected, put it inside the if statement below.
      */
    
      /*Execute regardless of connection status*/
    
    
      if (IsConnected == true) {
        /*Execute ONLY when HomeSeer is connected*/
    
      }
    }
    char* Version = "API1.0.0.118";
    
    byte Byte1, Byte2, Byte3;
    int Byte4, Byte5;
    
    
    void HSSetup() {
    
    #if ISIP == 1
      if (EEpromVersion != 22) {
        ServerIP = HomeseerIP;
        EEPROM.write(2, ServerIP[0]);
        EEPROM.write(3, ServerIP[1]);
        EEPROM.write(4, ServerIP[2]);
        EEPROM.write(5, ServerIP[3]);
        EEPROM.write(250, 22); //Store the version where the eeprom data layout was last changed
        EEpromVersion = 22;
      }
      Ethernet.begin(mac, ip);
      Udp.begin(localPort);
      Udp.setTimeout(0);
      delay(1000);
      SendConnect();
    #else
      Serial.begin(115200);
      Serial.flush();
      Serial.setTimeout(0);
      delay(1000);
      Serial.print("Connect ");
      Serial.println(BoardAdd);
    #endif
    
      IsConnected = false;
    
    }
    
    void SendConnect()
    {
    #if ISIP == 0
      Serial.print("Connect ");
      Serial.println(BoardAdd);
    #else
      Udp.beginPacket(ServerIP, ServerPort); //First send a connect packet to the dynamic IP stored in eeprom
      Udp.print("Connect ");
      Udp.print(BoardAdd);
      Udp.endPacket();
      if (ServerIP != HomeseerIP) {
        Udp.beginPacket(HomeseerIP, ServerPort); //Then if the stored value doesn't match the pre-specified one, send a connect packet there also
        Udp.print("Connect ");
        Udp.print(BoardAdd);
        Udp.endPacket();
      }
    
    #endif
    }
    
    
    #if ISIP == 1
    void IsUDP() {
      int packetSize = Udp.parsePacket();
      if (packetSize)
      {
        IPAddress remote = Udp.remoteIP();
        Byte1 = Udp.parseInt();
        Udp.read();
        Byte2 = Udp.read();
        Byte3 = Udp.parseInt();
        Byte4 = Udp.parseInt();
        Byte5 = Udp.parseInt();
        DataEvent();
      }
    }
    
    #else
    void serialEvent() {
      while (Serial.available() > 0) {
        delay(17);
    
    
        Byte1 = Serial.parseInt();
        Serial.read();
        Byte2 = Serial.read();
        Byte3 = Serial.parseInt();
        Byte4 = Serial.parseInt();
        Byte5 = Serial.parseInt();
        DataEvent();
      }
    }
    #endif
    
    
    /*
    
      Used Data Input Cases
      D Disconnect
      r reset
      K Keepalive
      O PinMode Output Set
      d Input debounce time set
      C Connect request
      c Connection established - report current status
    */
    void DataEvent() {
    
    
    
      if (Byte1 == BoardAdd) {
        switch (Byte2) {
    
          case 'c':
            IsConnected = true;
    #if ISIP == 1
            if (Udp.remoteIP() != ServerIP) {
              ServerIP = Udp.remoteIP();
              EEPROM.write(2, ServerIP[0]);
              EEPROM.write(3, ServerIP[1]);
              EEPROM.write(4, ServerIP[2]);
              EEPROM.write(5, ServerIP[3]);
            }
    #endif
    
            break;
    
          case 'C':
    #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();
    #else
            Serial.print("Version ");
            Serial.print(BoardAdd);
            Serial.print(" ");
            Serial.print(Version);
            Serial.println(" HS3");
            delay(100);
            Serial.print("Connected ");
            Serial.println(BoardAdd);
    #endif
            delay(100);
            IsConnected = false;
            break;
    
          case 'K':
            delay(200);
    #if ISIP == 1
            Udp.beginPacket(Udp.remoteIP(), ServerPort);
            Udp.print("Alive ");
            Udp.println(BoardAdd);
            Udp.endPacket();
            if (Udp.remoteIP() != ServerIP) {
              ServerIP = Udp.remoteIP();
              EEPROM.write(2, ServerIP[0]);
              EEPROM.write(3, ServerIP[1]);
              EEPROM.write(4, ServerIP[2]);
              EEPROM.write(5, ServerIP[3]);
            }
    #else
            Serial.print("Alive ");
            Serial.println(BoardAdd);
    #endif
            break;
    
          case 'r':
            delay(200);
            resetFunc();  //call reset
            break;
    
          case 'O':
            FromHS[Byte3] = Byte4;
            break;
    
          case 'D':
            IsConnected = false;
            break;
        }
      }
    }
    
    void SendToHS(byte Device, long Data) {
      if (IsConnected == true) {
    #if ISIP == 1
        Udp.beginPacket(Udp.remoteIP(), ServerPort);
        Udp.print(BoardAdd);
        Udp.print(" API ");
        Udp.print(Device);
        Udp.print(" ");
        Udp.print(Data);
        Udp.endPacket();
    #else
        Serial.print(BoardAdd);
        Serial.print(" API ");
        Serial.print(Device);
        Serial.print(" ");
        Serial.println(Data);
    #endif
      }
    }
    
    void SendToHS(byte Device, int Data) {
      if (IsConnected == true) {
    #if ISIP == 1
        Udp.beginPacket(Udp.remoteIP(), ServerPort);
        Udp.print(BoardAdd);
        Udp.print(" API ");
        Udp.print(Device);
        Udp.print(" ");
        Udp.print(Data);
        Udp.endPacket();
    #else
        Serial.print(BoardAdd);
        Serial.print(" API ");
        Serial.print(Device);
        Serial.print(" ");
        Serial.println(Data);
    #endif
      }
    }
    
    void SendToHS(byte Device, float Data) {
      if (IsConnected == true) {
    #if ISIP == 1
        Udp.beginPacket(Udp.remoteIP(), ServerPort);
        Udp.print(BoardAdd);
        Udp.print(" API ");
        Udp.print(Device);
        Udp.print(" ");
        Udp.print(Data);
        Udp.endPacket();
    #else
        Serial.print(BoardAdd);
        Serial.print(" API ");
        Serial.print(Device);
        Serial.print(" ");
        Serial.println(Data);
    #endif
      }
    }
    This is the sketch (board4 connected via USB)I used before to pass to nodemcu. As you can see I read some analogue inputs (flood checker, ambient light...) and pass the data to homeseer only every x seconds and only if the new data is different to previous.

    Leave a comment:


  • ANTOLIVEIRA
    replied

    Yes, this is the goal :-)
    I use for my watt meter a nodemcu. I simply count the time every 2 pulse and calculate the power.


    Now I have to check my sketch because I don't remember well but the "state" variable is to check if the state of the pin is changed in order to "listen" the pulse.
    I added an other variable to check if arduino was restarted (arduino riavviato = arduino restarted)... why?
    Simple, arduino count every pulse (one pulse is one Wh). Every pulse, arduino send to HS the total pulse. If I restart arduino, or if arduino reset/restart I lose the count of pulse (power consumption). So, if "arduino_riavviato" var is 1 (arduino restarted), arduino read the "old" number of pulses from HS, in this way, arduino can sum other pulse to the previous... (It is hard for me to explain... :-) )

    Well thought!
    I do not need something so elaborate.
    For me the important thing is to continuously measure the instantaneous power, to have an event that allows me to warn of excessive consumption ... or / and a recurring event that informs me of the power consumption
    If you disconnect the HS3, or the server, for some reason you will also lose energy readings ... For me the energy consumed, in relation to power is an additional gift: a "good to have", but "not a "must to have"


    If you want, I can share with you my sketch.

    If you can share your sketch it will be great; thanks!


    (…) Sorry, I don't understand... If is a pulse, why you want to check as analogue signal? (…)


    The analogue inputs are digital inputs with the added functionality of analogue.

    sensor = digitalRead(14); // reads a digital signal on pin A0 …

    The idea came from here:

    http://www.smartofthehome.com/2013/0...eters-arduino/


    but as I said I'm thinking ..



    Leave a comment:


  • khriss75
    replied
    Originally posted by ANTOLIVEIRA View Post

    Just thinking ... another way would be to leave the interrupt in a small dedicated arduino and send the information via the serial to the arduino that is connected to the plugin ...
    Yes, this is the goal :-)
    I use for my watt meter a nodemcu. I simply count the time every 2 pulse and calculate the power.

    Originally posted by ANTOLIVEIRA View Post
    In your code to detect the pulse, what is the meaning of the "state" and the "arduino_riavviato" vars?
    Now I have to check my sketch because I don't remember well but the "state" variable is to check if the state of the pin is changed in order to "listen" the pulse.
    I added an other variable to check if arduino was restarted (arduino riavviato = arduino restarted)... why?
    Simple, arduino count every pulse (one pulse is one Wh). Every pulse, arduino send to HS the total pulse. If I restart arduino, or if arduino reset/restart I lose the count of pulse (power consumption). So, if "arduino_riavviato" var is 1 (arduino restarted), arduino read the "old" number of pulses from HS, in this way, arduino can sum other pulse to the previous... (It is hard for me to explain... :-) )

    If you want, I can share with you my sketch.

    Originally posted by ANTOLIVEIRA View Post
    concerning the pulse detection whitout interrupt, I was thinking of connecting the watt meter output to an analog input and check through the serial which would be the range of values that are read at the pulse momentum.
    Sorry, I don't understand... If is a pulse, why you want to check as analogue signal?

    Leave a comment:


  • ANTOLIVEIRA
    replied

    @khriss75: concerning the pulse detection whitout interrupt, I was thinking of connecting the watt meter output to an analog input and check through the serial which would be the range of values that are read at the pulse momentum. Thus create a trigger value and whenever that port reaches this value consider that there was a pulse. It seems that you solved differently ...
    Just thinking ... another way would be to leave the interrupt in a small dedicated arduino and send the information via the serial to the arduino that is connected to the plugin ...

    Leave a comment:


  • ANTOLIVEIRA
    replied
    Originally posted by enigmatheatre View Post
    Like khriss75 said I think the problem is you are flooding the plugin with data. You need to control how often the data is sent to the plugin from the board otherwise it will cause problems.

    Greig.
    Although I fully understand the answer, given the above situation it seems to me that the problem lies in the interrupt

    Leave a comment:


  • ANTOLIVEIRA
    replied
    Hi, khriss75!

    it's good to know that there's someone here who already did what I'm trying to do

    The part of the sketch relating to the analog inputs was made only to be sure that there was no difficulty transmitting this information to the devices created in the HS3
    At the beginning I did not put any restrictions on the transmission of information and I could see in the "Last Change Column" the devices to be updated every second
    Obviously this situation is neither acceptable nor necessary
    Then I put the restriction of only transmitting to HS3 if the difference between successive readings was significant and I made several experiments to the point of totally preventing communication
    The truth is that I had situations in which I was able to receive the information update of the analog inputs and the power and power consumption at very high rates and other situations in which although no information was transmitted from the analog inputs I could not have energy readings... (and the flow in the sketch is independent)
    I spent several hours trying various combinations and small changes in the sketch; even just with the routine of the interrupt the behavior appears to be random and there are situations in which even after turning off the HS3 and the arduino, on reboot, the board does not connect...

    To summarize: I am aware of the need to only transmit as often as necessary and that the sketch is not optimized for this, but this sketch was only used to test the communication. My conclusion is: If even without information transmission of the analog inputs I have had erratic behavior, I think I can draw the conclusion that I can not actually use interrupts, since apparently the procedure of download the sketch and the sketch (itself) appear to be sufficiently correct.

    Next steps: I will delete the sketch power/energy interrupt and create a timing to send the other information. I will check connection and data

    @khriss75: concerning the pulse detection whitout interrupt, I was thinking of connecting the watt meter output to an analog input and check through the serial which would be the range of values that are read at the pulse momentum. Thus create a trigger value and whenever that port reaches this value consider that there was a pulse. It seems that you solved differently ... In your code to detect the pulse, what is the meaning of the "state" and the "arduino_riavviato" vars?


    Thanks!

    Leave a comment:


  • enigmatheatre
    replied
    Originally posted by khriss75 View Post

    Hi Greig,
    some time ago (when the plugin was alpha (need to declare in and out in the sketch) I tried interrupt with no good results. Sure, could be that my sketch was not correct.
    My question: using intterupts in your sketch is not like use a delay? If arduino need to send something to hs via plugin and the programs stops for the interrupt, is not problematic? Sure, after interrupt the program restart from the end point but there is not the possibility to stop or slow down the data arduino <--> HS?
    Yes this is what I was saying if it is blocking it could miss data from HS and cause problems.

    Greig.

    Leave a comment:


  • khriss75
    replied
    Originally posted by enigmatheatre View Post
    I have not used interrupts in any of my code but can not see a reason for this to cause problems unless it is blocking like Delay().

    Greig.
    Hi Greig,
    some time ago (when the plugin was alpha (need to declare in and out in the sketch) I tried interrupt with no good results. Sure, could be that my sketch was not correct.
    My question: using intterupts in your sketch is not like use a delay? If arduino need to send something to hs via plugin and the programs stops for the interrupt, is not problematic? Sure, after interrupt the program restart from the end point but there is not the possibility to stop or slow down the data arduino <--> HS?

    Leave a comment:


  • enigmatheatre
    replied
    Like khriss75 said I think the problem is you are flooding the plugin with data. You need to control how often the data is sent to the plugin from the board otherwise it will cause problems.
    I have not used interrupts in any of my code but can not see a reason for this to cause problems unless it is blocking like Delay().

    Greig.

    Leave a comment:


  • khriss75
    replied
    Hi ANTOLIVEIRA,
    I'm not Greig and not a skill programmer but 2 consideration on your sketch:
    1) I think that that interrupt can impact on Arduino plugin. I already tested with not success the same condition (interrupt) exactly for a WattMetter (pulse).
    2) For analogues pin should be better to use a timer (use millis) in order to send the data every x seconds. Your sketch could generate a data flooding.
    I'm my sketch I send data to homeseer only if the data is not egual to previous and only every x seconds. In this mode there is not a lot data communication.

    For a watt meter, consider to use "pulsein" function.

    This is my sketch:
    Code:
    pinval = digitalRead(getpulsepin);   // legge il pin del sensore
    
      if ((state == 1) && (pinval == 0) && (arduino_riavviato == 0)) { // punto di transizione
        duration = millis() - startime;       // calcola la duration della pulsazione
        startime = millis();            // setta il nuovo tempo di partenza
        conteggio_impulsi = conteggio_impulsi + 1;
        power = 3600.0 / duration * 1000; // calcola consumo
        duration3 = duration / 1000.0;  //duration in seconds
    Then you can send power, duration3 and the number of pulse (conteggio_impulsi) to homeseer.


    Leave a comment:


  • ANTOLIVEIRA
    replied
    Originally posted by ANTOLIVEIRA View Post

    Concerning the API mode,
    is there any restriction on using arduino interrupts in my code?

    Can you post some example code for reading and writing to HS3 in order to minimize the learning curve?

    Hi Greig,
    I just checked the API mode with a little program on the arduino mega.
    The program simply reads four analog ports and transmits the information to the HS3.
    It also includes the code needed to count pulses and display the value of power and energy.
    (my target!)
    My point is that I have not come to any conclusion...
    It all started to work fine, but after a few hours I lost the connection and did not worked anymore.
    I do not usually have connection loss problems in arduino mode.
    Can you get a look at the code to see if there's something I'm doing wrong and can justify this erratic behavior?
    Obviously I'm not a programmer…


    Thanks

    Attached Files

    Leave a comment:


  • ANTOLIVEIRA
    replied
    Originally posted by enigmatheatre View Post
    Yes. This is what the API mode is for on the boards. You can send the information to HS form your own sketches.

    Greig.
    Concerning the API mode,
    is there any restriction on using arduino interrupts in my code?

    Can you post some example code for reading and writing to HS3 in order to minimize the learning curve?

    Leave a comment:


  • justinm001
    replied
    Trying to do something similar. How does the code work when passing the data? If we have a device on A0 is it as simple as SendToHS(1,A0) or does A0 need declared? Its been forever since doing this type of programming and I can't remember. Trying to pull soil sensor readings using NodeMCU. I'm hoping to put a few in my yard to determine why its so muddy

    Leave a comment:


  • khriss75
    replied
    Originally posted by ANTOLIVEIRA View Post
    Hello!

    I am using an arduino mega with multiple analog inputs connected to various sensors and digital relay outputs, connected to the HS3 by ethernet.
    This system works well.

    The point is that I wanted to start monitoring in HS3, instantaneous power and the total energy consumed.

    The power and energy information is available on another arduino mega that analyzes the number of pulses of the electricity meter in a given time period, the calculations are made in the mega and is available in the arduino serial output.

    Is there any way to use this plugin to pass this information to two HS3 devices (power and energy)?

    How can I manage the information that comes to me via serial port in order to assign it to the correct devices in HS3?

    Thanks
    This is exactly what I'm doing: I use an nodemcu with API sketch. It count total pulse in a day, the time between every pulse and calculate the power, To send data to homeseer simply "SendToHS(1, power)"
    API mode is fantastic world!

    Leave a comment:

Working...
X