Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. OpenHAB
  4. openhab send message to mysensors, serial, mysensorbinding

openhab send message to mysensors, serial, mysensorbinding

Scheduled Pinned Locked Moved OpenHAB
3 Posts 2 Posters 1.9k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    stoffej
    wrote on last edited by
    #1

    Hi
    I have a openhab instance running on a linux machine.
    That openhab is connected to mysensor via a serial gateway.

    I have managed to receive data via the serial gateway.
    I have two powermeter sensors which request value from openhab during startup.

    So it seems that it is possible to send message from openhab to mysensors.
    receiving is not a problem.

    But I would like to send the same value in a rule also. How do I do that?
    The rule ..

    // nollställer pulsecounter varje midnatt
    rule "Midnight"
    when
        Time cron  "0 59 23 * * ? "
    then
          var Number zero = 0
          postUpdate(my_nibe_pulsecount,zero)
          //sendCommand(Arduino, my_nibe_pulsecount) or something similar???
               
          logInfo("logg"," reset pulscounters")
    end
    

    This is the Item i want to send from openhab to mysensors.

    Number  my_pulsecount "V_VAR1 (pulse count) [%d]" {mysensors="10;1;V_VAR1"}
    
    1 Reply Last reply
    0
    • S Offline
      S Offline
      stoffej
      wrote on last edited by
      #2

      After some testing I reporduce the command that I want be able to send from the rule in openhab to mysensor.

      I_LOG_MESSAGE: send: 0-0-5-10 s=1,c=1,t=24,pt=0,l=8,sg=0,st=ok:13237476
      

      So with this code it works !!

      my_nibe_pulsecount.sendCommand(0)
      
      1 Reply Last reply
      0
      • NickBuilderN Offline
        NickBuilderN Offline
        NickBuilder
        wrote on last edited by NickBuilder
        #3

        This has been solved!

        Hi @stoffej!

        Can you please try to assist me on a very similar topic?

        I've built the EnergyMeterPulseSensor.ino pulse count sensor from the 2.0 library but I'm unable to initialize the items and I'm quite certain that this is why I'm not getting any values into Openhab. The Arduino is waiting for a request to be acknowledged which I guess is not happening.

        I have enabled persistence for the pulse counter items and I've also tried to initialize the items by manually sending a value through the openhab console (telnet localhost 5555). After updating the values manually I can see the new value in the sitemap-GUI but the actual counting does not start.

        After restarting Openhab the following is shown in the log:

        ... - New Item "myPCVar (Type=NumberItem, state=Uninitialized) based on configuration "50;1;V_VAR1"
        

        A funny thing is that I actually got it working while working on the pulse counter on an experimental setup without actually trying to initialize the items. I don't know what I did at that time or if it started working just by chance.

        Do you have any ideas of what steps to try? Thanks!

        Ah forget what I wrote. Its working now. I guess it was a poor radio module which seems to be the reason in a lot of cases.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        16

        Online

        11.7k

        Users

        11.2k

        Topics

        113.1k

        Posts


        Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • MySensors
        • OpenHardware.io
        • Categories
        • Recent
        • Tags
        • Popular