General questions on first GW and sensor setup



  • This is my first post so hello to everyone, I have been a lurker for some time and have just setup my first ethernet GW with a DHT11 sensor on a node. Both running on Arduino uno clones. I have an existing Openhab setup thats been running for a couple of years now but decided there were a lot of Mysensor projects that I wanted to try!
    Although I have the GW setup with the Node and they are talking to each other, and Openhab discovered both the temp and humidity sensor, I can not get the data to display on my sitemap. So I have a few questions-:

    1. Do I need to have a manual things file as below?
      0_1556524548278_8d76bafc-46a9-406f-9f73-d75855abeb46-image.png

    2. Do I need to specify in the Arduino sketch a Node ID as below or does openhab assign them?
      0_1556524643150_1d05664f-3117-4a6b-8f15-7d41dd2acc8f-image.png

    Below are my .items , sitemap and openhab thing screenshot. Has anyone done a recent Openhab 2.4 install with an ethernet gateway that can see any mistakes?

    0_1556524864396_c8b4814a-9707-49cf-91e8-9778cfd24d4c-image.png
    0_1556524985929_0f33e341-d27c-4861-ba73-6d4fcbf003f0-image.png
    0_1556525021811_ca8cf9ed-b0d2-449c-abef-7ba220b9f1a1-image.png

    Hope someone can help, I am so close but not quite there.... I am no programmer so go easy on me!


  • Hero Member

    @crumpy10

    1. There is no need to. You may configure your devices in PaperUi or in the files (or use both types)

    2. No. The ID is assigned automatically by the binding. But you are free to define one in the sketch.

    The screenshot from PaperUi with the things looks good. What is the problem? Are there any updates in the control view from Openhab? What does the log say?



  • @TimO ,
    Thanks for the reply.

    OK So if I can use a mixture of either self discovery and files thats fine BUT as soon as I un-comment the sensors in mysensors.items the thing sensors double up in Openhab? See below?
    0_1556605808643_73ce56b6-6749-4d1b-b234-301b9f1bbd71-image.png

    Openhab discovered the highlighted sensors (only after I reset the sensor node!) and then when I ticked the discovered sensors it added the extra two sensors not highlighted?!? Weird as I have only one DHT11 sensor... Any ideas whats going on?

    I started out this evening by deleting the sensors and the gateway in openhab, restarted openhab. I then added the gateway, reset the node which added the 4 things.
    Now I am getting data on the sitemap for the first time! Eh.....
    Should I have each sensor doubled up then? and I didnt link any channels either....

    Now I am confused...
    🤔


  • Hero Member

    @crumpy10 Well, that may seem confusing, but this is how the binding does work.
    You may create as much things as you like and it doesn't matter if you create those things via PaperUi or the text files. If node id and child Id do match on an incoming messages the thing gets updated.
    Discovery by Openhab is only possible if and when the node presents itself. In most MySensors sketches this is done on initialization of the code. This is why a reboot of the node is needed for discovery. There is no list of known nodes (in the gateway) that the binding may read out.
    There is some code in the binding that should prevent the discovery (inbox) of already known things but that doesn't work in some cases. I've the same problem with my sonos things which get discovered all the time although I've already configured them via text files.
    The discovered things in inbox will disappear after a timeout.



  • Hi. I know this is an old post and you are probably ok now however one thing I have found from experience is that mysensors data doesn't always appear in sitemaps unless the data is formatted correctly. However you should still be seeing the channel being updated in the openhab log. These are examples of formatting that have worked for me:

     Frame label="Sensor 1"
        {
        Text item=MySensorsDevice10_Humidity label="Hum [%.1f %%]"
        Text item=MySensorsDevice10_LastUpdate label="Last seen [%1$tA, %1$td/%1$tm/%1$tY %1$tH:%1$tM]" icon="network"
        Text item=MySensorsDevice11_Temperature label="Temp [%.2f °C]"
        Text item=MySensorsDevice10_BatteryLevel label="Batt [%.1f %%]"
        }
    

Log in to reply
 

Suggested Topics

  • 22
  • 10
  • 132
  • 7
  • 3
  • 5

14
Online

11.4k
Users

11.1k
Topics

112.7k
Posts