Transformation of a BME280 sensor output from a python script

  • Platform information:
    • Hardware: Raspberry Pi 3b+ Processor: BCM2835; Linux 4.19.50-v7+ armv7l
    • OS: Raspbian GNU/Linux 10 (buster); Firmware #896
    • Java Runtime Environment: (build 11.0.8+10-post-Raspbian-1deb10u1); Version 11.0.8" 2020-07-14
    • openHAB version: 2.5.9 Release Build

Dear community,

I am struggling with the identification of an output for several values. I assume that I have to work with Regex transformation, but I don’t see any ground here. Can you help me out with the following?

I have a simple BME280 sensor connected to my Raspberry Pi. With the following command I get the output:

Shell command used with the Exec binding:
python bme280.py

Output:

Chip ID     : 96
Version     : 0
Temperature :  15.35 C
Pressure :  1017.64481711 hPa
Humidity :  55.1403911383 %

I want to have one rule to identify the temperature and humidity values to assign these to my related items for temperatur and humidty. How does my Regex transformation need to look like?

Thanks for your help and best regards,
Markus

Can you amend your script to send JSON? It’s very nearly there already.

1 Like

You can run your script as a HABApp rule, that way you can set the items directly through HABApp.

1 Like