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. My Project
  3. "interface" to my OPC-System

"interface" to my OPC-System

Scheduled Pinned Locked Moved My Project
1 Posts 1 Posters 766 Views 1 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.
  • jopebeJ Offline
    jopebeJ Offline
    jopebe
    wrote on last edited by mfalkvidd
    #1

    Hallo to all the specialists!
    I have a well running Moeller-Eaton Easy Relay home automation wit an OPC DA server.
    I also use IOBroker as a controler for all my MySensors-nodes.
    I looked for an software interface to connect both, but I didn't find one.
    Now I decided to connect them via an Arduino Mega as an ethernet-gateaway.
    So I need only a lot of outputs and inputs with two states.
    I found the example-sketch "Relais Actuator", which is very helpful for such a lot of identical outputs.
    But I found no way to add lines for the inputs as easy as the outputs.
    I added:

    #define BIN_1  31  // Arduino Digital I/O pin number for first switch (second on pin+1 etc)
    #define NUMBER_OF_BIN 28 // Total number of attached switches
    #define BIN_HIGH 1  // GPIO value to write to turn on attached switch
    #define BIN_LOW 0 // GPIO value to write to turn off attached switch
    

    In "void before" i added

    for (int sensor=16, pin=BIN_1; sensor<=NUMBER_OF_BIN; sensor++, pin++) {
            // Then set relay pins in output mode
            pinMode(pin, INPUT);
            digitalWrite(pin, HIGH);
            // Set switch to last known state (using eeprom storage)
            digitalWrite(pin, loadState(sensor)?1 :0);
            }
    

    in void presentation I addes

    for (int sensor=16, pin=BIN_1; sensor<=NUMBER_OF_BIN; sensor++, pin++) {
            // Register all sensors to gw (they will be created as child devices)
            present(sensor, S_DOOR);
        }
    

    The childs appear in "objects" without any state.
    I have no idea, how to send the states to the controler for further use in IOBroker.
    I don`t know how to create a message-container and send the states.
    If anybody could help me to finish my projekt, I were very happy!
    JOPBE

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


    28

    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