Implement Shelly BLU H&T in VenusOS via NodeRed

Hi all,

I just wanted to share a solution for displaying Shelly H&T data (temperature and humididy sensor) on my CerboGX, as i found no solution for this yet.

Prerequisites:

-CerboGX with large image and NodeRed

-Shelly device acting as Bluetooth Gateway

Setup:

First, the shelly device acting as the gateway need to be added in NodeRed.

Mode needs to be set as “Callback” and the bluetooth gateway script needs to be installed.

After the script is running, put the device node into a function with following code:

let d = msg.payload;

if (d && d.info && d.info.data) {
    d = d.info.data;
} else {
    return null;
}

// get values
let temperature = Number(d.temperature);
let humidity = Number(d.humidity);

// payload for virtual device
msg.payload = {
    "/Temperature": Number(d.temperature),
    "/Humidity": Number(d.humidity)
};

return msg;

After this, point the output of the function into a virtual temperatur sensor with humdidy activated

After this, the data will be displayed on the cerbo

If you have any improvements or questions, please let me know!

Best regards,
Erik

I did the same thing a little bit differently through MQTT

  1. In Shelly gateway device enable MQTT and configure it to connect to Venus OS
  2. Install “Universal BLU to MQTT script” in Shelly
  3. Node Red flow: “mqtt in” → “change” → “virtual device”

My method does not require Shelly device to be added to Venus OS. Multiple gateways could post to the same MQTT topic if they “hear” the same sensor, but then deduplication will probably need to be implemented.

Topic in “mqtt in” node is MAC address of the sensor

In change node JSONata expression is:

{
  "/Temperature": payload.service_data.temperature,
  "/Humidity": payload.service_data.humidity
}