Dallas OneWire questions



  • So I built the DallasTemperatureSensor example to use with an existing OneWire network that I have set up from my previous HA setup. I have 7 sensors in various places in my house with one of them being outside. I was actually thinking ahead when I designed each of the nodes and set them up so I could run them on either 5 Volts or in parasite mode by changing a jumper. This is the schematic of my nodes:
    alt text
    And here is a picture of one of them:

    alt text

    So I wired up the MySensor node and hooked it into my network. I see the node in Domoticz identifying as "Temperature Sensor", but I do not see any temp sensors. My current OneWire network is all configured for parasite power at the moment. It is all wired with Cat5 cable I am thinking that in some spots where I chained the sensors together, I may not have passed on the 5 volts. My main question is, can the MySensors node handle the temp sensors in parasite mode? If so, any ideas why it may not be working? It worked fine when I had my Pi set up to run things using a OneWire USB dongle. If I have to run each sensor on 5 volts, I will check each node and wire the 5 volts in the chain for each. This is the wiring scheme I tried to follow:
    alt text

    My next question is, does the length of wire between nodes make a big difference? And my last question is, once I get this figured out, how do the sensors show in Domoticz?

    Thanks to everyone.



  • I am not sure, never tested myself with parasite mode.

    But I think it shall work, read below post

    https://forum.mysensors.org/topic/938/multisensor-multiactuator-sketch-testboard-tested-with-fhem-controller/5



  • So here is an update on my situation with this. The way my old OneWire sensor setup was set up was that I basically had 3 legs (cat5 wires) to the system. 2 of the 3 legs have 3 sensors each along the path and one has 1 at the end. All 3 of the cat5 wires come to a central point where I merge them into one connection. If I connect the legs individually, I can see the sensors on 2 of the 3 legs. I can see the one leg that has a single sensor, and one of the two that has 3 sensors.

    My question is, I have my circuit wired up as in the temperature sensor project in the build section. That circuit uses line D3 as the input for the sensors. Would it be possible to add 2 more data lines so that I have my 3 legs of sensors each read on their own data line? So basically I would have D3, D4 and D5 for sensors. I would imagine I would have to have 3 sections in the main loop like this:

      // Read temperatures and send them to controller 
      for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {
     
        // Fetch and round temperature to one decimal
        float temperature = static_cast<float>(static_cast<int>((gw.getConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.;
     
        // Only send data if temperature has changed and no error
        #if COMPARE_TEMP == 1
        if (lastTemperature[i] != temperature && temperature != -127.00 && temperature != 85.00) {
        #else
        if (temperature != -127.00 && temperature != 85.00) {
        #endif
     
          // Send in the new temperature
          gw.send(msg.setSensor(i).set(temperature,1));
          // Save new temperatures for next compare
          lastTemperature[i]=temperature;
        }
      }
    

    one for each of the 3 data lines.

    I guess I am just wondering if this would be a possible solution to my sensor problem.

    My last question in this has to do with how the sensors show up in Domoticz. I am wondering how I am supposed to identify them since they don't show up in Domoticz by their sensor address.


  • Mod

    You should be able to use multiple OneWire buses by adding more of these:

    #define ONE_WIRE_BUS_2 4 // Pin where second set of sensors are connected 
    OneWire oneWire2(ONE_WIRE_BUS_2);
    DallasTemperature sensors2(&oneWire2);
    

    and then add the new sensors to the presentation and send parts. If you're comfortable with arrays you could create an array of OneWire and DallasTempterature objects to make the code nice and clean.

    Multiple sensors on the same node is a bit troublesome. The only way I can think of is to generate a V_TEXT child with mappings for child id to address.


  • Plugin Developer

    Maybe you can use V_ID to send the onewire sensor address and identify the sensors? I guess you still have to map the ids with the temp values on the controller, somehow, if Domoticz hasn't thought of this already.



  • This is how I solved it with identification(DeviceAddress)

    https://forum.mysensors.org/topic/4143/about-ds18b20-onewire


Log in to reply
 

Suggested Topics

  • 87
  • 6
  • 2
  • 7
  • 5
  • 8

1
Online

11.4k
Users

11.1k
Topics

112.7k
Posts