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
Boots33B

Boots33

@Boots33
Hero Member
About
Posts
435
Topics
13
Shares
0
Groups
1
Followers
4
Following
0

Posts

Recent Best Controversial

  • 12v Solar battery monitor
    Boots33B Boots33

    @nurul-amira Yes that should all work fine. That circuit has been running 24/7 for around 4 years now without any issues.

    My Project

  • How to properly handle variable requests
    Boots33B Boots33

    @tante-ju
    Sorry for the late reply, I have been away for a few days with work.

    While I am sure there will be more than one way to achieve your goal I have given a brief outline of the way i did it below.

    If all you want to do is request data from another node it should not need any more steps than @Sasquatch has listed above.
    Lets say we have node A with an id of 1
    we also have node B with an id of 2 and it has a binary sensor with a child id of 3

    Node A wants to know the the status of the binary sensor on node B
    So in your code on node A you will issue the request to query child id 3 on node 2

     request( 3, V_STATUS,  2);
    

    The gateway will rout this directly to node B where you will need to have code to deal with the request in the receive(); function. In it's simplest form you could have something like this below.

    void receive(const MyMessage &message) {
    
         if (message.type == V_STATUS) { 
           if (message.getCommand() == C_REQ){   // message is request
    
             // put code here to be executed when the message is from a request
             // most likely you will call a function that will get the requested 
             // data and return it to node A. If you are expecting requests for more than 1
             // sensor you can use  message.sensor to test which sensor the request is for 
           
    }
           else {                                                             // message is from gateway,process the message as per normal
               
                // put code here to be executed when the message is from gateway   
                }
         }
     }
    

    in the scenario above node B only expects requests from node A or commands from the gateway so it is easy to check what has arrived. If the message is a request we can execute code to get the required data and send it back. if it is a command (C_SET) from the gateway then it will fall through to the else part of the statement and be available as per normal.

    To send back the Data you will need to use a node to node message.
    this can be done on the fly, the format is shown below

     /*   Node to Node message format.                                                                                     *
              *                                                                                                            *
              *                                                                                                            *
              *            : Id of sending  : message  :   Destination     :     Destination      : Payload                *
              *            :    sensor      :  Type    :    sensor Id      :       Node Id        :                        */ 
             send(MyMessage(sendingSensorId, V_STATUS).setSensor(sensorId).setDestination(nodeId).set(true));  //send message to desitination node 
    

    So using our example you would have. (As we are not trying to actually switch any sensors on node A we can leave out the setSensor() part of the message)

    send(MyMessage(3, V_STATUS).setDestination(1).set(true));
    

    Being a binary sensor the payload would be set to either true or false.

    Now we have sent the data all that is left to do is catch it in the recieve part of node A. One way to do this is simply to test for where the message has come from, if it is from the gateway (node 0) or in our case node 2.

    void receive(const MyMessage &message) {
    
     if (message.type == V_STATUS) {
       if (message.sender == 0) {                                        // check if message is from gateway (node 0)
        
        // put code here for normal gateway messages
        
    }
      else {                                                           // message is not from gateway so check to see if it is from node B 
        
        if (message.sender == 2 ){
    
             Put code here to deal with returning request
        }
    
    } 
    }
    }
    
    Development

  • How to properly handle variable requests
    Boots33B Boots33

    sorry @tante-ju I am not quite getting what you are trying to achieve. Are you trying to request data directly from one node to the other of from a node to the controller.

    Development

  • How to properly handle variable requests
    Boots33B Boots33

    @tante-ju

    If you are making a request to the controller it will return the required data for you to use, you will then need to have code on the requesting node to handle this return.

    If you are making a node to node request you will need to manually handle both the incoming request on the target node and then use node to node communication to the return of the required data to the node that requested the data. Then on the node that sent the request you will need to have code to separate this return from normal controller commands.

    In MySensors you can use message.sender to determine where the message came from and message.getCommand to see if the message is a request or command etc.

    Have a look at these three posts to see what these look like in use and also how to format a node to node message.

    https://forum.mysensors.org/topic/6422/display-node-how-to-set-up/20

    https://forum.mysensors.org/topic/6948/synchronising-light-switch

    https://forum.mysensors.org/topic/6542/outdoors-touch-switch-light-controller?_=1596330659286

    Development

  • House renovation, how to a good electrical system oriented to MySensors?
    Boots33B Boots33

    @alowhum There will be a wealth of information out there on the net and probably also at your local library. look for resources about remote cabin power systems and also even the larger 5th wheeler type caravan systems will be helpful reading. You will also need to check your local building codes to see if there are any rules to be adhered to.

    When we built our house (about 15 years ago, long before i discovered MySensors :) we ran a low voltage backbone cable throughout the house. From this backbone we ran smaller cable drops to every room in the house. Many of these are still not in use but as others have said the cost of running wires is relatively cheap when you are building. Of course we still have mains power as well and use the low voltage system to compliment this.

    In those initial years the 12v system was used primarily for lighting systems such as night lights etc. As time progressed we installed 12v outlets in the bedrooms and these now are used to power bed/reading lamps. The small 12v downlights have also proved to be very easy to convert over as well. These were initially halogen bulbs but now there is a good range 12v LED replacements for just about any type of socket. Once I discovered MySensors and home automation then the 12v system became even more useful now powering several nodes and even the gateway.

    Right from the start we ran our system from a battery with solar charging and in 15 years it has never let us down. Voltage drop will always be a thing to watch, but with LED's low power draw and as you have surmised the ability of arduinos to run well below 12v it will usually be of little practical concern. Unless of course you are thinking of running more than lights and nodes.

    Hardware

  • Two MySensor gateways to the same Home Assistant
    Boots33B Boots33

    @jocke4u yes that is correct, both gateways will also need to be using different channels as well.

    Home Assistant

  • Ds18b20/ nodemcu fluctuations in temp
    Boots33B Boots33

    @mjdula
    The 85 reading is actually an error message used by the ds18b20 to indicate it has not had time to complete the processing of the reading. Most commonly this is only seen when the node first boots up and can be ignored or fixed by adding a small delay. You will find a lot of information on this if you do a google search. I have never experienced it myself but from other posts on the net it seems power supply problems and long cable runs to the sensor can also cause the error. Some have also had success by using a different resistor value. Note you only need one resistor fitted near your nodemcu not a resistor at each ds18b20.
    If the 85 reading is well outside your expected reading you could just filter out any readings over 84 as well.

    Hardware temperature node esp82 ds18b20

  • Newbie question about how the mysensors gateway connects to controller
    Boots33B Boots33

    yes you are correct, the serial gateway will connect to your controllers (Hassio) serial port and the Ethernet gateway will connect over your wired network connection. Both will work well, i guess the Ethernet approach gives you the flexibility of having the gateway away from the controller if needed.

    In my setup I have two gateways, both are built on NodeMCU boards and connect via wifi. they have proven very reliable as well.

    General Discussion gateway ethernet gateway serial gateway

  • (Solved) S_Multimeter in HomeAssistant
    Boots33B Boots33

    @Joost great news! always a good feeling when you find a solution to a pesky problem :)

    Home Assistant

  • getting data from sensor to sensor
    Boots33B Boots33

    @Robert-Król Yes that is certainly possible, Have a look at requesting data on the api page. You can request data from any node on your Mysensors network.

    Domoticz domoticz gettingdata

  • (Solved) S_Multimeter in HomeAssistant
    Boots33B Boots33

    @Joost do you have hassio set to use V2.3 of the mysensors protocol in the configuration.yaml ?

    Home Assistant

  • (Solved) S_Multimeter in HomeAssistant
    Boots33B Boots33

    @Joost

    Did you find a solution to your problem? I am using S_Multimeter in Hassio and measuring both voltage and current without problems so at least I can confirm that it should work.

    Perhaps you could try entering the child details into your mysensors.json file directly then reboot and see if that helps.

    should be something like this

    "120": {
            "sensor_id": 120,
            "children": {
                "0": {
                    "id": 0,
                    "type": 30,
                    "description": "Batterie",
                    "values": {
                        "38": "5.2"
                    }
                }
            },
            "type": 17,
            "sketch_name": "Voltmeter",
            "sketch_version": "1.0",
            "battery_level": 0,
            "protocol_version": "2.3.1",
            "heartbeat": 0
        }
    
    Home Assistant

  • Round water tank level sensor
    Boots33B Boots33

    @ritesh-t If you have not already found it you may also benefit from the thread by @zboblamont which can be found here. It addresses some issues of unstable readings that were occurring when the water in the tank was at a lower level.

    My Project

  • An ultrasonic measurement saga finally over...
    Boots33B Boots33

    @zboblamont I would be interested to see your final sketch if you don't mind posting it.

    My Project

  • An ultrasonic measurement saga finally over...
    Boots33B Boots33

    Well done @zboblamont great news to see you have had a win. :)

    My Project

  • i2c Lightning Sensor +
    Boots33B Boots33

    The Playing with fusion sketch uses the I2C library found here

    some more info on the library here

    My Project

  • 12v Solar battery monitor
    Boots33B Boots33

    @unfadingpyro Great to hear you got it all working. Always a good feeling when a project comes together :)

    My Project

  • relay statue doesn't change
    Boots33B Boots33

    1.5.4 is a few versions back now so it will help if you post the code you are using, even if it is the standard version. That will give us a starting point to work from.
    Also what controller are you using.

    Troubleshooting

  • 12v Solar battery monitor
    Boots33B Boots33

    Yes i can see your wiring now and no you are not likely to get any sort of reading with that circuit. You have the 712 wired in parallel with the charge wire, it needs to be in series instead. The load needs to be connected to the same side that the charge wire is on. So a quick re-draw of your circuit would look like this.

    0_1524101289797_panel wire.jpg

    Don't forget to add a fuse at the battery positive.

    The original drawing from earlier in this thread would also be ok

    alt text

    My Project

  • relay statue doesn't change
    Boots33B Boots33

    Your only getting 0 sent for the relay so it certainly won't be changing status. Perhaps post the code you are using .

    Troubleshooting
  • Login

  • Don't have an account? Register

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