Help with Thing/sketch syntax for transmitted variables



  • My mysensors OH2/ethernet gateway is all set up and operational using the predefined paperui things (DHT11 sensors for the moment). All works great so far.

    My next step (and what I'm a bit unclear about) is to manually set up my own things using the various mysensors presentation types/variables. Would appreciate it if someone could point me to some examples to help me work this out. For example if I simply wanted to report the battery level of a node what do I send as the payload from the sensor and how do I define the corresponding thing?


  • Mod

    For battery there is a specific function to call, for other things it depends and you may look around in examples and forum posts to get an idea of what you could use.



  • Thanks - I've been searching but still unclear. I've got battery status for the humidity sensor working as part of the humidity "thing" using the "sendBatteryLevel" function but if I wanted to simply define a custom thing for just battery level alone how do I define the variable in the thing?


  • Hero Member

    Battery status is a special case in MySensors and in OpenHAB. You may define any thing type and only enable the battery channel. Every thing supports the battery channel. But you can't present a battery thing. Use another temp / humidity thing instead for example.



  • Ah I see. Will search some more then! Thanks.


  • Mod

    If you want to test different sensors, you can use the mock mysensors sketch in the examples



  • Thanks for that - will play with the different sensor types - I've got humidity/temp/battery worked out from the github wiki.

    However I have a different question now (background - I installed the binding via the eclipse marketplace although I assume that has no bearing on the issue). The humidity/temperature sensors (which are what I've built so far) are discovered automatically in paperui (which is good) and I have them populating paperui control (using simple mode). I've noticed that the thing channel names in paperui control don't survive a reboot of my raspberry pi. While the sensor values eventually reappear, I need to unlink and relink the channels for each thing for the names to reappear. Is this normal? (as mentioned I'm running the mysensors ethernet gateway and openhab2 on the same pi)


  • Mod

    Personally I have no idea, maybe it is more an openhab forum question. Did you try over there?



  • I'll do that - it doesn't happen with other bindings though. So maybe one for Timo?


  • Hero Member

    @gadgetman With the binding I'm only able to handle the things and the channels. The representation via items is not part of the bindings. After your description my first guess is, that this is a problem of OpenHAB itself, but I have no idea why it only happens with things using the MySensors binding. Is there something helpful in the logs?



  • Happy to look at them - could you tell me where they're located?


 

424
Online

7.9k
Users

8.8k
Topics

93.8k
Posts