Hi,
I have set a TCP agent which now can receive HEX message. I want to resolve the HEX message. So I want to set a rule or a converter to write an attribute when receive the HEX message.
import org.openremote.manager.rules.RulesBuilder
import org.openremote.model.query.AssetQuery
RulesBuilder rules = binding.rules
rules.add()
.name("resolve tcp message")
.when(
{facts ->
facts.matchFirstAssetState(
new AssetQuery()
.ids("43xfL5YPL7FCuy0nJZijj9")
.attributeName("manufacturer")
).isPresent()
})
.then(
{facts ->
facts.updateAssetState("43xfL5YPL7FCuy0nJZijj9", "message", "Conectado111");
facts.reset();
})
the rule seems not what I want. I also can not get the HEX message the sensor send to me. Any ideas?