Getting a string variable change out via the Eventsocket

Is there any way to get a message (eg. the contents of a string variable) out via the eventsocket? I appreciate variables are not objects in the database, but I'm wondering if it might be possible to output their value (at least when changed) in some form of JSON? Failing that, could we have an option to output "log" statements to the eventsocket? This would allow us to format a message any way I liked and then send it for easy digestion by a receiving listener. My use case is I'm building a string in RM containing warnings for the status of my property (eg. doors closed but not locked, fridge temp too high, smoke, leak etc) and want to be able to ping that string across to my custom dashboard so that I can display it there. Maybe there's another better approach but not sure if it's possible.

I would create a variable connector for this in Rule Machine. Then it will be available via any method of your choosing, including the event stream like regular devices (which this would then be one of). If you don't want that, maybe you could just create a rule that triggers on this variable changing and sends something over HTTP to an endpoint that whatever API you're using on the other side can understand? Variables are not otherwise accessible outside Rule Machine (they're a Rule Machine app feature, not a platform level feature), so these are the only two things I can think of.

1 Like

I will try this approach. Thank you for the idea!

Ah, I realised there's a much easier way to achieve what I wanted. I just write the text (it's a whole bunch of string variables) into a local file using RM and then access that file directly from my dashboard. Simples!

1 Like