Hello!
I've downloaded the 1.4.1 version of the library and tested it via OpenHab.
I'm still not getting the sketch_name correctly via MQTT and Openhab. Is it still an open bug?
Thanks!
Simon
Hello!
I've downloaded the 1.4.1 version of the library and tested it via OpenHab.
I'm still not getting the sketch_name correctly via MQTT and Openhab. Is it still an open bug?
Thanks!
Simon
I was quite sure the gateway (MQTTClient) was updated with latest API library, but I was wrong. It was on 1.5 version. Updated to the latest, the problem was solved. Hope it helps!
Simon
Ok, thanks all. Maybe it's a flag I've set on HomeAssistant on some variables and to delete them, it's not sufficient, reading the doc, to restart the mosquitto service. I'll look how delete message AND retain flag.
Thanks all!
Simon
I've improoved the stability a lot with following modifications:
So, with those modifications I've seen big improovments.
I'll take a look in the next days (I'l start for holidays ) to check if it's stable as well.
BTW, I'm still confusing on how, when and why use these settings:
#define MY_RF24_PA_LEVEL RF24_PA_LOW
#define RF24_PA_LEVEL_GW RF24_PA_MAX
So, only to improove my knowledges
Thanks a lot!
Simon
@electrik said in Strange behavior on MQTT Gateway Reset:
@mfalkvidd said in Strange behavior on MQTT Gateway Reset:
MySensors does set the retain message on I_BATTERY_LEVEL messages (but no other messages)
If the define MY_MQTT_CLIENT_PUBLISH_RETAIN is used, all messages are retained. But that is not active by default, so probably not used in this case. Just to be complete
Thanks!
Well, I've succesfully deleted the retained messages via cli using mosquitto command:
mosquitto_pub -t <my_retained_topic> -r -n
Maybe it was set by the controller, then removed, but mqtt was retaining it.
Simon
Hello,
I've some problems updating from 2.0 to 2.1.
In my examples, I'm sending the node-id and the distance to my controller, to check which path is using my node.
Here the part of the code:
parentNode = _nc.parentNodeId;
distance = _nc.distance;
Serial.print(F("Node-id: "));
Serial.println(MY_NODE_ID);
Serial.print(F("Parent node id: "));
Serial.println(parentNode);
Serial.print(F("Distance Node00: "));
Serial.println(distance);
Now I'm getting this error:
error: '_nc' was not declared in this scope
How to get those values now?
Thanks
Simon
@mfalkvidd said in Best way to send nodeDistance and parentNode:
@xefil I've never seen anyone reuse a child ID, and I think it would confuse most controllers. Just look at the presentation call: first the sketch would present the child as type X, then the sketch would present the same child as type Y. Will the controller use the first, the second, both or none of the presentations?
But you may be right - maybe controllers can handle multiple data types per child id.
Well @mfalkvidd maybe it's me that I'm making confusion.
AFAYK, in case of HomeAssistant, it has an auto-discovery system which works, even if I don't like the naming convention it uses. BTW, using the above example, subscribing to MQTT server, I can get the values like follow:
api doc:
MY_MQTT_PUBLISH_TOPIC_PREFIX/FROM-NODE-ID/SENSOR-ID/CMD-TYPE/ACK-FLAG/SUB-TYPE
example message published on topic prefix mygateway1-out
from node 28
, on V_VAR1
, which has id 24
, becomes:
mygateway1-out/28/100/1/0/24
The same way, message published on topic prefix mygateway1-out
from node 28
, on V_VAR2
, which has id 25
, becomes:
mygateway1-out/28/100/1/0/25
This gives me the ability to subscribe on it and check for changes, like the logs shows me:
2018-12-31 08:37:09 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on mygateway1-out/28/100/1/0/24: b'0.0'
2018-12-31 08:51:09 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on mygateway1-out/28/100/1/0/25: b'1.0'
Looking deeper on what the controller recognize it during the presentation, using S_CUSTOM (id: 23) it's reassumed in this part of xml auto-generated:
"28": {
"protocol_version": "2.3.1",
"battery_level": 0,
"type": 18,
"children": {
<code_snipped>
"100": {
"description": "Internal variables",
"id": 100,
"values": {
"24": "0.0",
"25": "1.0"
},
"type": 23
}
},
"heartbeat": 0,
"sketch_name": "node28Studio",
"sketch_version": null,
"sensor_id": 28
},
So, actually the infos are correctly sent. It's more a matter if the usage of the IDs is correct to avoid further conflicts, if any.
That's the reason I'm asking
Thanks, Simon