Plugin for Indigo for Mac


  • Mod

    Only a few weeks ago I installed camera's in and around our house.
    One thing lead to another and a couple of z-wave sensors/switches magically arrived in the same box πŸ˜‰
    After installing all these goodies and making all this work using SecuritySpy and Indigo (www.perceptiveautomation.com) I found this website.

    My project will involve creating an Indigo plugin as soon as my Arduino Pro Mini's, radio's etc arrive.
    I should have seen them arriving already, instead my battery holders have arrived last week...

    Anyway, wish me luck since all this is quite new to me...

    Cheers,

    Marcel


  • Admin

    Great Marcel,

    Let us know if you need help to interpret the API.


  • Mod

    So, I have my Gateway up and one Temperature sensor.

    The plugin only reads at this point so I fixed the sensor id to 10.

    This is what I receive but I can't make much of it yet.

    Is this ok (I am not sure, looking at the API I would say not really) ?

    0;0;4;11;Message available on pipe 1
    0;0;4;11;Sent ack msg to 10
    0;0;4;11;Rx: fr=10,to=0,la=10,ci=255,mt=4,t=13,cr=13(ok):
    10;255;4;13;



  • 10;255;4;13; is the interesting part. The messages above is network debug message.
    10 - is the Raido ID
    255 - is the Node, see it as the arduino without the sensors.
    4 - means internal message type. It’s used to send messages between an intelligent controller and the network. i.e vera or what you are about to write.
    13 - is the subtype of the internal message in this case I_UNIT.

    So what your arduino is doing is requesting the unit type for your sensor network. It’s ethier M as in Metric or I as in imperial.

    The arduino except to get a answer back telling it either
    10;255;4;13;M or 10;255;4;13;I

    This is the call in the arduino requesting what metric system to use.
    metric = gw.isMetricSystem();

    All types are explained at http://www.mysensors.org/build/sensor_api

    What you want to do is port most of the functions in https://github.com/mysensors/Vera/blob/master/L_Arduino.lua
    and build some yourself since the Vera is doing some part that you don’t know about. Keeping track of some information.

    You can see my python project (still without a name) at https://github.com/wbcode/ham where you can steel, borow, push or fork ideas/code to/from.

    WB


  • Mod

    @wannabee Thanks, will play with this tomorrow. Looks good πŸ™‚


  • Mod

    @wannabee good stuff! I learn(ed) a lot from it because I am a novice in Python.
    And it also made me even better understand what, how and when to communicate between controller, gateway and sensor.

    I managed to set the id and collect the temperature of a sensor using the beginning of my plugin.

    Now I can start building πŸ™‚


  • Mod

    Oh, question: After sending the ID to a sensor will the sensor store it 'permanently'?


  • Admin

    @marceltrapman

    Yes (it saves it to the EEPROM).



  • @marceltrapman Glad it was helpful, Tricky part is to develop something that sends information into the network from outside. ie when you want to turn a switch on or off.




  • Mod

    Nice @wannabee

    Three other questions:

    1. Am I correct that an Arduino board/node always presents itself and its children upon inclusion (after startup) ?
    2. I do not see a way to set the child id so assume this is set by the Arduino board/node itself?
    3. Is there a way to 'manually' ask for all available Arduino boards/nodes and/or sensors available through the gateway?

    In other words: "I like this" πŸ™‚



  • @marceltrapman said:

    Am I correct that an Arduino board/node always presents itself and its children upon inclusion (after startup) ?
    I do not see a way to set the child id so assume this is set by the Arduino board/node itself?
    Is there a way to 'manually' ask for all available Arduino boards/nodes and/or sensors available through the gateway?

    1 For every sensor on a board you send:
    gw.sendSensorPresentation(<sensor_child_id>,<sensor_type_id>);

    2 the sensor_child_id is set by the board.
    Ie.
    #define CHILD_ID_HUM 0
    #define CHILD_ID_TEMP 1

    And then later:
    gw.sendSensorPresentation(CHILD_ID_HUM, S_HUM);
    gw.sendSensorPresentation(CHILD_ID_TEMP, S_TEMP);

    In the HumiditySensor.ino

    3 Here @hek have to correct me. The answer is maybe, if you dig deep in the routing table in the gateway. But the gateway will lose that info when rebooted. It would also be possible to send a broadcast to all nodes asking them for info, but in that case you have to implement a function in the nodes that answers on broadcast. It will also make them not sleep. I keep track of available sensors in the python code. It’s the same way the vera is doing it. You basicly stores all sensors that have sent a presentation.


  • Admin

    Currently, no, The routing table exists in gateway (and is not lost when rebooting). But it only contains information about were to send messages for a certain radioId (realy or direct route). Not what type of sensor(s) that each node has attached. Unfortunately the Arduino is a bit limited on how much data we can store in the EEPROM.


  • Mod

    @wannabee @hek
    Both your answers have helped me a lot! Thanks a million!!!

    My 'issue' was that I was trying to do all the fancy stuff from the Controller (Indigo, or better my plugin, in this case) but obviously the sensor can be set to be active as well πŸ™‚

    I have made great progress today thanks to you guys...


  • Mod

    For the fun of it!

    Screen Shot 2014-04-29 at 21.42.13.png Screen Shot 2014-04-29 at 21.42.40.png Screen Shot 2014-04-29 at 21.42.58.png


  • Admin

    Cool! Great work!


  • Mod

    Thanks, while looking at my screenshots again I also found a little mistake πŸ™‚


  • Mod

    Here you see the full power of Indigo.

    I added 2 relays to the existing temperature sensor.
    In fact a created a custom multi sensor.

    This is what it looks like in Indigo.

    I will make it so that when a device will be updated or added all sensors are included πŸ™‚
    Screen Shot 2014-04-30 at 23.30.59.png


  • Mod

    I am happy, the plugin is not ready but I moved it to my Indigo Server and it is now in production πŸ™‚

    What am I using it for right now?

    The temperature sensor shows the temperature in a computer cabinet.
    Based on the temperature a fan is enabled/disabled to lower the temperature.

    For that I added the board with attached sensors and I created triggers.

    Here it is:...

    Screen Shot 2014-05-06 at 22.11.48.png Screen Shot 2014-05-06 at 22.12.13.png Screen Shot 2014-05-06 at 22.12.17.png


  • Mod

    Added the source to github: https://github.com/IT2BE/indigo-mysensors

    Please beware: the plugin is not ready. I have a few sensors working but I am awaiting my mini pro's to be delivered before I can move ahead.
    In the meantime I will polish things as I am also getting ready to go on vacation in about 10 days πŸ™‚


  • Admin

    Nice.
    I cloned it to mysensors so people will find it easier.


  • Mod

    @hek thanks!
    When, in the future, you want to move it to your repo that is fine with me as well.


  • Mod

    Yesterday evening I added a bit to the read me and improved support for the motion sensor.


  • Mod

    And I updated the readme file so that it should be possible for those that feel like it to start testing it.
    This was my favourite piece of work πŸ™‚


  • Admin

    Ok, great work!

    Pulled your changes.


  • Mod

    It is a long time ago (too long) since I found the time to work on the plugin.
    Once I restarted the project I noticed that 1.4 beta was out so I first wanted to work on adopting these libs before moving on.

    There are still a few things I don't like so I am not going to commit yet but the work is going well.

    One of the things I wanted to add was support for the battery level.
    Indigo supports it very well (see screenshot) and it is dynamic.

    What does that mean: when you implement 'gw.sendBatteryLevel(value);' indigo will create support for it and from that moment on Indigo will update the battery level.

    BTW don't pay attention to the 200%, I definitely need to do some additional work on my battery check libs...

    I will keep you posted again πŸ™‚

    Screen Shot 2014-07-23 at 23.40.52.png


  • Mod

    Following the release of MySensors 1.4 I made the latest build of the MySensors plugin for Indigo available on GitHub.

    I have been using it for a while now with 1.4beta and changed things around to support the 1.4 release (among other things).

    When you start using this version of the plugin please be aware of yet limited support of sensors simply because I have not (yet in some cases) built them...

    Please use GitHub to let me know about bugs and/or feature requests...

    • Added support for 1.4 (1.3 is not supported anymore).
    • Added support for batteryLevel
    • Added more variable types with 'native' states instead of generic states:
    • TEMP
    • HUM
    • PRESSURE
    • RAIN
    • RAINRATE
    • WIND
    • GUST
    • UV
    • DISTANCE
    • TRIPPED
    • HEATER_SW
    • LIGHT_LEVEL
    • Added menu item to remove failed devices
    • Added menu item to remove unused device
    • Cleaned up and optimized code

  • Mod

    I released a new, more stable, version of the plugin: https://github.com/IT2BE/indigo-mysensors/releases/tag/v1.2.179.

    From the release notes:

    • Added menu item to reset the plugin (all sensors and devices are removed).
    • Improved the way a plugin is added or updated.
    • Fixed an issue with on/off state sensor like the motion sensor.

Log in to reply
 

Suggested Topics

  • 3
  • 2
  • 5

47
Online

11.4k
Users

11.1k
Topics

112.6k
Posts