Control IPX800-v5 in Gladys

Hello @pierre-gilles,

Is it not possible to directly control a device (command and status feedback) in Gladys? For example, I have an IPX800v5 to control my home automation. It is possible to control it from Node-RED on Home Assistant, but I can’t do it on Gladys? In the IPX, there is a push object that sends the status of relay 1 and a subscribe that allows controlling relay 1 (details Mini-Tuto Liaison MQTT IPX800-V5 Node-red (sur Home-Assistant) - Cartes Ethernet IPX800 - GCE Electronics). But I would like to control everything from Gladys, how can I do that?

Hello @cce66!

I don’t know the IPX800-v5, is it a relay that works with MQTT?

If I understand correctly, you want to publish to a specific MQTT topic to control this relay?

In Gladys 4, there is an MQTT API:

Example: MQTT | Gladys Assistant
Documentation: MQTT API | Gladys Assistant

After that, this API is fixed by Gladys, and I don’t know if your relay doesn’t specifically expect a specific MQTT topic and a specific message format, which we don’t handle in Gladys currently.

It’s a bit of home automation to NFC15100 standards, it goes into the electrical panels, it’s like having all the equipment like dio sockets, dio switches in a module on a DIN rail


Actually, all commands go through the existing wires (VR, Lamps) and all the sockets can also be controlled from this central point, it’s widely used in home automation (also industrial) there are 8 relays, 8 digital inputs and 4 analog ones

And I would like to be able to control it from Gladys and (I wanted to do it by voice command but not yet on v4 :cry:) there is a RESTful API but in MQTT it’s more responsive!!!

Go through the REST API in the meantime :slight_smile:

Otherwise, you can use Gladys + Node-RED

The ideal in Gladys would be to have more flexible MQTT configuration like in the IPX, here the broker part, so we put the MQTT broker address on the network as a parameter

Then we have « publish » and « subscribe » objects

image

Here a subscribe linked to the command of relay 1

Configured as follows

And in Node-RED I have

At the MQTT configuration level

In Gladys, this seems much more complex to me (but maybe I haven’t yet understood the way it works!). I understood that Gladys offers the possibility to deploy a mosquito container, mine runs in a container under openmediavault for the moment, so I go through the mosquito broker hosted on home-assistant, so in Gladys I would like to have in the MQTT devices a relay type (it is missing in the devices) with boolean values and a configuration type like in the IPX, for the relay I link it to an MQTT publish to change the state in the IPX and a subscribe to know its state, that’s all. And there, in Gladys, I’m stuck unless I develop a module like the one for Tasmota (I think), but I looked at your tutorial on this and it’s not easy :cry: For RESTful APIs, it’s not as reactive as MQTT… On the IPX forum, many people would like to couple their IPX with a home automation solution and are mainly faced with the problem of external connection (which Gladys now has, unlike Home Assistant, Domoticz, or Jeedom). Control modules have been developed on Jeedom and HA, but the interaction with Jeedom and HA is poor… I’ll try to dig into the matter…

There is « outlet » → « switch » which is made for that :slight_smile:

Bonjour @pierre-gilles,
J’ai réussi à piloter un des relais de l’ipx800 via node-red, par contre je n’arrives pas à avoir depuis l’ipx800 le retour d’état de l’interrupteur dans gladys

image
j’ai pourtant un debug qui me sembles correct
22/01/2022, 00:32:11node: f14f85a92afafbeb

IPX800_V5-1 : msg.payload : string[25]

“{”[IPX]Relay cmd 1":true}"

22/01/2022, 00:32:13node: f14f85a92afafbebIPX800_V5-1 : msg.payload : string[28]

“{”[IPX]Relay state 1":false}"

22/01/2022, 00:32:13node: cf703754e8389474msg.payload : string[3]

“off”

22/01/2022, 00:32:13node: 89b610539bda7d0dmsg.payload : string[3]

“off”

22/01/2022, 00:32:13node: e4dc354cc2860d26msg.payload : number

0

22/01/2022, 00:32:13node: 8f8275c29bb036c5gladys/device/mqtt:lampe/feature/mqtt:lampe/state : msg.payload : string[1]

“0”

22/01/2022, 00:32:13node: 4678ca9e7131d24cgladys/device/mqtt:lampe/feature/mqtt:lampe/state : msg.payload : string[1]

“0”

22/01/2022, 00:32:13node: 471e3ac46dc6fb17gladys/device/mqtt:lampe/feature/mqtt:lampe/state : msg.payload : string[26]

“{”[IPX]Relay cmd 1":false}"

22/01/2022, 00:32:13node: f14f85a92afafbebIPX800_V5-1 : msg.payload : string[26]

“{”[IPX]Relay cmd 1":false}"

22/01/2022, 00:34:58node: 8f8275c29bb036c5gladys/device/mqtt:lampe/feature/mqtt:lampe/state : msg.payload : string[1]

“0”

22/01/2022, 00:34:58node: 4678ca9e7131d24cgladys/device/mqtt:lampe/feature/mqtt:lampe/state : msg.payload : string[1]

“0”

22/01/2022, 00:34:59node: f14f85a92afafbebIPX800_V5-1 : msg.payload : string[26]

“{”[IPX]Relay cmd 1":false}"

22/01/2022, 00:34:59node: 471e3ac46dc6fb17gladys/device/mqtt:lampe/feature/mqtt:lampe/state : msg.payload : string[26]

“{”[IPX]Relay cmd 1":false}"

22/01/2022, 00:34:59node: f14f85a92afafbebIPX800_V5-1 : msg.payload : string[26]

“{”[IPX]Relay cmd 1":false}"

le flow graphique

et le flow json à importer :

[
{
“id”: “bd5facfbf1ab26d3”,
“type”: “tab”,
“label”: “Flow 1”,
“disabled”: false,
“info”: “”,
“env”: []
},
{
“id”: “305ea00bbfebcf19”,
“type”: “mqtt in”,
“z”: “bd5facfbf1ab26d3”,
“name”: “”,
“topic”: “gladys/device/mqtt:lampe/feature/mqtt:lampe/state”,
“qos”: “1”,
“datatype”: “auto”,
“broker”: “291914c5c9c68f02”,
“nl”: false,
“rap”: true,
“rh”: 0,
“inputs”: 0,
“x”: 250,
“y”: 160,
“wires”: [
[
“8f8275c29bb036c5”,
“813b7bb0cb97117d”
]
]
},
{
“id”: “8f8275c29bb036c5”,
“type”: “debug”,
“z”: “bd5facfbf1ab26d3”,
“name”: “”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “false”,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 530,
“y”: 220,
“wires”: []
},
{
“id”: “813b7bb0cb97117d”,
“type”: “switch”,
“z”: “bd5facfbf1ab26d3”,
“name”: “”,
“property”: “payload”,
“propertyType”: “msg”,
“rules”: [
{
“t”: “eq”,
“v”: “0”,
“vt”: “str”
},
{
“t”: “eq”,
“v”: “1”,
“vt”: “str”
}
],
“checkall”: “true”,
“repair”: false,
“outputs”: 2,
“x”: 570,
“y”: 160,
“wires”: [
[
“4678ca9e7131d24c”,
“ab804a690e9c0df6”
],
[
“6b92e7dfca6a6f56”,
“196ae944ec3423d2”
]
]
},
{
“id”: “8f7e7262bc6bf978”,
“type”: “mqtt out”,
“z”: “bd5facfbf1ab26d3”,
“name”: “IPX800_V5-1”,
“topic”: “IPX800_V5-1”,
“qos”: “1”,
“retain”: “true”,
“respTopic”: “”,
“contentType”: “”,
“userProps”: “”,
“correl”: “”,
“expiry”: “”,
“broker”: “291914c5c9c68f02”,
“x”: 1270,
“y”: 160,
“wires”: []
},
{
“id”: “4678ca9e7131d24c”,
“type”: “debug”,
“z”: “bd5facfbf1ab26d3”,
“name”: “”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “false”,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 750,
“y”: 100,
“wires”: []
},
{
“id”: “6b92e7dfca6a6f56”,
“type”: “debug”,
“z”: “bd5facfbf1ab26d3”,
“name”: “”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “false”,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 750,
“y”: 220,
“wires”: []
},
{
“id”: “ab804a690e9c0df6”,
“type”: “change”,
“z”: “bd5facfbf1ab26d3”,
“name”: “”,
“rules”: [
{
“t”: “change”,
“p”: “payload”,
“pt”: “msg”,
“from”: “0”,
“fromt”: “str”,
“to”: “{”[IPX]Relay cmd 1":false}",
“tot”: “str”
}
],
“action”: “”,
“property”: “”,
“from”: “”,
“to”: “”,
“reg”: false,
“x”: 780,
“y”: 140,
“wires”: [
[
“8f7e7262bc6bf978”,
“471e3ac46dc6fb17”
]
]
},
{
“id”: “196ae944ec3423d2”,
“type”: “change”,
“z”: “bd5facfbf1ab26d3”,
“name”: “”,
“rules”: [
{
“t”: “change”,
“p”: “payload”,
“pt”: “msg”,
“from”: “1”,
“fromt”: “str”,
“to”: “{”[IPX]Relay cmd 1":true}",
“tot”: “json”
}
],
“action”: “”,
“property”: “”,
“from”: “”,
“to”: “”,
“reg”: false,
“x”: 780,
“y”: 180,
“wires”: [
[
“8f7e7262bc6bf978”,
“5733ce634bba7c5e”
]
]
},
{
“id”: “471e3ac46dc6fb17”,
“type”: “debug”,
“z”: “bd5facfbf1ab26d3”,
“name”: “”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “false”,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 1010,
“y”: 120,
“wires”: []
},
{
“id”: “5733ce634bba7c5e”,
“type”: “debug”,
“z”: “bd5facfbf1ab26d3”,
“name”: “”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “false”,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 1010,
“y”: 220,
“wires”: []
},
{
“id”: “4c607c3838172c89”,
“type”: “function”,
“z”: “bd5facfbf1ab26d3”,
“name”: “Affiche Etat Relais”,
“func”: “var msg1,msg2,msg3,msg4,msg5,msg6,msg7,msg8;\n\nswitch (msg.payload) {\n case “{\”[IPX]Relay state 1\”:true}":\n msg1 = {payload:“on” };\n break;\n case “{\”[IPX]Relay state 1\":false}":\n msg1 = {payload:“off” };\n break;\n case “{\”[IPX]Relay state 2\":true}":\n msg2 = {payload:“on” };\n break;\n case “{\”[IPX]Relay state 2\":false}":\n msg2 = {payload:“off” };\n break; \n case “{\”[IPX]Relay state 3\":true}":\n msg3 = {payload:“on” };\n break;\n case “{\”[IPX]Relay state 3\":false}":\n msg3 = {payload:“off” };\n break; \n case “{\”[IPX]Relay state 4\":true}":\n msg4 = {payload:“on” };\n break;\n case “{\”[IPX]Relay state 4\":false}":\n msg4 = {payload:“off” };\n break;\n case “{\”[IPX]Relay state 5\":true}":\n msg5 = {payload:“on” };\n break;\n case “{\”[IPX]Relay state 5\":false}":\n msg5 = {payload:“off” };\n break;\n case “{\”[IPX]Relay state 6\":true}":\n msg6 = {payload:“on” };\n break;\n case “{\”[IPX]Relay state 6\":false}":\n msg6 = {payload:“off” };\n break;\n case “{\”[IPX]Relay state 7\":true}":\n msg7 = {payload:“on” };\n break;\n case “{\”[IPX]Relay state 7\":false}":\n msg7 = {payload:“off” };\n break;\n case “{\”[IPX]Relay state 8\":true}":\n msg8 = {payload:“on” };\n break;\n case “{\”[IPX]Relay state 8\":false}":\n msg8 = {payload:“off” };\n break;\n default:\n break;\n}\n\nreturn[msg1,msg2,msg3,msg4,msg5,msg6,msg7,msg8];\n",
“outputs”: 8,
“noerr”: 0,
“initialize”: “”,
“finalize”: “”,
“libs”: [],
“x”: 350,
“y”: 520,
“wires”: [
[
“7a2c02eed1eff9ac”,
“0449882499c60013”,
“cf703754e8389474”
],
[
“39798a670d4370ce”
],
[
“6d3908d16e32d7f9”
],
[
“91f0b8e3a8eb8406”
],
[
“f71432e31830af17”
],
[
“6ffa92a11ae4e5e3”
],
[
“cd738b08572ab6f2”
],
[
“48a9f0c127ea6c0c”
]
]
},
{
“id”: “dad62c88489febcb”,
“type”: “mqtt in”,
“z”: “bd5facfbf1ab26d3”,
“name”: “IPX800_V5-1”,
“topic”: “IPX800_V5-1”,
“qos”: “1”,
“datatype”: “auto”,
“broker”: “291914c5c9c68f02”,
“nl”: false,
“rap”: true,
“rh”: 0,
“inputs”: 0,
“x”: 130,
“y”: 520,
“wires”: [
[
“4c607c3838172c89”,
“f14f85a92afafbeb”
]
]
},
{
“id”: “f14f85a92afafbeb”,
“type”: “debug”,
“z”: “bd5facfbf1ab26d3”,
“name”: “”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “payload”,
“targetType”: “msg”,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 330,
“y”: 620,
“wires”: []
},
{
“id”: “7a2c02eed1eff9ac”,
“type”: “ui_text”,
“z”: “bd5facfbf1ab26d3”,
“group”: “df9ed293.78c83”,
“order”: 4,
“width”: 6,
“height”: 1,
“name”: " Etat Relais 1",
“label”: " Etat Relais 1",
“format”: “{{msg.payload}}”,
“layout”: “row-spread”,
“className”: “”,
“x”: 690,
“y”: 580,
“wires”: [],
“inputLabels”: [
“r1”
]
},
{
“id”: “39798a670d4370ce”,
“type”: “ui_text”,
“z”: “bd5facfbf1ab26d3”,
“group”: “df9ed293.78c83”,
“order”: 7,
“width”: 6,
“height”: 1,
“name”: " Etat Relais 2",
“label”: " Etat Relais 2",
“format”: “{{msg.payload}}”,
“layout”: “row-spread”,
“className”: “”,
“x”: 690,
“y”: 660,
“wires”: [],
“inputLabels”: [
“r2”
]
},
{
“id”: “6d3908d16e32d7f9”,
“type”: “ui_text”,
“z”: “bd5facfbf1ab26d3”,
“group”: “df9ed293.78c83”,
“order”: 10,
“width”: 6,
“height”: 1,
“name”: " Etat Relais 3",
“label”: " Etat Relais 3",
“format”: “{{msg.payload}}”,
“layout”: “row-spread”,
“className”: “”,
“x”: 690,
“y”: 700,
“wires”: [],
“inputLabels”: [
“r3”
]
},
{
“id”: “91f0b8e3a8eb8406”,
“type”: “ui_text”,
“z”: “bd5facfbf1ab26d3”,
“group”: “df9ed293.78c83”,
“order”: 13,
“width”: 6,
“height”: 1,
“name”: " Etat Relais 4",
“label”: " Etat Relais 4",
“format”: “{{msg.payload}}”,
“layout”: “row-spread”,
“className”: “”,
“x”: 690,
“y”: 740,
“wires”: [],
“inputLabels”: [
“r4”
]
},
{
“id”: “f71432e31830af17”,
“type”: “ui_text”,
“z”: “bd5facfbf1ab26d3”,
“group”: “df9ed293.78c83”,
“order”: 16,
“width”: 6,
“height”: 1,
“name”: " Etat Relais 5",
“label”: " Etat Relais 5",
“format”: “{{msg.payload}}”,
“layout”: “row-spread”,
“className”: “”,
“x”: 690,
“y”: 780,
“wires”: [],
“inputLabels”: [
“r5”
]
},
{
“id”: “6ffa92a11ae4e5e3”,
“type”: “ui_text”,
“z”: “bd5facfbf1ab26d3”,
“group”: “df9ed293.78c83”,
“order”: 19,
“width”: 6,
“height”: 1,
“name”: " Etat Relais 6",
“label”: " Etat Relais 6",
“format”: “{{msg.payload}}”,
“layout”: “row-spread”,
“className”: “”,
“x”: 690,
“y”: 820,
“wires”: [],
“inputLabels”: [
“r6”
]
},
{
“id”: “cd738b08572ab6f2”,
“type”: “ui_text”,
“z”: “bd5facfbf1ab26d3”,
“group”: “df9ed293.78c83”,
“order”: 22,
“width”: 6,
“height”: 1,
“name”: " Etat Relais 7",
“label”: " Etat Relais 7",
“format”: “{{msg.payload}}”,
“layout”: “row-spread”,
“className”: “”,
“x”: 690,
“y”: 860,
“wires”: [],
“inputLabels”: [
“r7”
]
},
{
“id”: “48a9f0c127ea6c0c”,
“type”: “ui_text”,
“z”: “bd5facfbf1ab26d3”,
“group”: “df9ed293.78c83”,
“order”: 25,
“width”: 6,
“height”: 1,
“name”: " Etat Relais 8",
“label”: " Etat Relais 8",
“format”: “{{msg.payload}}”,
“layout”: “row-spread”,
“className”: “”,
“x”: 690,
“y”: 900,
“wires”: [],
“inputLabels”: [
“r8”
]
},
{
“id”: “e48f93c4daf91058”,
“type”: “inject”,
“z”: “bd5facfbf1ab26d3”,
“name”: “[IPX]Relay cmd 1 = true “,
“props”: [
{
“p”: “topic”,
“vt”: “str”
},
{
“p”: “payload”
}
],
“repeat”: “”,
“crontab”: “”,
“once”: false,
“onceDelay”: 0.1,
“topic”: “IPX800_V5-1”,
“payload”: “{”[IPX]Relay cmd 1”:true}”,
“payloadType”: “str”,
“x”: 1060,
“y”: 80,
“wires”: [
[
“8f7e7262bc6bf978”,
“18f06c897243f285”
]
]
},
{
“id”: “5c014f61c640a7be”,
“type”: “inject”,
“z”: “bd5facfbf1ab26d3”,
“name”: “[IPX]Relay cmd 1 = false”,
“props”: [
{
“p”: “topic”,
“vt”: “str”
},
{
“p”: “payload”
}
],
“repeat”: “”,
“crontab”: “”,
“once”: false,
“onceDelay”: 0.1,
“topic”: “IPX800_V5-1”,
“payload”: “{”[IPX]Relay cmd 1":false}",
“payloadType”: “str”,
“x”: 1070,
“y”: 260,
“wires”: [
[
“8f7e7262bc6bf978”,
“824df8aab3cb60a6”
]
]
},
{
“id”: “824df8aab3cb60a6”,
“type”: “debug”,
“z”: “bd5facfbf1ab26d3”,
“name”: “”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “false”,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 1290,
“y”: 260,
“wires”: []
},
{
“id”: “18f06c897243f285”,
“type”: “debug”,
“z”: “bd5facfbf1ab26d3”,
“name”: “”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “false”,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 1270,
“y”: 80,
“wires”: []
},
{
“id”: “f7ebc07a077abf6c”,
“type”: “mqtt out”,
“z”: “bd5facfbf1ab26d3”,
“name”: “gladys”,
“topic”: “gladys/device/mqtt:lampe/feature/mqtt:lampe/state”,
“qos”: “1”,
“retain”: “true”,
“respTopic”: “”,
“contentType”: “”,
“userProps”: “”,
“correl”: “”,
“expiry”: “”,
“broker”: “291914c5c9c68f02”,
“x”: 1430,
“y”: 520,
“wires”: []
},
{
“id”: “0449882499c60013”,
“type”: “switch”,
“z”: “bd5facfbf1ab26d3”,
“name”: “”,
“property”: “payload”,
“propertyType”: “msg”,
“rules”: [
{
“t”: “eq”,
“v”: “on”,
“vt”: “str”
},
{
“t”: “eq”,
“v”: “off”,
“vt”: “str”
}
],
“checkall”: “true”,
“repair”: false,
“outputs”: 2,
“x”: 810,
“y”: 520,
“wires”: [
[
“2ff286aacb794830”,
“eeeb4703a6ae4e8d”
],
[
“26611eefe03f44f0”,
“89b610539bda7d0d”
]
]
},
{
“id”: “2ff286aacb794830”,
“type”: “change”,
“z”: “bd5facfbf1ab26d3”,
“name”: “”,
“rules”: [
{
“t”: “change”,
“p”: “payload”,
“pt”: “msg”,
“from”: “on”,
“fromt”: “str”,
“to”: “1”,
“tot”: “num”
}
],
“action”: “”,
“property”: “”,
“from”: “”,
“to”: “”,
“reg”: false,
“x”: 1020,
“y”: 500,
“wires”: [
[
“f7ebc07a077abf6c”,
“8d19143d84685d18”
]
]
},
{
“id”: “26611eefe03f44f0”,
“type”: “change”,
“z”: “bd5facfbf1ab26d3”,
“name”: “”,
“rules”: [
{
“t”: “change”,
“p”: “payload”,
“pt”: “msg”,
“from”: “off”,
“fromt”: “str”,
“to”: “0”,
“tot”: “num”
}
],
“action”: “”,
“property”: “”,
“from”: “”,
“to”: “”,
“reg”: false,
“x”: 1020,
“y”: 540,
“wires”: [
[
“f7ebc07a077abf6c”,
“e4dc354cc2860d26”
]
]
},
{
“id”: “cf703754e8389474”,
“type”: “debug”,
“z”: “bd5facfbf1ab26d3”,
“name”: “”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “false”,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 770,
“y”: 460,
“wires”: []
},
{
“id”: “eeeb4703a6ae4e8d”,
“type”: “debug”,
“z”: “bd5facfbf1ab26d3”,
“name”: “”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “false”,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 990,
“y”: 460,
“wires”: []
},
{
“id”: “89b610539bda7d0d”,
“type”: “debug”,
“z”: “bd5facfbf1ab26d3”,
“name”: “”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “false”,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 990,
“y”: 580,
“wires”: []
},
{
“id”: “8d19143d84685d18”,
“type”: “debug”,
“z”: “bd5facfbf1ab26d3”,
“name”: “”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “false”,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 1230,
“y”: 460,
“wires”: []
},
{
“id”: “e4dc354cc2860d26”,
“type”: “debug”,
“z”: “bd5facfbf1ab26d3”,
“name”: “”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “false”,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 1230,
“y”: 580,
“wires”: []
},
{
“id”: “ce0b75e88aa679cc”,
“type”: “inject”,
“z”: “bd5facfbf1ab26d3”,
“name”: “gladys/device/mqtt:lampe/feature/mqtt:lampe/state”,
“props”: [
{
“p”: “payload”
},
{
“p”: “topic”,
“vt”: “str”
}
],
“repeat”: “”,
“crontab”: “”,
“once”: false,
“onceDelay”: 0.1,
“topic”: “gladys/device/mqtt:lampe/feature/mqtt:lampe/state”,
“payload”: “0”,
“payloadType”: “str”,
“x”: 1150,
“y”: 640,
“wires”: [
[
“f7ebc07a077abf6c”
]
]
},
{
“id”: “19eb9b651728d044”,
“type”: “inject”,
“z”: “bd5facfbf1ab26d3”,
“name”: “gladys/device/mqtt:lampe/feature/mqtt:lampe/state”,
“props”: [
{
“p”: “topic”,
“vt”: “str”
},
{
“p”: “payload”
}
],
“repeat”: “”,
“crontab”: “”,
“once”: false,
“onceDelay”: 0.1,
“topic”: “gladys/device/mqtt:lampe/feature/mqtt:lampe/state”,
“payload”: “1”,
“payloadType”: “str”,
“x”: 1130,
“y”: 400,
“wires”: [
[
“f7ebc07a077abf6c”
]
]
},
{
“id”: “291914c5c9c68f02”,
“type”: “mqtt-broker”,
“name”: “mqtt://localhost”,
“broker”: “mqtt://localhost”,
“port”: “1883”,
“clientid”: “”,
“autoConnect”: true,
“usetls”: false,
“protocolVersion”: “4”,
“keepalive”: “60”,
“cleansession”: true,
“birthTopic”: “”,
“birthQos”: “0”,
“birthPayload”: “”,
“birthMsg”: {},
“closeTopic”: “”,
“closeQos”: “0”,
“closePayload”: “”,
“closeMsg”: {},
“willTopic”: “”,
“willQos”: “0”,
“willPayload”: “”,
“willMsg”: {},
“sessionExpiry”: “”
},
{
“id”: “df9ed293.78c83”,
“type”: “ui_group”,
“name”: “Relais”,
“tab”: “4414d280.f20c4c”,
“order”: 1,
“disp”: true,
“width”: “12”,
“collapse”: true,
“className”: “”
},
{
“id”: “4414d280.f20c4c”,
“type”: “ui_tab”,
“name”: “IPX800_V5 Dashboard”,
“icon”: “dashboard”,
“disabled”: false,
“hidden”: false
}
]

j’ai loupé quelque chose ?

Hello @pierre-gilles,
Actually, I think the issue with MQTT in this case is due to the lack of ability to set an element to subscribe only or publish only and not being able to link elements together.
For example, in Gladys I declare a switch, I want this switch to be linked to the relay of my IPX. This works if I click on the switch in Gladys, the relay is activated. However, if the relay is deactivated by another control, I don’t get the relay status back to the switch in the Gladys dashboard!

Hello,
This is because Gladys’s listening topic is different.
You need to send the device state to the topic that Gladys offers when you check the box ‹ Yes, this sensor only sends data… ›


You check, copy the topic, and then uncheck (or do not save the changes).

Yes, but we are moving from a Publish to an All (Publish/Subscribe) system, whereas in fact we would need:

  • In Gladys, a Publish « sends Gladys switch status to the outside » and the relay subscribed by Subscribe to this topic switches its state according to the value of this Publish
  • In Gladys, a Subscribe to the relay’s Publish that will switch the switch in Gladys and thus indicate that the relay has changed its state
    So here in the IPX800 there is a Publish topic that sends the relay status and a Subscribe topic that switches the relay according to the order sent by Gladys’ Publish
    And I don’t see how to achieve this functionality in Gladys as things stand!!!

I confirm what @GBoulvin said, you can use MQTT topics in both directions, even if the device is not a sensor.

The Gladys MQTT API is described here:

And it works in both directions

Good evening everyone
With Node Red and RFlink, I have no status feedback in the dashboard when I use my remote control to operate my 433MHZ outlet, whereas from the dashboard, when I operate this outlet it obviously works since I click on it. Are we dealing with the same issue as cce66?

Yes, but I don’t see how the distinction is made if it’s the same topic for both subscribe and publish and there is no loopback.

Example here with the switch, what is the subscribe and what is the publish? If it’s the same value, I think that’s a problem!

gladys/device/mqtt:commutateur/feature/mqtt:commutateur/state

The topic for publishing a new value from outside Gladys to Gladys:

The topic to subscribe to in order to receive state changes from outside Gladys:

If you look closely at the topic name, there is always the prefix « gladys » to avoid interference with other systems, and then the recipient of the message is always first:


  • « device » → the recipient is the device to control
  • « master » → the recipient is the Gladys master instance

I think something must be poorly explained somewhere because many people do not understand how it works, whereas for me it’s as clear as crystal :joy:

The problem is understanding how it’s phrased! :crazy_face:

So, in fact, « device » is « publish » and « master » is « subscribe, » right? :thinking: It might be more understandable to call them « Publish » and « Subscribe » in this case, so we can better understand the role and it’s closer to how MQTT works.
But maybe I still don’t understand how it works!!! :exploding_head:
I think this comes from the fact that you see gladys/mqtt as a single entity, and we no longer see the client/broker/client functionality, where the client is the publisher/provider of data and/or subscriber to a data, and the broker is just the transmitter of data.

There isn’t really a meaning…

It all depends on which side you’re talking about. As you said, Gladys and your device can be both a publisher and a subscriber.


So it’s a publish, the sensor only sends data and the topic is
gladys/master/device/mqtt:commutateur/feature/mqtt:commutateur/state
An external object, if it wants to receive data from this object, must subscribe to the topic
« gladys/master/device/mqtt:commutateur/feature/mqtt:commutateur/state »


gladys/device/mqtt:commutateur/feature/mqtt:commutateur/state
An external object, if it wants to receive data from this object, must subscribe to the topic
« gladys/master/device/mqtt:commutateur/feature/mqtt:commutateur/state »
but
if it wants to send data to it, it must send it to the topic:
« gladys/device/mqtt:commutateur/feature/mqtt:commutateur/state »

If that’s the case, I confirm it’s capillarotracté! :crazy_face: :firecracker:

It’s the opposite of what you say :slight_smile: (or else the copy-paste is in the wrong direction


Oh, that doesn’t make sense to me, we validate IF the sensor only sends data!
So here, the MQTT is « gladys/device » when it receives AND sends and « gladys/master » when it only sends!
Also, isn’t it possible to have boolean values for the min/max values?

Here, we consider Gladys’ perspective. Either she sends a command to a device, or she receives one. In the first case, Gladys publishes it on Gladys/device (intended for the device). In the second case, it’s the device that publishes on Gladys/master (intended for Gladys this time), for example, to report a status.

It’s important to understand that these two « addresses » are functional (each with their role described above) regardless of the position of the « Is it a sensor? » switch.

This switch is only there to try to facilitate the integration of sensors or actuators. Most devices do one or the other.

In your case, with a device that does both (control + status feedback), you need both of the aforementioned « addresses ». The position of the switch on this page will not change the operation of the two addresses; it’s just a visual element.