New Project with MySensor network and autonomous nodes



  • Hi everyone!

    I'm Daniel, I'm Portuguese currently living in Switzerland and I'm a software developer with good knowledge in electronics.

    I'm starting now a new project and I'm counting on all of you to help me 🙂 and of course that I would be a pleasure to help anyone or contribute to this project.
    So the project will consist in building a "Home automation" system to my apartment with some particularities, one of those is the UI and usability so I'll use PiDome as a controller, maybe openHAB2 in the future.

    I need your help exactly in the particularities that I mentioned before as what I want to do I'm sure that is possible but I didn't find any example or existing project, so I would like to have all the opinions and advices that I can get.

    I'm thinking in having a RPi with PiDome and a ~7" touch-screen as a central console (maybe a very cheap tablet will also do) and a arduino MySensor network with an arduino as a MQTT Gateway (are there better solutions?)
    For the sensors I'm planing to have DT22, PIR, light sensor, actuators and light switches, and my requirements are the ones that I'll list below:
    1- Each arduino needs to be autonomous, e.g. connect a switch to it that if pressed will turn on/off the light connected to it without the need to communicate to the PiDome to avoid lag and improve robustness. (I saw HERE that someone is already struggling with a similar idea)
    2- Be able to know the state (on/off) of the beforehand mentioned ligh, and switch it on/off from PiDome.
    3- Being able to use the PIR sensor to turn on/off some "presence lights", and enable/disable this behaviour at any time from PiDome.

    Everything else that I'm planing is already well documented.

    So do you think that is possible? Do you know where to start or can point me in the right direction?

    Finally I would like to have some opinions, do you recommend to use the Arduino Nano or the Pro Mini?

    Thank you all in advance, and don't hesitate to contact me,
    Daniel


  • Plugin Developer

    Hi Daniel,

    Regarding using a 7 inch screen on the central console. I'm busy with user created dashboard interfaces of which you can use. These can be shown in a browser on a tablet: https://twitter.com/Pi_Dome/status/627081006454063104/photo/1. The application i'm working on which when done will be running on Android tablets and phones (or an rpi 2) will look exactly the same and can be used as or a personal dashboard or as a client on a fixed location (more info here: http://forum.pidome.org/viewtopic.php?pid=1223#p1223)

    To answer your points:
    1 - This is possible using relays so a 5/3.3 volt powered arduino can switch higher powered lights (110/220 volt) and while you switch the light send a status update to pidome. I do not have a schematic available but incorporating an arduino pro/mini and the hardware to safely switch high powered items can be quite a challenge (I have seen some posts about this on this forum, but could not find them this quickly).
    2 - Send a request to pidome asking the current status known. This will be send back. ( use the message type "req").
    3- A: A pir sensor could be configured to send a tripped (or alike) value to pidome. On pidome you then would create an automation rule which reacts on the pir's value (tripped = true) and send a command to the selected lights to turn these on. You then can complement the rule with if the pir value = false for a certain amount of time send a command to turn it off.
    3- B: If you have multiple lights as presence lights you can create a macro which turns on all these lights and a macro to turn them off and use these macro's in the automation rule.

    I am currently busy migrating the mysensors support to 1.5. I would wait a bit until this is available to get a good start.

    Cheers!



  • Thank you @John 🙂

    I'll take this info and dig up in the forum and I'll came back if have more question.
    Also I plan to document all the steps as I'm starting from scratch, so it may help another newbie in thee future.

    Good to know that the migration to 1.5 is already under way, I'll start doing the component list and ordering them.

    Cheers!


  • Plugin Developer

    @Daniel-Oliveira

    Version 1.5 is ready to be downloaded from both regular location and the snapshot builder. Very nice to have it documented, this can help others here!

    Let me know,
    Cheers!



  • Hi @hek, @John and all

    I have a question, does the MySensors and/or the PiDome properly handle an use case where all sensor nodes are started at the same time? e.g. after a power failure?

    In an example where I have many, let's say, temperature sensors and in all of them I define the exact same SLEEP_TIME, if all of those sensors boot at the same time will they send the info to the GW at the same time? Does this cause any problem?

    I'm asking this because I'm thinking if it would be useful/needed a mechanism where I get some values from the GW (or the GW pushes to the sensors), like sleeping times, thresholds and so on to avoid re-flashing all the sensors each time I want to fine tune some parameters.

    Thank you,



  • I like the idea to change the sleeping times from the controller. 😄 You could use the VAR1-5 value types for that.

    @hek, this calls for a I_SLEEPTIME internal variable 😉


  • Plugin Developer

    With PiDome you are able to add options to device skeletons you create (so you can re-use devices). When you add a device to the server you can set these options.

    Example: You have 5 temperature nodes, you create a skeleton once with your temperature node setup, you add the option poll time with a drop down choosing between 1, 5, 10 minutes (you can also use input fields off course).

    When you add these devices to the server you then can set the polling time per device. By using the mysensors functionality to do a data request you will be able to get the option's value (See "Requesting data" on the API page: http://www.mysensors.org/download/sensor_api_15).

    But. The above does not work yet for PiDome as this is not implemented in the mysensors plugin. Too be honest i did not even have thought about it. I have created a feature request for the mysensors plugin to have this implemented at: https://bitbucket.org/pidome/pidome-mysensors/issues/4/be-able-to-create-options-for-devices-in So if you are going to use PiDome or not, this will be implemented (so other users will also be able to use it when it becomes available).

    I can not yet give an estimate on when this is implemented as the Custom devices editor is on the optimization list, and currently i'm extremely busy with the raspberry pi client to have it compatible on multiple display resolutions (starting from 240*320). You have the possibility to vote for the option so it can go up on the prio list (It is the three of PiDome deciding which option is next to pick up).

    Regarding of booting all the sensors at the same time. The server does not care. It is capable of handling bulk messages from the gateway. So you need @hek to answer this one.


Log in to reply
 

Suggested Topics

  • 8
  • 1
  • 44
  • 1
  • 2
  • 90

2
Online

11.2k
Users

11.1k
Topics

112.5k
Posts