Posts: 46
Threads: 5
Joined: Jan 2020
Reputation:
4
suddenly with today's auto update mqtt client stopped working for multiple instances. Rolling back to older released helped. In error log i can see initialization error for all objects in the rules. It seems i was too naive to have auto update enabled on LM, this update broke critical functionality right in the evening.
What happend with quality control for releases? i don't remember anything like that before.
Posts: 8173
Threads: 43
Joined: Jun 2015
Reputation:
473
@myg, an update has been published, see if it fixes the issue for you.
Posts: 46
Threads: 5
Joined: Jan 2020
Reputation:
4
(17.01.2025, 07:54) admin Wrote: @myg, an update has been published, see if it fixes the issue for you.
works again, thank you for quick update
Posts: 3
Threads: 0
Joined: Mar 2025
Reputation:
0
28.03.2025, 12:59
(This post was last modified: 28.03.2025, 13:02 by Pierluigi .)
Good morning,
I’m trying to use the Logic Machine 5 Lite for integrating a MQTT payload message.
This is a typically Topic/Payload we receive:
Topic: callway/ad75adfd-b72a-4119-a34c-dfb372df9ecf/status/1/1 QoS: 2
{"data":[{"position":0,"position_type":"room","room":1,"status":"assistance","timestamp":"2025-03-28T10:01:06.000Z","ward":1}],"timestamp":"2025-03-28T11:29:16.000Z","type":"snapshot","uuid":"ad75adfd-b72a-4119-a34c-dfb372df9ecf","version":"1.0.0"}
With this metode I receive on the “String Object” the value: (image 1 and 2)
The problem is that I need to export the value throught Bacnet communication and String object is not permitted.
So, i need to convert the string value into a numeric one, like 06.1 1byte signed integer.
Could you help me with the script ?
Thank you.
Attached Files
Thumbnail(s)
Posts: 5030
Threads: 28
Joined: Aug 2017
Reputation:
230
Click New Replay then you can attach images
------------------------------
Ctrl+F5
Posts: 8173
Threads: 43
Joined: Jun 2015
Reputation:
473
Do you have a define mapping between text and numeric values?
Posts: 3
Threads: 0
Joined: Mar 2025
Reputation:
0
28.03.2025, 13:03
(This post was last modified: 28.03.2025, 13:05 by Pierluigi .)
(28.03.2025, 13:02) Daniel Wrote: Click New Replay then you can attach images
i modified the previous message.
Thank you.
(28.03.2025, 13:03) admin Wrote: Do you have a define mapping between text and numeric values?
idle : 0
call: 1
presence: 2
unhooked: 3
assistance: 4
emergency: 5
technical: 6
speech: 7
Posts: 8173
Threads: 43
Joined: Jun 2015
Reputation:
473
Remove JSON value path, use this Input script:
Code:
local map = {
idle = 0,
call = 1,
presence = 2,
unhooked = 3,
assistance = 4,
emergency = 5,
technical = 6,
speech = 7,
}
local msg = json.pdecode(payload)
if type(msg) == 'table' then
local status = msg.data[1].status
return map[ status ]
end
Posts: 3
Threads: 0
Joined: Mar 2025
Reputation:
0
(28.03.2025, 13:11) admin Wrote: Remove JSON value path, use this Input script:
Code:
local map = {
idle = 0,
call = 1,
presence = 2,
unhooked = 3,
assistance = 4,
emergency = 5,
technical = 6,
speech = 7,
}
local msg = json.pdecode(payload)
if type(msg) == 'table' then
local status = msg.data[1].status
return map[ status ]
end
It works, really thank you.
Posts: 235
Threads: 65
Joined: May 2018
Reputation:
4
24.04.2025, 12:09
(This post was last modified: 24.04.2025, 12:10 by tomnord .)
Hello, MQTT client app works fine, but it would be nice to be able to edit topics in a texteditor or excel etc? If you have many topics, it is timeconsuming to add them all, or is this something that could be made in a script?
Posts: 8173
Threads: 43
Joined: Jun 2015
Reputation:
473
Try this:
Code:
data = {
direction = 'both',
topic = 'test2',
address = '0/0/1',
retain = '1',
buswrite = '1',
qospub = '0',
qossub = '0',
delta = '',
throttle = '',
jsonpath = '',
boolon = '',
booloff = '',
}
dofile('/www/apps/data/mqtt-client/lua/lib.lua')
res = save_topic(data)
log(res)
reload()
Posts: 235
Threads: 65
Joined: May 2018
Reputation:
4
thanks. Is there any easy way of implementing timestamp in the script?
Posts: 8173
Threads: 43
Joined: Jun 2015
Reputation:
473
Timestamp for what? Explain your task in more detail.
Posts: 235
Threads: 65
Joined: May 2018
Reputation:
4
25.04.2025, 09:47
(This post was last modified: 25.04.2025, 09:50 by tomnord .)
I would like a timestamp as an object in the JSON sendt from LM, can it be done in the script section. i see that "timestamp = os.time()" worked in script.
That returns unix time?
Posts: 8173
Threads: 43
Joined: Jun 2015
Reputation:
473
Yes, os.time() returns UNIX timestamp.
Posts: 235
Threads: 65
Joined: May 2018
Reputation:
4
(24.04.2025, 12:25) admin Wrote: Try this:
Code:
data = {
direction = 'both',
topic = 'test2',
address = '0/0/1',
retain = '1',
buswrite = '1',
qospub = '0',
qossub = '0',
delta = '',
throttle = '',
jsonpath = '',
boolon = '',
booloff = '',
}
dofile('/www/apps/data/mqtt-client/lua/lib.lua')
res = save_topic(data)
log(res)
reload()
Regarding this, any good ideas on how to implement this based on GA names? As far as I can see we need to run the "save_topic" once for each new topic.
Posts: 8173
Threads: 43
Joined: Jun 2015
Reputation:
473
Use tags. You can filter object list using wildcard search and assign tags using mass edit option.
Posts: 270
Threads: 60
Joined: Sep 2015
Reputation:
0
30.05.2025, 16:07
(This post was last modified: 30.05.2025, 16:14 by jmir .)
Hi,
I'm trying to use certificates and I get this message:
"Save failed: unable to get local issuer certificate"
I've seen that someone had this same issue... How can it be fixed?
Using MQTT-Explorer and the same certificates it works.
Thanks.
Posts: 8173
Threads: 43
Joined: Jun 2015
Reputation:
473
Posts: 270
Threads: 60
Joined: Sep 2015
Reputation:
0
Hi,
Is there any way to use $ caracter in topic name?
I'm trying to use aws and need that topic name start with $aws/....