Hi folks,
in order to create some user specific sensors control, I tried to use the V_TEXT sensor, but even with the Notify example sketch in https://www.home-assistant.io/integrations/mysensors/ I get the following errors in HA:
Invalid <Message data="3;1;0;0;36;TextSensor1">: Not valid message sub-type: 36 for object value @ data['sub_type']. Got 36 not a valid value for object value @ data['payload']. Got 'TextSensor1'
Invalid <Message data="3;1;1;0;47;-">: Not valid message sub-type: 47 for object value @ data['sub_type']. Got 47 not a valid value for object value @ data['payload']. Got '-'
Invalid <Message data="3;1;2;0;47;">: Not valid message sub-type: 47 for object value @ data['sub_type']. Got 47
In all post I found, this is usually a version problem.
The used mysensors version is 2.3.2 according to the serial monitor of the node.
The mysensors integration in HA should be 2.3, but I don’t know how to check this, since the integration had been added via Settings / Devices & Services / Integration: “+ Add Intgeration” and I found no way to ask the integration about its version.
I would like to avoid a reinstallation of the mysensors integration, since I use a big amount of sensors already.
The log-information concerning this node (3) is as follows:
2023-03-27 17:40:12.504 DEBUG (MainThread) [mysensors.transport] Receiving 3;255;0;0;17;2.3.2
2023-03-27 17:40:12.523 DEBUG (MainThread) [homeassistant.components.mysensors.gateway] Node update: node 3 child 255
2023-03-27 17:40:12.538 DEBUG (MainThread) [mysensors.transport] Receiving 3;255;3;0;6;0
2023-03-27 17:40:12.553 DEBUG (MainThread) [mysensors.transport] Sending 3;255;3;0;6;M
2023-03-27 17:40:12.608 DEBUG (MainThread) [mysensors.transport] Receiving 3;255;3;0;11;TextSensor
2023-03-27 17:40:12.627 DEBUG (MainThread) [homeassistant.components.mysensors.gateway] Node update: node 3 child 255
2023-03-27 17:40:12.641 DEBUG (MainThread) [mysensors.transport] Receiving 3;255;3;0;12;1.0
2023-03-27 17:40:12.654 DEBUG (MainThread) [homeassistant.components.mysensors.gateway] Node update: node 3 child 255
2023-03-27 17:40:12.670 DEBUG (MainThread) [mysensors.transport] Receiving 3;1;0;0;36;TextSensor1
2023-03-27 17:40:12.684 WARNING (MainThread) [mysensors] Invalid <Message data="3;1;0;0;36;TextSensor1">: Not valid message sub-type: 36 for object value @ data['sub_type']. Got 36
not a valid value for object value @ data['payload']. Got 'TextSensor1'
2023-03-27 17:40:12.732 DEBUG (MainThread) [mysensors.transport] Receiving 3;1;1;0;47;-
2023-03-27 17:40:12.746 WARNING (MainThread) [mysensors] Invalid <Message data="3;1;1;0;47;-">: Not valid message sub-type: 47 for object value @ data['sub_type']. Got 47
not a valid value for object value @ data['payload']. Got '-'
2023-03-27 17:40:12.770 DEBUG (MainThread) [mysensors.transport] Receiving 3;1;2;0;47;
2023-03-27 17:40:12.783 WARNING (MainThread) [mysensors] Invalid <Message data="3;1;2;0;47;">: Not valid message sub-type: 47 for object value @ data['sub_type']. Got 47
2023-03-27 17:40:14.668 DEBUG (MainThread) [mysensors.transport] Receiving 3;1;1;0;47;-
2023-03-27 17:40:14.686 WARNING (MainThread) [mysensors] Invalid <Message data="3;1;1;0;47;-">: Not valid message sub-type: 47 for object value @ data['sub_type']. Got 47
not a valid value for object value @ data['payload']. Got '-'
The used code from the Notify example sketch is:
/*
* Documentation: https://www.mysensors.org
* Support Forum: https://forum.mysensors.org
*/
// Enable debug prints to serial monitor
#define MY_DEBUG
#define MY_RADIO_NRF24
#include <MySensors.h>
#include <SPI.h>
#define SN "TextSensor"
#define SV "1.0"
#define CHILD_ID 1
MyMessage textMsg(CHILD_ID, V_TEXT);
bool initialValueSent = false;
void setup(void) {
}
void presentation() {
sendSketchInfo(SN, SV);
present(CHILD_ID, S_INFO, "TextSensor1");
}
void loop() {
if (!initialValueSent) {
Serial.println("Sending initial value");
// Send initial values.
send(textMsg.set("-"));
Serial.println("Requesting initial value from controller");
request(CHILD_ID, V_TEXT);
wait(2000, C_SET, 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("Message: ");
Serial.print(message.sensor);
Serial.print(", Message: ");
Serial.println(message.getString());
// Send message to controller
send(textMsg.set(message.getString()));
}
}
The HA version is:
Home Assistant 2023.3.6
Supervisor 2023.03.2
Operating System 9.5
Frontend 20230309.1 - latest
Any suggestions are highly welcome!