Virtual Sensor

59 views
Skip to first unread message

Amine BEN HAMMOUDA

unread,
Jan 31, 2020, 5:31:56 AM1/31/20
to OpenRemote
Hi,
I have a question concerning the simulator

In fact I was wondering if a simulation of a virtual sensor can be possible with openremote, I’ve saw the simulator in the smart building demo, I don't know if I’m right, but I understood that with that one we need to type the values ourselves.

What I hope to know is, is it possible to make simulation with a virtual sensor that generates values automatically the same way that a real one works ?

I hope that you answer me soon

Amine.

Pierre Kil

unread,
Jan 31, 2020, 7:38:35 AM1/31/20
to OpenRemote
Hi Amine,

You can create a new attribute which you fill via a Groovy rule which generates the values.

Pierre

Amine BEN HAMMOUDA

unread,
Feb 1, 2020, 9:36:23 AM2/1/20
to OpenRemote
Hi,

As I’m a beginner in this domain can you please show me an example of a groovy rule Witch can work as a sensor, I still a bit confused with these new notions


Amine. 

Richard Turner

unread,
Feb 11, 2020, 6:08:15 AM2/11/20
to OpenRemote
Hi,

I have put a gist together with a rule that will update an asset's attribute (in this example the microphone level of a sound asset - you will need to update the asset ID as explained in the gist):


Rich

Amine BEN HAMMOUDA

unread,
Feb 17, 2020, 4:57:57 AM2/17/20
to OpenRemote

Hi Richard,

Thank you for your last reply, however I have some little questions and I hope that you can answer me.

In fact when I try to execute the example that you linked, there are few thinks that still confusing.

I didn’t understood what should be the type and the configuration of the attribute that I should create, and how can I connect it with rule, because when I’m using the openremote manager demo and try to add a new ruleset, I can’t, and the interface remain greyed out.

I hope that you can answer me soon,

Thank you in advance,

 

Best regards,

Amine

Richard Turner

unread,
Feb 17, 2020, 11:00:05 AM2/17/20
to OpenRemote
Hi,

There was a bug in the manager rules UI which would have prevented you creating a new ruleset; I pushed a fix for this last week so please pull the latest docker images.

If you want to create a new asset and/or attribute for your virtual sensor data then the type of the attribute should be whatever the data type of the data you want to simulate (number, boolean, string/text, etc.)

Amine BEN HAMMOUDA

unread,
Feb 18, 2020, 11:20:51 AM2/18/20
to OpenRemote
Hi
Thank you very much for your reply it helped me a lot.

Amine BEN HAMMOUDA

unread,
Feb 25, 2020, 8:12:55 PM2/25/20
to OpenRemote
Hi Richard
there still something that I didn't understood in the gist and i hope that you can help me with it.
Could you please inform me if the values that are generated by the virtual sensor rule are linked to the Openremote middleware or not? I mean, can the middleware use the values that are generated by the virtual sensors?
If yes, could you please inform me how?

thank you in advance.
Best Regards,
Amine.

Richard Turner

unread,
Feb 26, 2020, 8:29:25 AM2/26/20
to OpenRemote
Hi,

The attribute you are generating virtual data for can have the RULE_STATE and/or RULE_EVENT meta/configuration item added and then it will be available in the rules engine to reason over.

Hope this helps.

Rich

Amine BEN HAMMOUDA

unread,
Feb 28, 2020, 6:19:03 PM2/28/20
to OpenRemote
Hi,
Thank you for your reply, however it still a bit confusing, and I think that I didn't formulate my question well.
What I meant to say is, correct me if I'm wrong please,  normally, in a real smart home, the data that are generated by the connected devices, should reach the OpenRemote Middleware to be processed, stored, displayed, etc.
Are  the data that are generated by the rule in the gist behaving the same way? can they reach the OR Middleware to be processed before being displayed? or are they just directly displayed on the attribute in the manager?
Forgive me if it's a bit unclear
thank you in advance
Amine.
Reply all
Reply to author
Forward
0 new messages