Issue with mysensors notification v_text

Hello all, this is my first post on the Community so please forgive me in case of any mistakes (and feel free to tell me if any).
Here’s my issue:
I created a test mysensors node following the instructions from components->mysensors notification with an addition of temp dummy sensor for testing. The issue is that I receive cut message on serial debug print. It looks non-deterministic, or I cannot find on what basis the message is cut.

Here the automations.yaml script:

  trigger:
    platform: time_pattern
    minutes: '/1'
  action:
    service: notify.mysensors
    data:
      message: "abcdefghijklmnopqrstuvxyz"
      target: "Salon_Display 11 1"

as a result I am getting on serial console:
Received: abcdefghijklmnopqrstuvxyz
which is fine and expected. However, when I change message to:
message: "out:;55.9;55.9;2019-02-05 21:34"
I’m getting only:
Received: 21:34
and when change the message to:
message: "a1b2c3d4e5f6g7h8i9j0klmnopqrstuvxyz"
I am getting:

Received: a1b2c3d4e5f6g7h8i9j0klmno
Received: pqrstuvxyz

Adding some extra whitespaces:
message: "a1b2c3d 4e5f6g7h 8i9j0klmnopqrst uvxyz"
and the result:
Received: nopqrst uvxyz

Here’s the arduino code:

#define CHILD_ID_DISP 1
#define CHILD_ID_TEMP 2

MyMessage textMsg(CHILD_ID_DISP, V_TEXT);
MyMessage tempMsg(CHILD_ID_TEMP, V_TEMP);

float temperature = 21.2; //for test

bool initialValueSent = false;
unsigned long currentTime = 0;
unsigned long savedTime2 = 0;

void setup() {
}

void presentation() {
  // Send the sketch version information to the gateway and Controller
  sendSketchInfo("Salon_Display", "1.0");
  present(CHILD_ID_DISP, S_INFO);
  present(CHILD_ID_TEMP, S_TEMP);
}


void loop() {

currentTime = millis();

  if (currentTime - savedTime2 >= 10000UL) {
savedTime2 = currentTime;
Serial.println(temperature);
send(tempMsg.set(temperature, 1));
if (!initialValueSent) {
  Serial.println("Sending initial value");
  // Send initial values.
  send(textMsg.set("-"));
  Serial.println("Requesting initial value from controller");
  request(CHILD_ID_DISP, V_TEXT);
}
  }
}

void receive(const MyMessage &message) {
   if (message.type == V_TEXT) {
 if (!initialValueSent) {
   Serial.println("Receiving initial value from controller");
   initialValueSent = true;
 }
 // Dummy print
 Serial.print("Received: ");
 Serial.println(message.getString());
 // Send message to controller
 send(textMsg.set(message.getString()));
   }
 }

Could you please help me to figure out what is going on? My purpose is to send quite long preformatted text and some control instructions to parse on the graphical LCD node to display the room name, temperature, humidity and last sensor update time of several rooms. I got it working, the last thing is the communication between home assistant and the node and as you can see it is working not as I expected.

EDIT:
All mysteries solved. First thing is that a semicolon breaks something and I found no escape character to avoid this. Changing a semicolon to slash solved partially the issue. The remain thing, the max length of string, came from MySensors API docs:

The maximum payload size is 25 bytes! The NRF24L01+ has a maximum of 32 bytes. The MySensors library (version 2.0) uses 7 bytes for the message header.

So that would be all. Maybe someone find it helpful.

1 Like