Let me give you a bit of an explanation of what I have managed to have so far.
I have an Python code that is able to send information to OpenRemote (both numerical or JSON type). My question is whether it is possible to receive information from OpenRemote to the Python code.
One of the reasons that I use OpenRemote is that I was hoping that I could share information/data through it.
My idea is that a Python code would send data to OpenRemote. Once uploaded, another Python code would receive this data (or part of it). this way I can use OpenRemote as a data sharing platform but I cannot find anything online that allows to do this… do you know perhaps?
So I followed the manual that pcr just linked and I manage to send info into my OpenRemote locally hosted session.
What I have a difficulty implementing is subscribing to a topic. Just as in the manual I have created the subscribe attribute but I cannot turn on and off through Python but only using MQTT explorer using the code line clientMQTT.subscribe(f"master/{clientID}/writeattributevalue/{attributeSub}/{assetIDSub}")
What I understood so far about the subscribe function is that if my agent is subscribe to a topic it will receive the data depending on my choice (i.e. update every time it changes or every 15 min).
I am implementing the paho lib like you suggest but I am quite lost with the documentation.
It walks you through activating and deactivation a boolean value of the subscribe attribute but I don’t understand how I can implement that into my code such that if subscribed to a topic my Python variable changes…
I would imagine that I need to create a variable in my code that can register the data but I can’t find anything on how to do so.