Homie MySensors bridge Controller. For use in OpenHab 3 (and others)



  • Hallo, so I came back to automation after a while away and set up MySensors again on MQTT and tried to pick a decent automation controller. I tried home assistant, but it kept corrupting itself, and then fired up openhab again, not realising that version 3 had just been released.

    That worked well with ZWave, till I tried attaching to MySensors and realised that the binding for openhab had all been deprecated and abandoned, which made me sad.

    I tried doing direct MQTT, which works, but is easy to forget and debugging numeric IDs each time I want to alter the system was becoming a chore.

    After seeing this issue - https://github.com/mysensors/MySensors/issues/1212 a thought came to me.

    Could the MySensors MQTT setup be bridged to the Homie conventional one? OpenHab already understands that well enough (they share a dev, so I believe), so that would be an easy integration.

    I spend the last few days researching and have built this in node/ typescript

    https://github.com/daviddawson/mysensors-homie-bridge

    It acts as a (very simplistic) MySensors controller on the MQTT gateway, giving out IDs and what not and provides bidirectional communication between MySensors MQTT and Homie MQTT. It advertises MySensors devices using Homie, and you can receive data and set values using the Homie protocol.

    Right now, I've only put support for S_BINARY, but its easy to add in the other types, just that my first use case is relay control.

    This lets me auto detect switches in OpenHab 3 and control them, I'll be adding in others soon, but if anyone likes the idea, adding support for the types is easy - https://github.com/daviddawson/mysensors-homie-bridge/blob/master/src/type-handler/s_binary.ts

    I'm not sure how complete the controller side of things needs to be, right now it only handles I_ID_REQUEST and I_ID_RESPONSE.



  • @David-Dawson
    Have you seen this topic? TimO has updated the binding to work with openhab 3. Works great for me. Hope it will work for you too!

    [https://forum.mysensors.org/topic/11482/oh3-mysensors-binding/30](link url)



  • @Klabbe Yes I have seen that 😄

    I'll probably give it a try, but I've quite enjoyed the dev in any case and it seems to be a potentially useful thing to have for cases other than OH3.



  • @David-Dawson
    great idea for that translation from homie to mysensors and back.

    but I think it would be a better approach, if mysensors would have the ability to "speak" homie-convention in MQTT optionally (e.g. #MY_GATEWAY_MQTT_HOMIE)
    that would eliminate the need of tweaking on an extra binding and let mysensors talk an IOT-standard


Log in to reply
 

Suggested Topics

  • 2
  • 6
  • 2
  • 75
  • 48
  • 5

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts