It's almost perfect, but the fact that LM have to send state change after a command received.
i.e. if they send a on/off command on a light (1/1/1, bim-write tagged), they can't receive the state of light (1/1/100, bim-read tagged) when changed.
They should send an explicit read request to 1/1/100, after the command, instead of receive it automatically.
This is already implemented. Ask them to check what messages they are receiving when any of the tagged objects change. Maybe the format has to be different from the NotificationPackage that is used as a reply for the read requests.
(07.06.2021, 09:59)admin Wrote: This is already implemented. Ask them to check what messages they are receiving when any of the tagged objects change. Maybe the format has to be different from the NotificationPackage that is used as a reply for the read requests.
well, at the moment the problem is only on bim-read-write tagged object: they send the command and that's fine, but they don't get no feedback.
Consider they NEVER send read request: all the informations must be actively sent by LM.
Feedback objects must be tagged the same way or it won't be sent. Ask them to check the websocket communication maybe something is wrong there. You can simply change a tagged object value in LM and the value should be sent over the websocket connection.
I refert to the case in wich an object have no feedback address, like i.e. a Thermostate Setpoint, or virtual objects, and the feedback comes from the same address I use for command. In those cases the object should be tagged bim-read-write, isn't? But they don't works...
Maybe the payload format must be different. As I've said ask them to check the websocket communication log. As I don't have any tools to test this further I cannot help without any extra information from their side.
You can log what is being sent over the websocket by modifying the sendobjvalue function in the user library. Make sure to do a full script restart via disable/enable after changing the library.
Code:
1234567891011121314151617
functionsendobjvalue(obj)
localdata = json.encode({
payload = {
Type = 'NotificationPackage',
Item = {
Name = obj.name,
State = encodevalue(obj.value, obj.dtype),
Type = obj.dtype,
Editable = obj.editable,
Link = ''
},
TimeStamp = timestamp()
}
})
log(data)
wsclient:send(data)
end
they receive every other state from objects tagged bim-read and can execute every command on objects tagged bim-write.
The mistake is only on bim-read-write objects.
Pardon, when I change from LM, They receive the feedback.
They receive nothing when change from their dashboard, even the command is correctly execute.
Ok, at the end we found the mistake: we have to never send a "write message", but only "read message", even in the case of a feedback after a write command.
that's what we have to send with a bim-read-write object:
If I understand correctly you want the changed value to be sent back when it's changed from the dashboard. If so then modify the eventhandler function as follows: