Hi,
I recently took on this challenge myself. Below is how I achieved it using node-red.
The only thing you may need to change this the index of your devices in the data.products array.
e.g data.products[1] maybe data.products[0] for you or you may have many more devices. Add a debug and log the response from the http to inspect.
inject → function → http → function → mqtt
function - Set Headers For Login
msg.payload = {"username":"USERNAME","password":"PASSWORD","devices":true,"products":true,"actions":true,"homes":true};
msg.headers = {};
msg.headers['Sec-Fetch-Dest'] = 'empty';
msg.headers['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36';
msg.headers['Content-Type'] = 'application/json';
msg.headers['Accept'] = '*/*';
msg.url = 'https://beekeeper.hivehome.com/1.0/global/login'
return msg;
http - Login To Hive
function - Parse and extract target temperature
var data = JSON.parse(msg.payload);
msg.payload = data.products[0].state.target;
return msg;
Send Target Temperature to MQTT
Repeat the steps for the other values
function - Parse and extract Hot Water Status
var data = JSON.parse(msg.payload);
msg.payload = data.products[1].state.status == "OFF" ? 0 : 1;
return msg;
function - Parse and extract Current Temperature
var data = JSON.parse(msg.payload);
msg.payload = data.products[0].props.temperature;
return msg;
function - Parse and extract Heating Status
var data = JSON.parse(msg.payload);
msg.payload = data.products[0].props.working ? 1 : 0;
return msg;