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
gusG

gus

@gus
About
Posts
12
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Slow Power Meter Update speed
    gusG gus

    I don't know how, but now it seems to work. Restarted Domoticz, thats all.
    Now the value on the dashboard updates direct when a new data comes.
    Thanks for your inputs!

    Domoticz

  • Slow Power Meter Update speed
    gusG gus

    @gohan said in Slow Power Meter Update speed:

    It is showing temperatures changes very quickly as it is showing switches changing status (1 or 2 seconds delay, but it is still quick enough). I have both pulse meter and a sonoff pow that are sending data (sonoff is using mqtt so data is sent quickly), but the domoticz dashboard isn't updating even if you actually see the timestamp being updated.

    Hi!
    Did you manages to solve this?
    Using version: 4.9700 and have the same slow updates...

    Domoticz

  • [security] Introducing signing support to MySensors
    gusG gus

    @Anticimex Ahh, now I get it!! Thanks for helping me out here!

    Cheers

    Development security

  • [security] Introducing signing support to MySensors
    gusG gus

    @Anticimex Ok, just thought when signing failed, the node was halted :confused:
    So that control mechanism need to be implemented in my sketch then?
    Great, I will use the log parser!

    Development security

  • [security] Introducing signing support to MySensors
    gusG gus

    Hi!
    Starting to learn signing. I use a parallell system (with another channel) where I could test signing before I went on my live system. For now I just use soft signing, it works perfect!

    Now, I just want to test a node (motionsensor) that include:

    #define MY_SIGNING_REQUEST_SIGNATURES
    

    The gateway has no signing feature (it has not gone thru personalition process) In my head, the node shall reject to connect to this gateway, but after the signing fails, it start to send data to the gateway. Did I miss something here?

    Debug text on node:

    0 MCO:BGN:INIT NODE,CP=RNNNAS--,VER=2.2.0-beta
    49 SGN:PER:OK
    83 SGN:INI:BND OK
    83 TSM:INIT
    86 TSF:WUR:MS=0
    94 TSM:INIT:TSP OK
    96 TSM:INIT:STATID=101
    98 TSF:SID:OK,ID=101
    100 TSM:FPAR
    102 SGN:SGN:NREQ=255
    139 TSF:MSG:SEND,101-101-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    684 TSF:MSG:READ,0-0-101,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    690 SGN:SKP:MSG CMD=3,TYPE=8
    692 TSF:MSG:FPAR OK,ID=0,D=1
    2148 TSM:FPAR:OK
    2148 TSM:ID
    2150 TSM:ID:OK
    2152 TSM:UPL
    2154 SGN:SGN:NREQ=0
    2158 TSF:MSG:SEND,101-101-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    2168 TSF:MSG:READ,0-0-101,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    2174 SGN:SKP:MSG CMD=3,TYPE=25
    2177 TSF:MSG:PONG RECV,HP=1
    2181 TSM:UPL:OK
    2183 TSM:READY:ID=101,PAR=0,DIS=1
    2187 SGN:PRE:SGN REQ
    2189 SGN:PRE:WHI NREQ
    2191 SGN:SGN:NREQ=0
    2195 TSF:MSG:SEND,101-101-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0101
    2203 SGN:PRE:XMT,TO=0
    2205 SGN:PRE:WAIT GW
    2207 TSF:MSG:READ,0-0-101,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    2213 SGN:SKP:MSG CMD=3,TYPE=15
    2217 SGN:SGN:NREQ=0
    2222 TSF:MSG:SEND,101-101-0-0,s=255,c=0,t=17,pt=0,l=10,sg=0,ft=0,st=OK:2.2.0-beta
    2232 SGN:SGN:NREQ=0
    2234 TSF:MSG:SEND,101-101-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    2248 TSF:MSG:READ,0-0-101,s=255,c=3,t=6,pt=0,l=1,sg=0:M
    2254 !SGN:VER:NSG
    2256 !TSF:MSG:SIGN VERIFY FAIL
    2258 SGN:SGN:NREQ=0
    2263 TSF:MSG:SEND,101-101-0-0,s=255,c=3,t=11,pt=0,l=13,sg=0,ft=0,st=OK:Motion Sensor
    2273 SGN:SGN:NREQ=0
    2277 TSF:MSG:SEND,101-101-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
    2285 SGN:SGN:NREQ=0
    2289 TSF:MSG:SEND,101-101-0-0,s=1,c=0,t=1,pt=0,l=0,sg=0,ft=0,st=OK:
    2295 MCO:REG:REQ
    2297 SGN:SGN:NREQ=0
    2301 TSF:MSG:SEND,101-101-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    2310 TSF:MSG:READ,0-0-101,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    2316 !SGN:VER:NSG
    2318 !TSF:MSG:SIGN VERIFY FAIL
    2322 MCO:BGN:STP
    2324 MCO:BGN:INIT OK,TSP=1
    1
    2326 SGN:SGN:NREQ=0
    2330 TSF:MSG:SEND,101-101-0-0,s=1,c=1,t=16,pt=0,l=1,sg=0,ft=0,st=OK:1
    2338 MCO:SLP:MS=120000,SMS=0,I1=1,M1=1,I2=255,M2=255
    2344 TSF:TDI:TSL
    2347 MCO:SLP:WUP=1
    2349 TSF:TRI:TSB
    0
    2351 SGN:SGN:NREQ=0
    2355 TSF:MSG:SEND,101-101-0-0,s=1,c=1,t=16,pt=0,l=1,sg=0,ft=0,st=OK:0
    2363 MCO:SLP:MS=120000,SMS=0,I1=1,M1=1,I2=255,M2=255
    2367 TSF:TDI:TSL
    
    
    Development security

  • Another simple (No SMT) relay actuator
    gusG gus

    @dpressle said in Another simple (No SMT) relay actuator:

    @gus Dirtypcbs

    Thanks!

    My Project

  • Another simple (No SMT) relay actuator
    gusG gus

    @dpressle said in Another simple (No SMT) relay actuator:

    @breimann Thanks, does any one want link to dirtypcbs?

    Hi!

    Yes, please send links, really good design!

    Regards Rickard

    My Project

  • Send notification/email x-times
    gusG gus

    I use Dzvents for Lua programming in Domoticz, there is some good examples that you mayby can use.

    Dzvents

    Domoticz

  • Scrolling Text sensor node with new V_TEXT
    gusG gus

    Hi,

    I'm using this fantastic code as well. This is working on 2.0

    Next step for me would be to be able to create an array with more messages, so that the display could cycle thru them.

    /*
     PROJECT: MySensors / Scrolling Text display
     PROGRAMMER: AWI
     DATE: september 12, 2015/ last update: september 12, 2015
     FILE: AWI_scroll_MAX.ino
     LICENSE: Public domain
    
     Hardware: tbd ..Ceech - ATmega328p board w/ NRF24l01
        and MySensors 1.5 ()
            
    Special:
        Need to use MySensors development edition 
        
    SUMMARY:
        3 S_xx devices for scrolling text
        - Displays a scrolling text from a "V_TEXT" variable
        - additional dimmer sensor for controlling display brightness
        - 'Alarm' switch. If "On", overrides the text display to display ALARM message
        - You can also input messages from the Serial monitor (testing)
        Uses excellent MD_MAX72XX library 
     Remarks:
        Fixed node-id
    */
    
    
    #include <MD_Parola.h>
    #define MY_RADIO_NRF24
    
    // Enable repeater functionality for this node
    #define MY_REPEATER_FEATURE
    
    
    
    // Use the MD_MAX72XX library to scroll text on the display with the use of the callback function 
    // to control what is scrolled on the display text.
    // You need to set the used display in the library MD_MAX72XX.h
    // User can enter text on the serial monitor and this will display as a
    // Speed for the display is controlled by a pot on SPEED_IN analog in.
    #include <MD_MAX72xx.h>                     // multipurpose library for MAX72xx diaplay driver  https://parola.codeplex.com/
    #include <MySensors.h>                       // Mysensor network
    #include <SPI.h>
    #include <Time.h>                           //http://playground.arduino.cc/Code/Time
    #include <TimeLib.h>
    #define USE_POT_CONTROL 0                   // enable Scroll speed  potentiometer
    #define PRINT_CALLBACK  1
    
    // Macro to simplify serial print
    #define PRINT(s, v) { Serial.print(F(s)); Serial.print(v); }
    
    // Define the number of devices we have in the chain and the hardware interface
    // need to be adapted to your setup
    const int MAX_DEVICES = 2 ;                 // number of 8x8 displays
    const int CLK_PIN = 7 ;                     // SPI like clock
    const int DATA_PIN = 8 ;                    // SPI like data
    const int CS_PIN = 6 ;                      // SPI like select
    
    // Parola is able to use SPI hardware interface, not testted in combination with MySensors
    // MD_MAX72XX mx = MD_MAX72XX(CS_PIN, MAX_DEVICES);
    // now use Arbitrary pins
    MD_MAX72XX mx = MD_MAX72XX(DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES); // instantiate one display chain
    
    // Scrolling parameters, you can attach normal potentiometer to A5, Vcc, Gnd
    #if USE_POT_CONTROL
    const int SPEED_IN = A5 ;
    #else
    const int SCROLL_DELAY = 20 ;               // in milliseconds
    #endif // USE_POT_CONTROL
    
    const int CHAR_SPACING = 1 ;                // pixels between characters
    
    // MySensors constants & variables
    //const byte nodeId = 51 ;                    // MySensors fixed node id
    const byte messageCHILD = 8 ;               // Text from ControllerLCD
    const byte brightnessChild = 9 ;            // Brightness of display
    const byte alarmChild = 10 ;                // Display Alarm text (overrides normal text)
    boolean timeReceived = false ;              // Flag to indicate time received
    // Display constants & variables
    byte textBrightness = 1 ;                   // brightness of display (between 0 - MAX_INTENSITY (0xF)
    byte textOnOff = false ;                     // textOnOff = ! shutdown
    boolean textAlarm = false ;                 // Alarm (switch S_BINARY)
    // Global message buffers shared by MySensors and Scrolling functions
    const int BUF_SIZE = 25 ;                   // max payload for MySensors(NRF24l01)
    char curMessage[BUF_SIZE];                  // current displayed message
    char newMessage[BUF_SIZE];                  // next message to be displayed if available
    bool newMessageAvailable = false ;          // new message available flag
    uint16_t    scrollDelay;                    // in milliseconds
    
    // *** Definition and initialisation
    // define the MySensor network (1.5)
    // Initialize messages for sensor network
    
    MyMessage textMsg(messageCHILD, V_TEXT);    // message for Sending Text to Controller
    
    
    /* MD_MAX72XX functions: can be found in the documentation for the library,
     * no need to customtize callback & scroll routines (unless you want to...)
    */
    uint8_t scrollDataSource(uint8_t dev, MD_MAX72XX::transformType_t t)
    // Callback function for data that is required for scrolling into the display
    {
      static char       *p = curMessage;
      static uint8_t    state = 0;
      static uint8_t    curLen, showLen;
      static uint8_t    cBuf[8];
      uint8_t colData;
    
      // finite state machine to control what we do on the callback
      switch(state)
      {
        case 0: // Load the next character from the font table
          showLen = mx.getChar(*p++, sizeof(cBuf)/sizeof(cBuf[0]), cBuf);
          curLen = 0;
          state++;
    
          // if we reached end of message, reset the message pointer
          if (*p == '\0')
          {
            p = curMessage;         // reset the pointer to start of message
            if (newMessageAvailable)    // there is a new message waiting
            {
              strcpy(curMessage, newMessage);   // copy it in
              newMessageAvailable = false;
            }
          }
          // !! deliberately fall through to next state to start displaying
    
        case 1: // display the next part of the character
          colData = cBuf[curLen++];
          if (curLen == showLen)                // end of character insert interchar space
          {
            showLen = CHAR_SPACING;
            curLen = 0;
            state = 2;
          }
          break;
    
        case 2: // display inter-character spacing (blank column)
          colData = 0;
          curLen++;
          if (curLen == showLen)
            state = 0;
          break;
    
        default:
          state = 0;
      }
    
      return(colData);
    }
    
    // Callback (not used here)
    void scrollDataSink(uint8_t dev, MD_MAX72XX::transformType_t t, uint8_t col){
    // Callback function for data that is being scrolled off the display
    #if PRINT_CALLBACK
        Serial.print("\n cb ");
        Serial.print(dev);
        Serial.print(' ');
        Serial.print(t);
        Serial.print(' ');
        Serial.println(col);
    #endif
    }
    
    // non-blocking text display to be used in loop (call frequently)
    void scrollText(void){
        static uint32_t prevTime = 0;
        if (millis()-prevTime >= scrollDelay){                  // Is it time to scroll the text?
            mx.transform(MD_MAX72XX::TSL);                      // scroll along - the callback will load all the data
            prevTime = millis();                                // starting point for next time
            }
        }
    
    // sets the scroll delay (read from potentiometer if enabled)
    uint16_t getScrollDelay(void){
    #if USE_POT_CONTROL
        uint16_t t = analogRead(SPEED_IN);
        t = map(t, 0, 1023, 25, 250);
        return(t);
    #else
        return(SCROLL_DELAY);
    #endif
        }
    
    void setup(){
        // set up the display first
        mx.begin();                                             // initialize display chain                 
        mx.setShiftDataInCallback(scrollDataSource);            // define function to get the scrolldata (returned as int8)
        //mx.setShiftDataOutCallback(scrollDataSink);           // not used
        mx.control(MD_MAX72XX::INTENSITY, 0x01);
    #if USE_POT_CONTROL                                         // initialize speed potentiometer if enabled
        pinMode(SPEED_IN, INPUT);
    #else
        scrollDelay = SCROLL_DELAY;
    #endif
    
        strcpy(curMessage, "I \x03 MySensors ");                // first message on display
        //newMessage[0] = '\0';                                   // new message initialized to empty RE This is not working....
        // Setup MySensors 
       //Serial in Sensor network = 115200
        //Send the sensor node sketch version information to the gateway
    
    } 
    
    void presentation() {
    
        sendSketchInfo("Scrollo small 52", "1.0");
        present(messageCHILD, S_INFO, "Text line Scroll");   // new S_type 20150905 (not know by domoticz)
        present(alarmChild, S_BINARY, "Alarm display");      // to display alarm text
        present(brightnessChild, S_DIMMER, "Text brightness"); // new S_type 20150905 (not know by domoticz)
        //send(textMsg.set("-"));                            // initialize the V_TEXT at controller for sensor to none (trick for Domoticz)
        request(messageCHILD, V_TEXT, 0);                    // request value from controller
        // Initializations
        requestTime();                            // get the time from controller (handled by receiveTime)
        }
    
    // loop only uses non-blocking functions
    void loop() {
        static unsigned long lastUpdate ;                       // Static hold the last update time
        unsigned long now = millis();
        scrollDelay = getScrollDelay();                         // update scroll delay from potentiometer
        //readSerial();
        // Check for new conditions & ask for new information from controller every 10 seconds
        if (now-lastUpdate > 10000){
            if (textAlarm){                                     // if alarmstatus: override all text and set max intensity
                strcpy(curMessage, "   ALARM   ");
                mx.control(MD_MAX72XX::INTENSITY, MAX_INTENSITY);   // set current brightness
                mx.control(MD_MAX72XX::SHUTDOWN, false) ;
            } else {                                            // standard (non Alarm actions)
                mx.control(MD_MAX72XX::INTENSITY, textBrightness);  // set current brightness
                mx.control(MD_MAX72XX::SHUTDOWN, textOnOff) ;
                request(messageCHILD, V_TEXT, 0);                // request new value from controller
            }
            lastUpdate = now;
        }
        scrollText();
    }
     
    // This is called when a new time value was received
    void receiveTime(unsigned long controllerTime) {
        Serial.print("Time value received: ");
        Serial.println(controllerTime);
        setTime(controllerTime);                                // time from controller
        timeReceived = true;
        } 
    
    // This is called when a message is received 
    void receive(const MyMessage &message) {
        Serial.print("Message: "); Serial.print(message.sensor); Serial.print(", Message: "); Serial.println(message.getString());
        if (message.sensor == messageCHILD){
            if (message.type==V_TEXT) {                     // Text content
            strcpy(newMessage, message.getString());        // copy it in
                newMessageAvailable = true ;
            }
        } else if (message.sensor == alarmChild) {
            if (message.type==V_STATUS) {                   // True/ false content
                textAlarm = message.getBool()?true:false ;  // set alarmflag
                Serial.print("TextAlarm: ");
                Serial.println(textAlarm);
            }
        } else if (message.sensor == brightnessChild){
            if (message.type==V_PERCENTAGE) {               // Level 0..100  content
                textBrightness = map(message.getInt(),0, 100, 0, MAX_INTENSITY ) ;  // map to brightnesslevel 
                Serial.print("TextBrightness: ");
                Serial.println(textBrightness);
            } else if (message.type==V_STATUS) {            // Display on/off
                textOnOff = message.getBool()?false:true ;      // set shutdown/ !on/off
                Serial.print("Text on/off: ");
                Serial.println(textOnOff);
            }
        }
    }
    
        
    // Testing purposes: input routine character buffer. Reads serial characters in buffer newMessage.
    // sets flag newMessageAvailable to true if completed
    void readSerial(void)
    {
      static uint8_t    putIndex = 0;
    
      while (Serial.available())
      {
        newMessage[putIndex] = (char)Serial.read();
        if ((newMessage[putIndex] == '\n') || (putIndex >= BUF_SIZE-3)) // end of message character or full buffer
        {
          // put in a message separator and end the string
          newMessage[putIndex++] = ' ';
          newMessage[putIndex] = '\0';
          // restart the index for next filling spree and flag we have a message waiting
          putIndex = 0;
          newMessageAvailable = true;
        }
        else
          // Just save the next char in next location
          newMessage[putIndex++];
      }
    }
    
    My Project

  • 💬 In Wall AC/DC Pcb (with Relay) for MySensors (SMD)
    gusG gus

    @sundberg84 yes, irl can be tough 😊
    I'll be watching your project, keep up!

    OpenHardware.io switch in-wall relay acdc hlk-pm01

  • 💬 In Wall AC/DC Pcb (with Relay) for MySensors (SMD)
    gusG gus

    Looks really promising!!
    This is exactly what I lookin for.
    The safety concerns in this project is right on target!

    OpenHardware.io switch in-wall relay acdc hlk-pm01

  • Controlling Servo
    gusG gus

    Hi Guys!

    I´ve been reading this forum for a long time and now started to build up some hardware, cool!
    Do you know the best way to control a servo from Domoticz? I will use jSON API in Domoticz to receive servo commands from other systems, but S_DIMMER.s resolution is only 16 steps. The ideal would be to use percents input, but I can't get that to work.

    Any thoughts??

    Regards Gus

    Domoticz
  • Login

  • Don't have an account? Register

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