This will probably give you a better result. Allen recommended NodeRed as an alternative. If you code something in Python you can publish/subscribe for events using OH’s REST API or using MQTT. For an example see GitHub - rkoshak/sensorReporter: A python based service that receives sensor inputs and publishes them in various ways.. I have this running in various RPis to interact with sensors and actuators around the house and use MQTT to publish the sensor readings and subscribe to MQTT messages to cause things to occur.