Announcement

Collapse
No announcement yet.

Homeseer + Node-Red + Asterisk Integration

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

    Homeseer + Node-Red + Asterisk Integration

    Hoping I can get a little bit of assistance. I'm super-new to Node-Red (probably 3 days worth right now :-) and am trying to use it as a go-between to interface between my HomeSeer (HS4) and my Asterisk system.

    I've been successful in both reading and setting the appropriate status indications on the Asterisk system from Node-Red. This evening I've been successful in doing the same between Homeseer and Node-Red using the examples posted here by ksum

    There are some bits and pieces in this example that are not really required to my end result but for learning purposes it's great to have them in place for now and ultimately I can hack those bits out later once I'm more proficient with Node-Red.

    The current flow between HS and Node-Red is inserted below. Now the question is how to glue the two halves of the equation together, and thats where I'm needing some help.

    For purposes of this excercise the HomeSeer device is a ZWave dimmer with a light connected.
    a) when a device's status changes in HomeSeer I need to pass the status change from Homeseer over to Asterisk
    b) when Asterisk wants to turn the light on or off (no dimming), forward that request from Asterisk through to Homeseer to do the on-ing and off-ing

    I'm just not quite comfortable yet on how the flows work in Node-Red so, assuming I want to preserve the functionality as presented below where in the flow would be the best places to splice in the above two bits of functionality?


    Click image for larger version

Name:	hs-red.jpg
Views:	224
Size:	61.1 KB
ID:	1577426

    #2
    I could look at this Monday when I'm at a computer. Could you include your Asterisk section of the flow as well? Also, am I right in guessing that you don't care about the Node-Red dashboard? If I am, we will likely remove everything from your HomeSeer portion except the HomeSeer nodes. There may be a question as to what comes out if your Asterisk node(s) as well.

    Karl
    Karl S
    HS4Pro on Windows 10
    1070 Devices
    56 Z-Wave Nodes
    104 Events
    HSTouch Clients: 3 Android, 1 iOS
    Google Home: 3 Mini units, 1 Pair Audios, 2 Displays

    Comment


      #3
      Thanks ksum I'll post the Asterisk stuff sometime this weekend. Ultimately yes it's the Node-Red dashboard stuff that isn't required for this "project" though it's been a great mid-ground to give me an understanding of how Homeseer and Node-Red interact. The Asterisk bits I have are much the same, read the blinky lights on the phone system and turn them on and off.

      Ultimately it should be pretty straight forward... monitor a number of Asterisk hints and turn matching Homeseer devices on and off in response and on the flip side monitor the status of the Homeseer devices and turn the matching Asterisk hints on and off in response. Much fancier stuff floating around in the back of my mind but this is sort of proof-of-concept.

      Mike

      Comment


        #4
        Hi ksum, here are the posts of the Asterisk stuff as requested. This first one I can basically hit the trigger buttons to set the (hardcoded) test hint's state to INUSE or NOT_INUSE and see the state change (along with a whole bunch of other stuff I don't care about) in the debug output.

        Click image for larger version  Name:	Asteriskred.jpg Views:	0 Size:	20.4 KB ID:	1577661

        In this second example that I found was basically just how to narrow down to *just* device state change (ignore the restart trigger, that just came along with the sample :-). It could be refined further to trap just state change events for the devices I'm interested in. This one doesn't have any logic to set the hints, it's just viewing the changes coming from the PBX.

        Click image for larger version  Name:	asteriskred2.jpg Views:	0 Size:	40.4 KB ID:	1577660

        it's just the FreePBX node and (some of the) surrounding switch nodes that would be the active part of those samples.

        Ultimately simplified we have a LED and button on the Asterisk system, and we have a light and switch on the Homeseer system. The LED and light need to be kept in sync and the button/switch on either end should be able to initiate the change... and Node-Red makes the magic happen :-)

        Mike

        Comment


          #5
          You could use the AMI Event switch node from your second image to filter out the desired messages. Feel free to remove the messages you do not use if you wish. Or just do not hook a wire up to the ones you do not want. Without seeing a complete debug output of the FreePBX node, I would say use the Switch node to provide outputs for your On and Off entries from the FreePBX with a Change Node to control th4e HomeSeer device and wire it over to the device. It will look something like this for the On control:
          Click image for larger version

Name:	image.png
Views:	144
Size:	23.0 KB
ID:	1577871‚Äč
          Create one for Off as well and connect both to the HomeSeer node. You should now have HomeSeer staying in sync with FreePBX.


          Coming out of your HomeSeer node you may be able to use a Switch and Change node similar to the above to change the message as needed (base it on the inject node you have which is working) and then wire that into your FreePBX node. the Switch could be based on msg.payload.status.

          If the FreePBX node sends and receives a message with On or Off and your HomeSeer node can use the same, then we can simplify this a bit more.

          If you need more detailed information, let me know. If you start getting circular messages, take a look at post 3 in this thread.
          Karl S
          HS4Pro on Windows 10
          1070 Devices
          56 Z-Wave Nodes
          104 Events
          HSTouch Clients: 3 Android, 1 iOS
          Google Home: 3 Mini units, 1 Pair Audios, 2 Displays

          Comment


            #6
            Thanks ksum, I've been absolutely swamped but will give this a go as soon as I've got a free minute. Fingers crossed :-)

            Comment

            Working...
            X