Announcement

Collapse
No announcement yet.

How to send Output value from arduino to HS

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

    How to send Output value from arduino to HS

    It is possible to send a value from Arduino to HS for the Output?

    #2
    I'm not following what you are asking. An Arduino output is controlled by HS. How would an output change without HS initiating the request?
    HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

    Comment


      #3
      I’m creating a complex API in arduino, most of output is control by arduino, I'll use the hs output to trigger some fonction in arduino and not the output, for that I need to turn off the HS output when my fonction is done to be able to trigger arduino again

      Comment


        #4
        So you are controlling the output pin with your code, exclusive of HomeSeer and you want to update the status of the HomeSeer Device for that output.

        I think Greig will have to chime in on that, because the help file only talks about updating the value or string of an input. The same methods may work, but I have little API experience.
        HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

        Comment


          #5
          Yes this is exactly what I need, having a sendhs to the output.

          Comment


            #6
            I am not sure I understand 100% but I think you just need the SendToHS(Device ,Value ) to be called in your sketch to update the homeseer device with the value of your output.


            To Send Data to Homeseer use SendToHS(Device,Value) you can send a int, Long or Float to Homeseer. Eg.. SendToHS(1,200); where 1 is the API device in homeseer and 200 is the value to send In your code

            To Receive Data from Homeseer use FromHS(Device) this is an array of the values of your output devices in Homeseer. You can then do what you want with the value. Eg.. digitalWrite(MyPin, FromHS[5]); would set MyPin to the same value as API Output device 5

            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


              #7
              What I need is to be able to send SendToHS in the API to change a value in HS that is not part of Arduino plugin (hs.SetDeviceValueByRef(50, 100, True)), at the same time do you think we could have the possibility to read other HS value by reference number. This would give a wide possibility for the API

              Comment


                #8
                Originally posted by DonMor View Post
                What I need is to be able to send SendToHS in the API to change a value in HS that is not part of Arduino plugin (hs.SetDeviceValueByRef(50, 100, True)), at the same time do you think we could have the possibility to read other HS value by reference number. This would give a wide possibility for the API
                Both can be done with a small script or an event by setting the device you want to the other device value. If you have the easy trigger plugin this is done very easily.

                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


                  #9
                  Originally posted by enigmatheatre View Post
                  I am not sure I understand 100% but I think you just need the SendToHS(Device ,Value ) to be called in your sketch to update the homeseer device with the value of your output.


                  To Send Data to Homeseer use SendToHS(Device,Value) you can send a int, Long or Float to Homeseer. Eg.. SendToHS(1,200); where 1 is the API device in homeseer and 200 is the value to send In your code

                  To Receive Data from Homeseer use FromHS(Device) this is an array of the values of your output devices in Homeseer. You can then do what you want with the value. Eg.. digitalWrite(MyPin, FromHS[5]); would set MyPin to the same value as API Output device 5

                  Greig.
                  Just to really understand, the SendToHS(Device ,Value ) will update only the Input, and FromHS(Device) will read the Ouput, Arduino API don’t update HS output if it change in my program?

                  Comment


                    #10
                    There is an example in this post, see https://forums.homeseer.com/forum/an...vo-and-onewire

                    It has pictures of the devices in HomeSeer, Arduino set up and the API code used on the NodeMCU board.

                    I hope this helps.
                    Billy

                    Comment


                      #11
                      Originally posted by DonMor View Post
                      Just to really understand, the SendToHS(Device ,Value ) will update only the Input, and FromHS(Device) will read the Ouput, Arduino API don’t update HS output if it change in my program?
                      Correct. If you want to change a value in homeseer you need to add SendToHS( Device , Value ) to your code where the output is updated.

                      eg:
                      Code:
                          // if the LED is off turn it on and vice-versa:
                          if (ledState == LOW) {
                            ledState = HIGH;
                            SendToHS( 1 , 1 ); 
                          } else {
                            ledState = LOW;
                            SendToHS( 1 , 0 ); 
                          }
                      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


                        #12
                        Greig,

                        As I'm using the HS output to activate a fonction in my Arduino API, can you add the possibility to be able to send to HS output the value. Same as you do with the Input?

                        Don

                        Comment


                          #13
                          Originally posted by DonMor View Post
                          Greig,

                          As I'm using the HS output to activate a fonction in my Arduino API, can you add the possibility to be able to send to HS output the value. Same as you do with the Input?

                          Don
                          Don,

                          I am not 100% sure I understand what you are trying to do. I think you want to get the value of an output device in your sketch. If so use the following.

                          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

                          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


                            #14
                            I would like to be able from the arduino api to change the value of output in Homeseer, when I read fromhs() it trigger a function in the api then if an other condition append in the api I need to turn off the homeseer output.

                            Comment


                              #15
                              You can send to and receive the value from HS with FromHS() and SendToHS() and other coding is to be done in your code in the sketch or in an event in HS.

                              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

                              Working...
                              X