devices not in devices list



  • I created a node with 2 Temp sensors and one light level LDR. the script works fine on my serial monitor but in Domotcz I see the children not in the device list. opening in Hardware the setup of the GW and I see the node with the children type s_light_level, s_hump and s_temp. they are not in the device list. What am i doing wrong.


  • Hardware Contributor

    @Dick - Domoticz create devices when first value is sent. You find them in setup > devices.
    Only switches is created during the presentation.



  • the messurement are started every minute. restating the node I get an entry in the log looking like this

    2016-06-27 20:00:56.564 MySensors: Node: 6, Sketch Name: combi Light and temp Sens

    2016-06-27 20:00:56.574 MySensors: Node: 6, Sketch Version: 1.0

    So it is visible in the log but not in the devices list.


  • Hardware Contributor

    @Dick said:

    2016-06-27 20:00:56.564 MySensors: Node: 6, Sketch Name: combi Light and temp Sens
    2016-06-27 20:00:56.574 MySensors: Node: 6, Sketch Version: 1.0

    This is presentation - its not enough to create a device in domoticz. You need the value!



  • value? as I look in my Arduino ide log I see this

    send: 6-6-0-0 s=255,c=3,t=15,pt=2,l=2,sg=0,st=ok:0
    send: 6-6-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,st=ok:1.5.4
    send: 6-6-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0
    read: 0-0-6 s=255,c=3,t=6,pt=0,l=1,sg=0:M
    sensor started, id=6, parent=0, distance=1
    send: 6-6-0-0 s=255,c=3,t=11,pt=0,l=25,sg=0,st=ok:combi Light and temp Sens
    send: 6-6-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:1.0
    send: 6-6-0-0 s=0,c=0,t=7,pt=0,l=0,sg=0,st=ok:
    send: 6-6-0-0 s=1,c=0,t=7,pt=0,l=0,sg=0,st=ok:
    send: 6-6-0-0 s=3,c=0,t=6,pt=0,l=0,sg=0,st=ok:
    send: 6-6-0-0 s=3,c=0,t=6,pt=0,l=0,sg=0,st=ok:
    send: 6-6-0-0 s=0,c=0,t=16,pt=0,l=0,sg=0,st=ok:
    Temp 0= 21.50
    Luchtvocht 0= 60.90
    Licht=84

    Do I miss some script in my schetch?

     #include <SPI.h>
    #include <MySensor.h>
    #include <DHT.h>
    
    #define CHILD_ID_HUM1 0
    #define CHILD_ID_HUM2 1
    #define CHILD_ID_TEMP1 3
    #define CHILD_ID_TEMP2 4
    
    #define CHILD_ID_LIGHT 0
    #define LIGHT_SENSOR_ANALOG_PIN A0
    
    
    unsigned long SLEEP_TIME = 60000; // Sleep time between reads (in milliseconds)
    
    MySensor gw;
    DHT*  dht[2];
    byte sensorPin[2] = {3, 4};
    float lastTemp[2] = {0.0, 0.0};
    float lastHum[2] = {0.0, 0.0};
    
    boolean metric = true;
    //MyMessage msgHum(CHILD_ID_HUM1, V_HUM);
    //MyMessage msgTemp(CHILD_ID_TEMP1, V_TEMP);
    
    MyMessage msg(CHILD_ID_LIGHT, V_LIGHT_LEVEL);
    int lastLightLevel;
    
    
    void setup()
    {
      gw.begin();
      
      // Send the sketch version information to the gateway and Controller
      gw.sendSketchInfo("combi Light and temp Sensor", "1.0");
    
     
      
    
    
      for (int i = 0; i < 2; i++)
      {
        dht[i] = new DHT;
        dht[i]->setup(sensorPin[i]);
      }
    
      //gw.sendSketchInfo("Humidity", "1.0");
    
      gw.present(CHILD_ID_HUM1, S_HUM);
      gw.present(CHILD_ID_HUM2, S_HUM);
      gw.present(CHILD_ID_TEMP1, S_TEMP);
      gw.present(CHILD_ID_TEMP1, S_TEMP);
      gw.present(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
    
      metric = gw.getConfig().isMetric;
    }
    
    void loop()
    {
      for (int i = 0; i < 2; i++)
      {
        delay(dht[i]->getMinimumSamplingPeriod());
        float temperature = dht[i]->getTemperature();
        if (isnan(temperature))
        {
          Serial.print(F("Failed reading temperature from DHT"));
          Serial.println(i);
        }
        else if (temperature != lastTemp[i])
        {
          lastTemp[i] = temperature;
          if (!metric)
          {
            temperature = dht[i]->toFahrenheit(temperature);
          }
          //gw.send(msgTemp.set(temperature, i));
          Serial.print(F("Temp "));
          Serial.print(i);
          Serial.print(F("= "));
          Serial.println(temperature);
        }
        float humidity = dht[i]->getHumidity();
        if (isnan(humidity)) 
        {
          Serial.print("Failed reading humidity from DHT");
          Serial.println(i);
        } 
        else if (humidity != lastHum[i]) 
        {
          lastHum[i] = humidity;
          //gw.send(msgHum.set(humidity, 1));
          Serial.print(F("Luchtvocht "));
          Serial.print(i);
          Serial.print(F("= "));
          Serial.println(humidity);
        }
        
      int lightLevel = (1023-analogRead(LIGHT_SENSOR_ANALOG_PIN))/10.23; 
      //Serial.println(lightLevel);
      if (lightLevel != lastLightLevel) {
           //gw.send(msg.set(lightLevel));
    
          //lastLightLevel = lightLevel;
          Serial.print("Licht=");
          
          Serial.println(lightLevel);
    
          
      }
    
      }
        
      
      gw.sleep(SLEEP_TIME); //sleep a bit
    }
    
    
    

  • Mod

    you have commented out gw.send in two three places. That means no values will be sent.

    You will also need to uncomment the declaration of msgHum And msgTemp.



  • Don't mean to hijack this thread, but I am thinking that my problem is similar which is why I am posting here as opposed to a new topic.

    So I have my new garage door sensor device and I was able to control it through the serial monitor. My problem now is with Domoticz. If I go to setup > hardware, I see my gateway.
    alt text

    If I then click the blue [Setup] button I see this:
    alt text

    From there if I click on the garage door node, it shows me the children of that node
    alt text

    But when I go to setup > Devices, the only thing that I see is the gateway.
    alt text

    I do not see the S_LIGHT/S_BINARY garage door device, nor the S_ARDUINO_NODE device. As you can see, the garage door device has been seen by Domoticz, but still nothing.

    Is there something I am missing?


  • Hero Member

    @dbemowsk I don't see any issues. The "S_ARDUINO_NODE" entry will not show as a device. The device you see is your switch (S_LIGHT) as presented.



  • The problem is that when I go to my devices, I can click on the arrow icon on the right for my gateway which adds the device under the Switches tab giving me control of the device.
    alt text

    I have no way of adding the child node of the garage door to allow me to toggle it open and closed. Isn't the S_LIGHT/S_BINARY child of the garage door supposed to show up under devices?


  • Hero Member

    @dbemowsk I was expecting the device you show "MySensors Gateway" is the garagedoor. Or do you have other S_LIGHT/S_BINARY devices in your system?



  • After the tip 👍 mfalkvidd""gave in this post about the GW msg, I checked my code and that solved the problem. I pt my working code in this post so you can compare the 2 versions and the changes. perhaps this could be solution for your proble.

    #include <SPI.h>
    #include <MySensor.h>
    #include <DHT.h>
    
    #define CHILD_ID_HUM1 0
    #define CHILD_ID_HUM2 1
    #define CHILD_ID_TEMP1 3
    #define CHILD_ID_TEMP2 4
    
    #define CHILD_ID_LIGHT 0
    #define LIGHT_SENSOR_ANALOG_PIN A0
    
    
    unsigned long SLEEP_TIME = 3000; // Sleep time between reads (in milliseconds)
    
    MySensor gw;
    DHT*  dht[2];
    byte sensorPin[2] = {3, 4};
    float lastTemp[2] = {0.0, 0.0};
    float lastHum[2] = {0.0, 0.0};
    
    boolean metric = true;
    MyMessage msgHum(CHILD_ID_HUM1, V_HUM);
    MyMessage msgTemp(CHILD_ID_TEMP1, V_TEMP);
    
    MyMessage msgHum1(CHILD_ID_HUM2, V_HUM);
    MyMessage msgTemp1(CHILD_ID_TEMP2, V_TEMP);
    
    MyMessage msg(CHILD_ID_LIGHT, V_LIGHT_LEVEL);
    int lastLightLevel;
    
    
    void setup()
    {
      gw.begin();
      
      // Send the sketch version information to the gateway and Controller
      gw.sendSketchInfo("Light Sensor", "1.0");
    
     
      
    
    
      for (int i = 0; i < 2; i++)
      {
        dht[i] = new DHT;
        dht[i]->setup(sensorPin[i]);
      }
    
      gw.sendSketchInfo("Humidity", "1.0");
    
      gw.present(CHILD_ID_HUM1, S_HUM);
      gw.present(CHILD_ID_HUM2, S_HUM);
      gw.present(CHILD_ID_TEMP1, S_TEMP);
      gw.present(CHILD_ID_TEMP1, S_TEMP);
      gw.present(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
    
      metric = gw.getConfig().isMetric;
    }
    
    void loop()
    {
      for (int i = 0; i < 2; i++)
      {
        delay(dht[i]->getMinimumSamplingPeriod());
        float temperature = dht[i]->getTemperature();
        if (isnan(temperature))
        {
          Serial.print(F("Failed reading temperature from DHT"));
          Serial.println(i);
        }
        else if (temperature != lastTemp[i])
        {
          lastTemp[i] = temperature;
          if (!metric)
          {
            temperature = dht[i]->toFahrenheit(temperature);
          }
          gw.send(msgTemp.set(temperature, i));
          Serial.print(F("T"));
          Serial.print(i);
          Serial.print(F("= "));
          Serial.println(temperature);
        }
        float humidity = dht[i]->getHumidity();
        if (isnan(humidity)) 
        {
          Serial.print("Failed reading humidity from DHT");
          Serial.println(i);
        } 
        else if (humidity != lastHum[i]) 
        {
          lastHum[i] = humidity;
          gw.send(msgHum.set(humidity, 1));
          Serial.print(F("H"));
          Serial.print(i);
          Serial.print(F("= "));
          Serial.println(humidity);
        }
        
      int lightLevel = (1023-analogRead(LIGHT_SENSOR_ANALOG_PIN))/10.23; 
      Serial.println(lightLevel);
      if (lightLevel != lastLightLevel) {
           gw.send(msg.set(lightLevel));
    
          lastLightLevel = lightLevel;
          Serial.print("L=");
          
          Serial.println(lightLevel);
    
          
      }
    
      }
        
      
      gw.sleep(SLEEP_TIME); //sleep a bit
    }
    
    
    


  • @awi the gateway device is my serial gateway. If you look at the screenshots I posted, there is a device called My garage Door which is an S_LIGHT/S_BINARY device. That is the one that is not showing up.



  • @dbemowsk

    Can you post your sketch please?


  • Hero Member

    @dbemowsk Maybe I am mistaken but your gateway should have node id "0" assigned. The node which shows up in the devices list is "1". I assume you have no S_Light devices attached to your gateway (hard to do in v1. 5) so this one has to be the garage door switch with the wrong name. (or at least confusing). You can easily give it another name.

    I would suggest you just try it and watch the serial monitor of the node...



  • @drock1985 if you look under the hardware forum, I have a post there for my garage door that has the current sketch I am using posted there.



  • @AWI said:

    Maybe I am mistaken but your gateway should have node id "0" assigned. The node which shows up in the devices list is "1".

    If you look closer, the serial gateway is not node 1. If you look at this screenshot, it doesn't say that it is node ID 1, it shows idx or index 1 which is probably an ID for the database. I don't know what the unit number is, but that could be the node ID which is 0.
    alt text

    The reason I say that the idx or index number is not the node ID is for two reasons. First, if you look at the first image below, this screenshot shows it as idx 3, and second, if you look at the next screenshot, which is the device list, it shows the list of nodes and children, the MyGarageDoor node, which I named "Garage door" for Domoticz is actually listed as NodeID 1.
    alt text

    alt text

    @AWI said:

    I assume you have no S_Light devices attached to your gateway (hard to do in v1. 5) so this one has to be the garage door switch with the wrong name. (or at least confusing).

    The "Garage door" node shows 2 children. The first child of the "Garage door" node is of type S_LIGHT/S_BINARY. I have the sketch name as MyGarageDoor, but I was not sure how to name the child device. When I saw the Name field under children in Domoticz, I thought that was somehting that I would do in Dompticz, but I guess not. Do I do that somewhere in my sketch for the garage door?


  • Hero Member

    @dbemowsk I can understand your confusion...
    The idx value in the hardware listing is the hardware idx. The 000001 value in the Devices listing is the node index and therefore not your gateway... The Unit is the sensor number in your node (i.e. the S_LIGHT sensor == 0)
    Don't ask me to explain all the obscurities of domoticz......but just try (=experiment) to use the "MySensors Gateway" as the switch for the garage door....



  • @Dick said:

    gw.present(CHILD_ID_TEMP1, S_TEMP);
    gw.present(CHILD_ID_TEMP1, S_TEMP);

    Try changing the second ID to CHILD_ID_TEMP2 (note the "2") and see if that works better.


 

425
Online

7.9k
Users

8.8k
Topics

93.8k
Posts