OK, I was hoping is was a way to have the script running from a UDT or the tagg.
(Update after some houres)
This is a solution I found to do it if anybody else wounder.
I have tags from knx to the mqtt broker. Some of them are setpoints that I need to send values down to. But they can be change on the KNX side to. If they are updated on the KNX side it's only publish to the sts value. If I want to update them from mqtt I send them on the cmd, but then sts is not updated.
Inn ignition i made a tag script on value changes
[MQTT Engine]KNX/ee/bridge/006c00636903/Instell/RT401_T_SP/cmd
def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):
# Get the value of the [MQTT Engine]KNX/ee/bridge/006c00636903/Instell/RT401_T_SP/cmd tag as a string
tag_value = str(system.tag.read("[MQTT Engine]KNX/ee/bridge/006c00636903/Instell/RT401_T_SP/cmd").value)
# Construct the MQTT payload with the tag name and its value
payload = tag_value.encode('utf-8')
# Publish the payload to the MQTT broker
system.cirruslink.engine.publish("HiveMQ Cloud storm elektro", "ee/bridge/006c00636903/Instell/RT401_T_SP/sts", payload, 0, 0)
# Publish the payload to the MQTT broker
system.cirruslink.engine.publish("HiveMQ Cloud storm elektro", "ee/bridge/006c00636903/Instell/RT401_T_SP/cmd", payload, 0, 0)
and on [MQTT Engine]KNX/ee/bridge/006c00636903/Instell/RT401_T_SP/sts
def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):
# Get the value of the [MQTT Engine]KNX/ee/bridge/006c00636903/Instell/RT401_T_SP/sts tag as a string
tag_value = str(system.tag.read("[MQTT Engine]KNX/ee/bridge/006c00636903/Instell/RT401_T_SP/sts").value)
# Construct the MQTT payload with the tag name and its value
payload = tag_value.encode('utf-8')
# Publish the payload to the MQTT broker
system.cirruslink.engine.publish("HiveMQ Cloud storm elektro", "ee/bridge/006c00636903/Instell/RT401_T_SP/cmd", payload, 0, 0)
If the sts value is updated from KNX I update the cmd value.
And if I change the cmd value from ignition I update both the sts and cmd value.
Thanks for all the help