Announcement

Collapse
No announcement yet.

Arduino Script Testing. (Enigmatheatre)

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

  • dhalsall
    replied
    Thanks Greig,

    I have to admit, my coding abilities are Kindergarten level at best.

    My head is about to explode trying to understand your code

    I was hoping to achieve the functionality in a single line of code. Reading other posts, I was thinking something like this might work (but of course it doesn't - and I'm just not smart enough yet to know why):

    &hs.CAPIControlHandler(&hs.CAPIGetSingleControl(37, false, "ON", false, true))

    I keep referencing the HomeSeer Scriping guide, but the lack of syntax / examples make my brain pain worse.

    Ultimately, this is a linux box and I'm not sure if it's an issue of C# vs vb.s that adding to my challenge. I did try the same line with &shs. .... ; but just different errors - lol.

    anyway, I don't expect you to waste your time teaching me - but if you have a cheat for doing this in one line, that would be wonderful!

    Leave a comment:


  • enigmatheatre
    replied
    Originally posted by dhalsall View Post
    Hope I'm not too off topic here...

    I'm attempting to control a PWM output device with &hs.SetDeviceValueByRef.

    When I execute the command:
    &hs.SetDeviceValueByRef(37, 80, True)

    The slider in the device status screen changes to 80%, but the actual PWM output doesn't change. Of course, if I slide it with the mouse, it does change the output.

    Is there a better way to achieve this?
    You need to use CAPI to control it.

    I use this function and pass the param of the value you need.

    PHP Code:
    Function CallCAPI(ByVal intDevRef As IntegerByVal strDevCmd As String) As CAPIControlResponse
        hs
    .writelog("CallCAPI""Device Reference: " intDevRef " strDevCmd: " strDevCmd)
        
    CallCAPI CAPIControlResponse.Indeterminate
        
    For Each objCAPIControl As CAPIControl In hs.CAPIGetControl(intDevRef)
            If 
    LCase(objCAPIControl.Label) = LCase(strDevCmdThen
                CallCAPI 
    hs.CAPIControlHandler(objCAPIControl)
                Exit For
            
    End If
        
    Next
    End 
    Function 
    Greig.

    Leave a comment:


  • dhalsall
    replied
    Hope I'm not too off topic here...

    I'm attempting to control a PWM output device with &hs.SetDeviceValueByRef.

    When I execute the command:
    &hs.SetDeviceValueByRef(37, 80, True)

    The slider in the device status screen changes to 80%, but the actual PWM output doesn't change. Of course, if I slide it with the mouse, it does change the output.

    Is there a better way to achieve this?

    Leave a comment:


  • gdyrdave
    replied
    Originally posted by enigmatheatre View Post
    I can say I have thought about it but just not had the time to put it in place.
    When you say you are locked in to version 2 are you talking about HS as I now only support my HS3 plugin and not my HS2 script.

    Greig.

    Sent from my HTC One using Tapatalk
    Would you be willing to release the source for the HS2 script for those of us that use that version and use HS2 ? So we can make changes to it. Just asking.
    Dave

    Leave a comment:


  • enigmatheatre
    replied
    Originally posted by gdyrdave View Post
    Greig, Have you thought about this any more? I am looking to make up some wireless points around the house. Right now I am locked into version 2 and I dont expect to upgrade to version 3 anytime soon. I was planning to use ESP-01's for the coms on this. Thanks

    Dave
    I can say I have thought about it but just not had the time to put it in place.
    When you say you are locked in to version 2 are you talking about HS as I now only support my HS3 plugin and not my HS2 script.

    Greig.

    Sent from my HTC One using Tapatalk

    Leave a comment:


  • gdyrdave
    replied
    Originally posted by enigmatheatre View Post
    This is something I have on my list of things to do.
    I want to make it possible to send the data for all boards to one port so you can use one wireless gateway for all boards.

    Greig.
    Greig, Have you thought about this any more? I am looking to make up some wireless points around the house. Right now I am locked into version 2 and I dont expect to upgrade to version 3 anytime soon. I was planning to use ESP-01's for the coms on this. Thanks

    Dave

    Leave a comment:


  • alback
    replied
    Thanks, I'll check them out.

    Leave a comment:


  • sparkman
    replied
    Originally posted by alback View Post
    So you didn't use the enigmatheatre plugin for your devices. I was hoping to figure out a way to use the plugin for all my devices. I want to turn on a heat lamp if it is cold, open and close a sliding door mechanism morning and night, and fill the water dish and feed bowl when empty. If I understand correctly, you trigger an event with input from your sensors and use that to send commands through the com port to your devices using your packet definition. You use HS basically to display status, trigger events and log activity. I guess I could make that work in my case also but I was looking for a different approach.

    Is there a reason why we cannot provide a moteino or jeenode wireless interface to the plugin? I wanted to use the devices established with the plugin or something like it and write vb scripts in HS to read their status and command them to perform the ON/OFF actions I desire. As you can tell, my expertise in this area is minimal.
    Take a look at post 182 in this thread where he describes how he's getting the data into HS. You should be able to do something similar for the Jeenodes.

    There are currently two plugins that support Arduino's: Enigmatheatre's and MySensors. I use both for different purposes. There's currently no plugin that supports the Moteinos or the Jeenodes.

    Cheers
    Al

    Leave a comment:


  • alback
    replied
    So you didn't use the enigmatheatre plugin for your devices. I was hoping to figure out a way to use the plugin for all my devices. I want to turn on a heat lamp if it is cold, open and close a sliding door mechanism morning and night, and fill the water dish and feed bowl when empty. If I understand correctly, you trigger an event with input from your sensors and use that to send commands through the com port to your devices using your packet definition. You use HS basically to display status, trigger events and log activity. I guess I could make that work in my case also but I was looking for a different approach.

    Is there a reason why we cannot provide a moteino or jeenode wireless interface to the plugin? I wanted to use the devices established with the plugin or something like it and write vb scripts in HS to read their status and command them to perform the ON/OFF actions I desire. As you can tell, my expertise in this area is minimal.

    Leave a comment:


  • alback
    replied
    OK, thanks

    Leave a comment:


  • luisr320
    replied
    In my case, all devices are created as "Virtual Devices".
    Then I pass values for it to display.

    For instance:


    virt_device="Z80"
    hs.SetDeviceValue virt_device,tempValue

    Will update the virt_device Value with the data received from the temperature probe.

    Leave a comment:


  • alback
    replied
    Homeseer devices

    Perhaps I missed something but how do I create Homeseer devices and tie them to the Moteino world. I don't understand how or when you created any devices that represent the sensors.

    BTW I am computerizing a chickencoop and want to use Jeenodes which I already have (very similar to Moteino) to monitor things such as temperature etc. and to open and close a sliding door to keep the fox out of the henhouse.

    Leave a comment:


  • Jakob.Sand
    replied
    Originally posted by enigmatheatre View Post
    This is something I have on my list of things to do.
    I want to make it possible to send the data for all boards to one port so you can use one wireless gateway for all boards.

    Greig.
    Hi Greig,
    That sound even better. Not being af programmer to have this in your plugin would be great!
    For mee the price of the smalls boards mentioned seems very attractive and combined with your plugin really cool.

    Leave a comment:


  • sparkman
    replied
    Looks great, thanks for sharing!

    Cheers
    Al

    Leave a comment:


  • luisr320
    replied
    This project uses a couple of components:
    1 rectyfing bridge, 1 condenser, 2 transistors to control the relays, two relays and a LM2596 power regulator board (the blue thing) I got from ebay.

    The rectifying bridge is necessary because there is only 12v AC available in the box, so it must be converted into DC, filtered with the condenser and regulated to 5v.

    Here is my gate, with the control box on the left:


    Size fitting a perfoboard (top right):


    Parts layout, without the moteino installed:


    And now, with the moteino:


    Board spaghetti:


    All in its place, ready to use:


    Some more detail:

    Leave a comment:

Working...
X