Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. Domoticz
  4. Robot mower ignores the rain, MySensors to the rescue!

Robot mower ignores the rain, MySensors to the rescue!

Scheduled Pinned Locked Moved Domoticz
28 Posts 6 Posters 8.0k Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Mark SwiftM Offline
    Mark SwiftM Offline
    Mark Swift
    wrote on last edited by
    #1

    Hello,

    I've just started with Domoticz and a NodeMCU MySensors gateway and various Nano's (Finally they can be put to use!). Firstly, the recent acknowledge changes in Domoticz seem to work great, returning an error if the node is unreachable! Thanks.

    My question is, I have a number of flows that send an action to one of my relay nodes. i.e. if a rain / moisture node reports either rain or moisture, toggle relay node (I'm actually just closing the 2 rain sensor dimples of my robot mower with a digital pin and gnd to imitate rain, the sensor itself is useless at detecting rain, hence why I'm here!).

    The issue is, the node relay is attached to the mower itself, which might be out of range cutting the garden. I'd also like the option of sleeping the sensor as it will need to be battery powered?... What I'd like is for the toggle to be resent until it's successful, instead of just once (which might fail, thanks to the recent ack changes). Any ideas? Perhaps I'm missing another way of achieving this?

    Thank you in advance,

    Mark

    TheoLT 1 Reply Last reply
    0
    • Mark SwiftM Mark Swift

      Hello,

      I've just started with Domoticz and a NodeMCU MySensors gateway and various Nano's (Finally they can be put to use!). Firstly, the recent acknowledge changes in Domoticz seem to work great, returning an error if the node is unreachable! Thanks.

      My question is, I have a number of flows that send an action to one of my relay nodes. i.e. if a rain / moisture node reports either rain or moisture, toggle relay node (I'm actually just closing the 2 rain sensor dimples of my robot mower with a digital pin and gnd to imitate rain, the sensor itself is useless at detecting rain, hence why I'm here!).

      The issue is, the node relay is attached to the mower itself, which might be out of range cutting the garden. I'd also like the option of sleeping the sensor as it will need to be battery powered?... What I'd like is for the toggle to be resent until it's successful, instead of just once (which might fail, thanks to the recent ack changes). Any ideas? Perhaps I'm missing another way of achieving this?

      Thank you in advance,

      Mark

      TheoLT Offline
      TheoLT Offline
      TheoL
      Contest Winner
      wrote on last edited by TheoL
      #2

      @Mark-Swift I'd like to help, but I'm not exactly sure what it is you're looking for. Could you be more specific? What is it that you want to accomplish. e.g. rain detection. What is the problem..

      1 Reply Last reply
      0
      • Mark SwiftM Offline
        Mark SwiftM Offline
        Mark Swift
        wrote on last edited by
        #3

        Hi,

        The issue is, the relay node on the mower might be out of range or asleep at times, however I'd still like it to receive the relay command when it wakes or returns into range... So it can close the relay and tell the mower it's raining.

        How can I ensure the command from Domoticz reaches the mower given it might be asleep or out of range for periods of time?

        The flow in Domoticz is: If garden node detects rain or soil moisture high, send close command to relay node (mower).

        TheoLT 1 Reply Last reply
        0
        • Mark SwiftM Mark Swift

          Hi,

          The issue is, the relay node on the mower might be out of range or asleep at times, however I'd still like it to receive the relay command when it wakes or returns into range... So it can close the relay and tell the mower it's raining.

          How can I ensure the command from Domoticz reaches the mower given it might be asleep or out of range for periods of time?

          The flow in Domoticz is: If garden node detects rain or soil moisture high, send close command to relay node (mower).

          TheoLT Offline
          TheoLT Offline
          TheoL
          Contest Winner
          wrote on last edited by
          #4

          @Mark-Swift I think you have two different issues:

          1. Robot might be out of range
            2.the relay node might be asleep

          The first issue can easily be fixed be creating a repeater node. Or more of you have a really large garden.

          The second can not be fixed. I asked a simular question last week But a sleeping node cannot be awakened by the MySensors network.

          My solution would be. To add a rain sensor to your robot, let that signal the robot to quit/move and signal the fact that it's raining. I know it will consume more power. But I think you can awaken the node on an interrupt triggered by the rain sensor. That way you can keep the sensor using the sleep mode.

          1 Reply Last reply
          0
          • TRS-80T Offline
            TRS-80T Offline
            TRS-80
            wrote on last edited by
            #5

            Well, I would presume that the robot mower base station has some battery charging function for the mower when it returns home to park? If so, there should be some sort of power supply available there.

            Why not add a node at the mower base station that is either always on, or checks in more frequently with the controller (or wherever it's getting it's rain information from) in order to tell it to "stay home" somehow.

            Also, I would think you would want to base the decision whether to send the mower out or not based on if it's raining right now or not. How long after it starts raining does it take your soil moisture sensor(s) to register? If this happens quickly, then disregard. Otherwise maybe you might want some sort of rain sensor instead.

            1 Reply Last reply
            0
            • SparkmanS Offline
              SparkmanS Offline
              Sparkman
              Hero Member
              wrote on last edited by Sparkman
              #6

              Hi Mark,

              Why not have the sensor on the mower wake up periodically (eg every 30 seconds, or once per minute, etc.) and have it ask for an update? If it does not get a response, then leave it in its current state. That should accommodate both issues.

              Cheers
              Al

              Mark SwiftM 1 Reply Last reply
              0
              • SparkmanS Sparkman

                Hi Mark,

                Why not have the sensor on the mower wake up periodically (eg every 30 seconds, or once per minute, etc.) and have it ask for an update? If it does not get a response, then leave it in its current state. That should accommodate both issues.

                Cheers
                Al

                Mark SwiftM Offline
                Mark SwiftM Offline
                Mark Swift
                wrote on last edited by
                #7

                @Sparkman said:

                Hi Mark,

                Why not have the sensor on the mower wake up periodically (eg every 30 seconds, or once per minute, etc.) and have it ask for an update? If it does not get a response, then leave it in its current state. That should accommodate both issues.

                Cheers
                Al

                This sounds like an ideal situation, sadly I have absolutely no idea how to perform such an action from the node on the mower, I presume it would need to query Domoticz somehow... Any ideas or examples?

                Thanks,

                Mark

                1 Reply Last reply
                0
                • SparkmanS Offline
                  SparkmanS Offline
                  Sparkman
                  Hero Member
                  wrote on last edited by
                  #8

                  Hi Mark,

                  The only example I can think of is @BulldogLowell's sprinkler controller. It queries for run-times from the controller. I think that is supported on the Vera, and not sure if Domoticz supports the same feature.

                  Cheers
                  Al

                  1 Reply Last reply
                  1
                  • sundberg84S Offline
                    sundberg84S Offline
                    sundberg84
                    Hardware Contributor
                    wrote on last edited by
                    #9

                    Hi!
                    Some examples of getting a value from Domoticz is
                    @AWI http://forum.mysensors.org/topic/1976/scrolling-text-sensor-node-with-new-v_text and http://forum.mysensors.org/topic/1957/lcd-clock-and-text-sensor-node-with-new-v_text.
                    My LCD screen uses the same method:
                    https://www.openhardware.io/view/23/In-wall-LCD-SwitchScene-controller-for-MySensors

                    Controller: Proxmox VM - Home Assistant
                    MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
                    MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
                    RFLink GW - Arduino Mega + RFLink Shield, 433mhz

                    1 Reply Last reply
                    1
                    • Mark SwiftM Offline
                      Mark SwiftM Offline
                      Mark Swift
                      wrote on last edited by
                      #10

                      Hi Guys,

                      Firstly, thank you very much for the replies and help. I'm really struggling to get my head around it, and have been playing around the last few hours with little results.

                      From the above is seems logical to have one node in the mower garage, connected to both a rain sensor and soil sensor, this doesn't need to sleep and can update domoticz frequently. I'm using simple on / off switches for both rain and moisture in Domoticz.

                      I now need to figure out how to have a node wake up and check the status of the rain and moisture switches from Domoticz - after a couple of hours trying various things, I'm at a loss how to achieve this. Perhaps I should consider giving up :-(

                      TheoLT 1 Reply Last reply
                      0
                      • Mark SwiftM Mark Swift

                        Hi Guys,

                        Firstly, thank you very much for the replies and help. I'm really struggling to get my head around it, and have been playing around the last few hours with little results.

                        From the above is seems logical to have one node in the mower garage, connected to both a rain sensor and soil sensor, this doesn't need to sleep and can update domoticz frequently. I'm using simple on / off switches for both rain and moisture in Domoticz.

                        I now need to figure out how to have a node wake up and check the status of the rain and moisture switches from Domoticz - after a couple of hours trying various things, I'm at a loss how to achieve this. Perhaps I should consider giving up :-(

                        TheoLT Offline
                        TheoLT Offline
                        TheoL
                        Contest Winner
                        wrote on last edited by
                        #11

                        @Mark-Swift You can let that one node sleep. It will save power, thus energy an money. Since it would only be a sensor and not an actuator. Unless you want to node to do more than just rain and soil detection. If however you want to be able to add more intelligence, let's say the robot should not go out during night times - anti theft - you probably want that node to respond to message from your Home Automation system. As far as I've understood a node cannot be awoken, by a message received from the gateway.

                        But of course it all depends on the definition of real-time. If it's okay, that you'll only require a response time of half a minute or more, you could let the node query the gateway for new states. But that will complicate your implementation. Hence you see the problem? In cases like this, it's more important to design what you want rather than let the electronics dictate what you can do. That's at least my point of view. Because there are a lot of possibilities.

                        We can help you with that implementation. But my advice is, think what it is you want to achieve. Just grab a pencil and make a simple drawing. Visualizing problems often lead to to simple and pragmatic solutions.

                        A node can be awoken by either on an interrupt and/or a timer. Just have a look at the MySensor API description of gw.sleep

                        1 Reply Last reply
                        0
                        • Mark SwiftM Offline
                          Mark SwiftM Offline
                          Mark Swift
                          wrote on last edited by
                          #12

                          @TheoL I think I understand that, thanks... I think I'm clear on what I need to do, but the missing piece for me is how to have a node look up a value in Domoticz.

                          I think the logic is quite simple?

                          Mower node, wakes up every 30 minutes and checks the status of switches rain & soil moisture within Domoticz (sent by mower garage node). If either switch is 'on', activate relay (bridge rain sensor connections on mower).

                          TheoLT 1 Reply Last reply
                          0
                          • Mark SwiftM Mark Swift

                            @TheoL I think I understand that, thanks... I think I'm clear on what I need to do, but the missing piece for me is how to have a node look up a value in Domoticz.

                            I think the logic is quite simple?

                            Mower node, wakes up every 30 minutes and checks the status of switches rain & soil moisture within Domoticz (sent by mower garage node). If either switch is 'on', activate relay (bridge rain sensor connections on mower).

                            TheoLT Offline
                            TheoLT Offline
                            TheoL
                            Contest Winner
                            wrote on last edited by
                            #13

                            @Mark-Swift I think the way sending text messages, like sundberg has done, will do exactly what you need.

                            1. Let the node sleep
                            2. If it awakes it needs to query the gateway and domotics for a message
                            3. Handle the response
                            4. Notify the robot if needed.

                            I believe you need to do some things on the domoticz side. Haven't played with it yet. But @Awi and @sundberg84 have accomplished this already. They might be able to help you with that part as well.

                            1 Reply Last reply
                            0
                            • sundberg84S Offline
                              sundberg84S Offline
                              sundberg84
                              Hardware Contributor
                              wrote on last edited by
                              #14

                              This requiers dev branch !
                              You need to have the node create text sensor

                              MyMessage textMsg(messageCHILD, V_TEXT);      // message for Sending Text to Controller
                              

                              Then you use a script and update this in the controller with json for example.
                              See the examples.

                              Then you use request to fetch it:

                              request(messageCHILD, V_TEXT, 0);                    
                              

                              and recive to handle the incoming message.

                              void receive(const MyMessage &message) {
                                if (message.sensor == messageCHILD) {
                                  if (message.type == V_TEXT) {                   // Text content
                              }
                              }
                              

                              Controller: Proxmox VM - Home Assistant
                              MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
                              MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
                              RFLink GW - Arduino Mega + RFLink Shield, 433mhz

                              Mark SwiftM 1 Reply Last reply
                              0
                              • Mark SwiftM Offline
                                Mark SwiftM Offline
                                Mark Swift
                                wrote on last edited by
                                #15
                                This post is deleted!
                                1 Reply Last reply
                                0
                                • sundberg84S sundberg84

                                  This requiers dev branch !
                                  You need to have the node create text sensor

                                  MyMessage textMsg(messageCHILD, V_TEXT);      // message for Sending Text to Controller
                                  

                                  Then you use a script and update this in the controller with json for example.
                                  See the examples.

                                  Then you use request to fetch it:

                                  request(messageCHILD, V_TEXT, 0);                    
                                  

                                  and recive to handle the incoming message.

                                  void receive(const MyMessage &message) {
                                    if (message.sensor == messageCHILD) {
                                      if (message.type == V_TEXT) {                   // Text content
                                  }
                                  }
                                  
                                  Mark SwiftM Offline
                                  Mark SwiftM Offline
                                  Mark Swift
                                  wrote on last edited by Mark Swift
                                  #16

                                  @sundberg84 said:

                                  This requiers dev branch !
                                  You need to have the node create text sensor

                                  MyMessage textMsg(messageCHILD, V_TEXT);      // message for Sending Text to Controller
                                  

                                  Then you use a script and update this in the controller with json for example.
                                  See the examples.

                                  Then you use request to fetch it:

                                  request(messageCHILD, V_TEXT, 0);                    
                                  

                                  and recive to handle the incoming message.

                                  void receive(const MyMessage &message) {
                                    if (message.sensor == messageCHILD) {
                                      if (message.type == V_TEXT) {                   // Text content
                                  }
                                  }
                                  

                                  Hi @sundberg84,

                                  Thanks for taking time out to reply.

                                  I think I kind of understand, but I'm a new to Arduino's and hence can't quite apply it to my situation. Could you perhaps point me in the right direction with regards the problem I've presented? I know it's a big ask but would be greatly appreciated. This is the final piece of the puzzle I need to solve before deploying my new mower garage...

                                  As stated earlier, I have 2 sensors:

                                  Node 1: Reports Moisture / Rain to Domoticz
                                  Node 2: Relay (Closes contacts of mower rain pins)

                                  I need node 2 to wake every 30 minutes and check if node 1 has reported either moisture or rain (they are switches in Domoticz).

                                  TheoLT 1 Reply Last reply
                                  0
                                  • sundberg84S Offline
                                    sundberg84S Offline
                                    sundberg84
                                    Hardware Contributor
                                    wrote on last edited by sundberg84
                                    #17

                                    @Mark-Swift Sorry friend, I dont have time to code and test a sketch at the moment. Work, family and own projects.
                                    I suggest you take it step by step, look at http://www.mysensors.org/build/ and build yourself some temp nodes and learn as you go.
                                    Also look at the provided examples above - the logic is the same in them all... you will see.
                                    Copy paste code and try and see what happens... watch the serial output and you will learn.

                                    Controller: Proxmox VM - Home Assistant
                                    MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
                                    MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
                                    RFLink GW - Arduino Mega + RFLink Shield, 433mhz

                                    1 Reply Last reply
                                    1
                                    • Mark SwiftM Mark Swift

                                      @sundberg84 said:

                                      This requiers dev branch !
                                      You need to have the node create text sensor

                                      MyMessage textMsg(messageCHILD, V_TEXT);      // message for Sending Text to Controller
                                      

                                      Then you use a script and update this in the controller with json for example.
                                      See the examples.

                                      Then you use request to fetch it:

                                      request(messageCHILD, V_TEXT, 0);                    
                                      

                                      and recive to handle the incoming message.

                                      void receive(const MyMessage &message) {
                                        if (message.sensor == messageCHILD) {
                                          if (message.type == V_TEXT) {                   // Text content
                                      }
                                      }
                                      

                                      Hi @sundberg84,

                                      Thanks for taking time out to reply.

                                      I think I kind of understand, but I'm a new to Arduino's and hence can't quite apply it to my situation. Could you perhaps point me in the right direction with regards the problem I've presented? I know it's a big ask but would be greatly appreciated. This is the final piece of the puzzle I need to solve before deploying my new mower garage...

                                      As stated earlier, I have 2 sensors:

                                      Node 1: Reports Moisture / Rain to Domoticz
                                      Node 2: Relay (Closes contacts of mower rain pins)

                                      I need node 2 to wake every 30 minutes and check if node 1 has reported either moisture or rain (they are switches in Domoticz).

                                      TheoLT Offline
                                      TheoLT Offline
                                      TheoL
                                      Contest Winner
                                      wrote on last edited by TheoL
                                      #18

                                      @Mark-Swift I'm afraid I have the same problem as @sundberg84. I have too many things that need my attention at the moment. I'm developing an Arduino/MySensors course for beginners which was unforeseen - and consumes a lot of time - and I'm following a Big Data course at San Diego University. That with my family and some projects I'm working on is more than enough at the moment.

                                      I'm willing to help except for the part with the text message exchange between Domoticz. I feel bad about that, but it is what it is.

                                      Maybe we can start with a simpler sketch than the one you have in mind. It is the way I always developping things. Start simple and then add more complexity. Just give me a holla if you want me to help you with things.

                                      1 Reply Last reply
                                      0
                                      • Mark SwiftM Offline
                                        Mark SwiftM Offline
                                        Mark Swift
                                        wrote on last edited by Mark Swift
                                        #19

                                        @sundberg84 @TheoL I understand, no hard feelings, I'm also pretty busy (currently a week away from launching my startup) so I know how it feels :)

                                        The code for the mower node I've got so far is

                                        // Enable debug prints to serial monitor
                                        #define MY_DEBUG
                                        
                                        // Enable and select radio type attached
                                        #define MY_RADIO_NRF24
                                        // #define MY_RADIO_RFM69
                                        
                                        // Enable repeater functionality for this node
                                        // #define MY_REPEATER_FEATURE
                                        
                                        #include <SPI.h>
                                        #include <MySensor.h>
                                        
                                        #define CHILD_ID1 1
                                        #define CHILD_ID2 2
                                        #define RELAY_PIN 3
                                        #define RELAY_ON 1  // GPIO value to write to turn on attached relay
                                        #define RELAY_OFF 0 // GPIO value to write to turn off attached relay
                                        
                                        MyMessage MowerMsg(CHILD_ID2, V_TEXT);      // message for Sending Text to Controller
                                        
                                        void before() {
                                          // Then set relay pins in output mode
                                          pinMode(RELAY_PIN, OUTPUT);
                                          // Set relay to last known state (using eeprom storage)
                                          digitalWrite(RELAY_PIN, loadState(CHILD_ID1) ? RELAY_ON : RELAY_OFF);
                                          // Fetch mower run status
                                        }
                                        
                                        void setup() {
                                        }
                                        
                                        void presentation() {
                                          // Send the sketch version information to the gateway and Controller
                                          sendSketchInfo("Relay", "1.0");
                                        
                                          // Register all sensors to gw (they will be created as child devices)
                                          present(CHILD_ID1, S_LIGHT);
                                          present(CHILD_ID2, S_CUSTOM);
                                        }
                                        
                                        
                                        void loop() {
                                        }
                                        
                                        void receive(const MyMessage &message) {
                                          // We only expect one type of message from controller. But we better check anyway.
                                          if (message.type == V_LIGHT) {
                                            // Change relay state;
                                            digitalWrite(message.sensor, message.getBool() ? RELAY_ON : RELAY_OFF);
                                            // Store state in eeprom
                                            saveState(message.sensor, message.getBool());
                                            // Write some debug info
                                            Serial.print("Incoming change for sensor:");
                                            Serial.print(message.sensor);
                                            Serial.print(", New status: ");
                                            Serial.println(message.getBool());
                                          }
                                        }
                                        
                                        

                                        I've no idea if I'm on the right lines or not, I have however managed to get the V_TEXT to show in Domoticz and update it to '1', it's currently living under utility sensors?

                                        Now, if I can just figure out how to update the utility sensor based on my moisture / rain sensors and retrieve it, once that's done I'm sure I can add the logic for if V_TEXT = 1.

                                        1 Reply Last reply
                                        0
                                        • TheoLT Offline
                                          TheoLT Offline
                                          TheoL
                                          Contest Winner
                                          wrote on last edited by
                                          #20

                                          It's a bit too late over here, will look at it tomorrow. Your own startup cool!! What is your business?

                                          1 Reply Last reply
                                          1
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          17

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.1k

                                          Posts


                                          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular