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
A

almj

@almj
About
Posts
5
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • openHAB binding
    A almj

    @bkl Awesome! Thank you for this binding. Helps to minimise rules in OH.

    OpenHAB

  • [Tutorial] openHAB with serial gateway
    A almj

    Thanks for help ;)
    Figured out it by myself

    OpenHAB

  • $8 Lamp (Outlet) "Smart Plug" Module
    A almj

    Thank you very much for detailed description!
    But I cannot understand how to send commands from OpenHab to turn relay on and off. Please direct me.
    After a long time I can finally get the messages from sensors via serial connection, but not the other way.
    Cheers!

    My Project

  • [Tutorial] openHAB with serial gateway
    A almj

    Dear all,

    I've stuck. Please help me to understand.
    Currently I have a serial gateway and openHAB 1.7. I've managed to get controller working and send commands to openhab installed on Windows.

    Now I need to understand how to convert commands from the gateway.

    I have a rule

    rule "Arduino sends to Openhab"
        when
            Item Arduino received update
        then
            var String lineBuffer =  Arduino.state.toString.split("\n")
            for (String line : lineBuffer) {
                var String[] message = line.split(";")
                var Integer nodeId = new Integer(message.get(0))
                var Integer childId = new Integer(message.get(1))
                var Integer msgType = new Integer(message.get(2))
                var Integer ack = new Integer(message.get(3))
                var Integer subType = new Integer(message.get(4))
                var String msg = message.get(5)
    			
                if(msgType == 3 ){
                    if (subType == 9){
    					sendCommand(Arduino_Motion1, ON)
    					pushover("Motion Detected", -1)
    		} } }			
    end
    

    items:

    String Arduino "Serial" {serial="COM4@115200"}
    Switch Arduino_Motion1 	"Motion" <siren>
    

    and a sitemap

    sitemap home label="Home"
    {
    
    Frame label="Serial" {
    Switch item=Arduino_Motion1 label="Motion Sensor"
    } } 
    

    So in debug I have following:

    2015-06-01 12:51:29.154 [INFO ] [runtime.busevents             ] - Arduino state updated to 0;0;3;0;9;read: 1-1-0 s=1,c=1,t=16,pt=0,l=1:1
    1;1;1;0;16;1
    
    2015-06-01 12:51:29.156 [INFO ] [runtime.busevents             ] - Arduino_Motion1 received command ON
    

    So I've found an example of temp sensor but not the motion...
    Pushover sends me notifications when motion sensor send 0 to the gateway every minute or so. (0;0;3;0;9;read: 1-1-0 s=1,c=1,t=16,pt=0,l=1:0). I don't understand how can I separate last 0 from 1.
    I know I'm on a last step, please help :)

    Thank you!

    OpenHAB
  • Login

  • Don't have an account? Register

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