Community
OpenEnergyMonitor

OpenEnergyMonitor Community

MQTT and ioBroker

Hello,

Now my first controller and 7 Modules are running very well.
Unfortunately, I have a issue with MQTT and ioBroker. The values are not separated. I looks like a high number of values are only in one value. See attached pictures. I was searching in the web but not find a solution. Hope somebody could help me.

Thanks to Stuart for the nice project!
Regards Fruehwi

Thats correct - its a JSON payload

If you familiar with Blocky, just use this block.
image

It does the job for you

in case of future questions, feel free to ask.

Br Chis :wink:

Hi Chris,

yes, I made same blocky´s . Puh that means I have to separate all values by self. Please, do you have a part of a screen shot for me? That I could copy it.
Thanks. BR Tom

@stuart thanks for splitting this up :wink:

The question ist, why? What you going to do with all this values. if you only like to view them in your visualisation, just use the .json table. If you are using some of this values in calculation or else use the block above to receive the needed value.
At least, this would be the way I would do it.
Br Chris

Hi Chris,
I would like to sent notifications if something is happen.

I wrote a script this works well and could modified.
Only add the relevant objects in Biobroker

BR Fruehwi

function setDps() {

// Cell 0
var obj = JSON.parse(getState(‘mqtt.0.diybms1.0.0’).val);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.0.voltage’, obj.voltage, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.0.vMax’, obj.vMax, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.0.vMin’, obj.vMin, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.0.bypass’, obj.bypass, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.0.PWM’, obj.PWM, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.0.inttemp’, obj.inttemp, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.0.exttemp’, obj.exttemp, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.0.mAh’, obj.mAh, true);
// Cell 1
var obj = JSON.parse(getState(‘mqtt.0.diybms1.0.1’).val);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.1.voltage’, obj.voltage, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.1.vMax’, obj.vMax, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.1.vMin’, obj.vMin, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.1.bypass’, obj.bypass, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.1.PWM’, obj.PWM, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.1.inttemp’, obj.inttemp, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.1.exttemp’, obj.exttemp, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.1.mAh’, obj.mAh, true);
// Cell 2
var obj = JSON.parse(getState(‘mqtt.0.diybms1.0.2’).val);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.2.voltage’, obj.voltage, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.2.vMax’, obj.vMax, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.2.vMin’, obj.vMin, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.2.bypass’, obj.bypass, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.2.PWM’, obj.PWM, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.2.inttemp’, obj.inttemp, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.2.exttemp’, obj.exttemp, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.2.mAh’, obj.mAh, true);
// Cell 3
var obj = JSON.parse(getState(‘mqtt.0.diybms1.0.3’).val);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.3.voltage’, obj.voltage, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.3.vMax’, obj.vMax, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.3.vMin’, obj.vMin, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.3.bypass’, obj.bypass, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.3.PWM’, obj.PWM, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.3.inttemp’, obj.inttemp, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.3.exttemp’, obj.exttemp, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.3.mAh’, obj.mAh, true);
// Cell 4
var obj = JSON.parse(getState(‘mqtt.0.diybms1.0.4’).val);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.4.voltage’, obj.voltage, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.4.vMax’, obj.vMax, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.4.vMin’, obj.vMin, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.4.bypass’, obj.bypass, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.4.PWM’, obj.PWM, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.4.inttemp’, obj.inttemp, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.4.exttemp’, obj.exttemp, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.4.mAh’, obj.mAh, true);
// Cell 5
var obj = JSON.parse(getState(‘mqtt.0.diybms1.0.5’).val);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.5.voltage’, obj.voltage, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.5.vMax’, obj.vMax, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.5.vMin’, obj.vMin, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.5.bypass’, obj.bypass, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.5.PWM’, obj.PWM, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.5.inttemp’, obj.inttemp, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.5.exttemp’, obj.exttemp, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.5.mAh’, obj.mAh, true);
// Cell 6
var obj = JSON.parse(getState(‘mqtt.0.diybms1.0.6’).val);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.6.voltage’, obj.voltage, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.6.vMax’, obj.vMax, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.6.vMin’, obj.vMin, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.6.bypass’, obj.bypass, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.6.PWM’, obj.PWM, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.6.inttemp’, obj.inttemp, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.6.exttemp’, obj.exttemp, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.6.mAh’, obj.mAh, true);
// Cell 7
var obj = JSON.parse(getState(‘mqtt.0.diybms1.0.7’).val);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.7.voltage’, obj.voltage, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.7.vMax’, obj.vMax, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.7.vMin’, obj.vMin, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.7.bypass’, obj.bypass, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.7.PWM’, obj.PWM, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.7.inttemp’, obj.inttemp, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.7.exttemp’, obj.exttemp, true);
setState(‘javascript.0.PV_Anlage.DIYbms1.0.7.mAh’, obj.mAh, true);
};
setDps(); // Script start
on(‘mqtt.0.diybms1.status’, setDps); // trigger by change of status JSON-Strings

1 Like