New integration: Energy monitoring device Circutor Wibeee

I think one key aspect why I don’t get support from the manufacturer with this issue is that from the Smilics/Iberdrola perspective, it “works” on their portal with firmware 150. Upgrading the firmware to get stats in Home Assistant instead of their portal is maybe not their priority. I can’t say.

Hi, Congrats for this code. This week the installers of the solar panels (from iberdrola) added this device to my home and now I’m interested in grabbing the data in to HA. I already have some experience using modbus and I wonder if anyone has already tested that way of obtaining data in contrast of using a REST call.

FYI, if you switch on the MODBUS slider, the UI tells you the web server will be disabled and no information will be sent to the server (iberdrola host) at this time, I think if modbus is enabled HA integration should push back to the iberdrola cloud so they don’t notice the difference. Modbus could potentially be a way to overcome the current problems regarding refresh time and unexpected firmware downgrades …

@ihr I agree with everything you say. I never tried it personally because I didn’t think people would want to to give up Wibeee Nest data.

For disclosure, I am working on a version that proxies the upstream calls to Nest and saves them in HA as well. This means that we’ll have updates in HA every few seconds and also full Nest access, and more importantly no problems with the REST API.

I’ve most of the code in place and will release a beta some time over the next few weeks.

1 Like

Very interesting thing to come! thanks for sharing :slight_smile:

I got an answer from Smilics that ask me to try to upgrade the firmware through their “pro” app not the consumer app. They think it should provide a more stable firmware upgrade process. I’ll try next week.

On a side note, please note that the wibeee boxes delivered by Iberdrola are “tagged” in their database as only authorised to connect to the Iberdrola flavour of their portal, that is, it is possible that the API these boxes use is not exactly the “Nest” version that you are trying to mimic.

I cannot say for sure, but I bought a second box myself in a shop and it was registering to the “wibeee home” portal but was forbidden on the Iberdrola portal, and vice-versa for the other one. I had the support team of Smilics to retag the second box as if it was delivered by Iberdrola so that both boxes were aggregating their data to the same portal.

And now they guarantee me that upgrading the firmware through their “Wibeee business” app will not untag them from the Iberdrola portal. To be confirmed…

In parallel I am switching these boxes for two Shelly EM sensors, hoping to increase the reliability. If I can upgrade the firmware correctly I’ll try to reuse the wibeee for sub-circuit measurement, and maybe I’ll be able to test the modbus option when you share it.

footnote:
I spotted already 4 portals to manage wibeee boxes:

monitorconsumo.iberdrola.es/mirubee_front/ (Iberdrola portal)
home.wibeee.com/mirubee_front/ (Wibeee consumer portal)
nest.wibeee.com/ (Nest portal?)
smilics.com/wibeee/ (a.k.a. "Wibeee business" portal)

The portal incompatibility with my boxes was between the first two URLs, so I’m not sure if the Nest and Business are yet other databases or else?

For those interested, there is a beta version available with Local Push support. When configured correctly, the data recorded in HA will be the same “live” data that is used in Wibeee Nest (not the energy counters but the gauge data such as Power, etc). Polling still occurs to update the other counters.

Configuration:

  1. Enable the Wibeee Nest Proxy in the Integration’s configuration.
    wibeee integration

  2. Go to the Wibeee web UI and in Advanced Options update the Server section as described below

    Before: Server URL is nest-ingest.wibeee.com and Server Port is 80
    After: Server URL the IP address of your HA instance and Server Port is 8600

    wibeee config

    Click Apply to make Wibeee restart, after which it should start pushing data to the Wibeee integration within HA.

Data received by the Wibeee integration is forwarded to http://nest-ingest.wibeee.com:80. Here it is in action. Wibeee Nest continues to receive the same data so you can use the Nest app if you like.

Limitations:

  • Only working with nest-ingest.wibeee.com as the upstream for the time being (i.e. not working for monitorconsumo.iberdrola.es and others).
  • Home Assistant port 8600 needs to be accessible by the Wibeee device (previously only Wibeee needed to be accessible by Home Assistant and not the other way around).

Please report any issues in Issues · luuuis/hass_wibeee · GitHub.

Is this server working? Checking it, through a browser, I only get: “{“Error”: “Not found”}”

The only server/port that works for me is: www.smilics.com / 8080.

Yes, this is a Wibeee/Smilics API, you are not meant to access it directly @Ostracizado. It is where the devices send their data to be displayed in Wibeee Nest. To view the data you should be accessing https://nest.wibeee.com/ after you have registered your meter there.

After a week of testing I am very pleased with the results, Wibeee is keeping up with my Shelly 3EM that uses the built-in integration (IoT class: Local Push).

Here is HA on the left and Wibeee Nest on the right displaying data from the same meter.

I finally did it. Working great, @luuuis!

Still, it’s hard to go over mqtt and a esp32 that’s receiving data from the shelly. :thinking:
I’m using it for FreeDS, but damn… the transfer data is almost instantaneous.

1 Like

@luuuis, any idea why the value of Active Power, doesn’t show negative values, while it does on Wibeee Nest?
I could do a template to solve it, but still… just wondering.

Example:

I am just storing the values reported by the meter, it always reports a positive number. Wibeee Nest is probably multiplying by the sign of the power factor as I show in Sensor Examples · luuuis/hass_wibeee Wiki · GitHub.

I think I might do the same within the integration for the next major version so that the template sensor becomes unnecessary.

1 Like

Muchas gracias. Funciona todo perfectamente. Agradecerte enormemente tu trabajo, para ir solucionando los problemas que han ido surgiendo.
Tengo una duda sobre el funcionamiento de active_energy_l1_cost, ya que no me funciona. Estaria muy bien que viniera dando los costes que hemos integrado en Wibeee Nest .
Por ultimo L4 es la suma de L1+L2+L3?.De nuevo gracias por todo

1 Like

I just release a new version with more functions and tools. With the tools added you can emulate WiBeee and cloud side of the App (whatever use of the product).

Needs some improvements, I appreciate comments on that.

As well another tool is a firmware “finder” and downloader (see firmare on repo).

All it’s here: https://github.com/fquinto/pywibeee

Python package:

:slight_smile:

1 Like

Mil gracias por tu trabajo!
Esta tarde actualicé vía HACS e hice como indicas para ponerle al medidor la IP de mi HomeAssistant.
Todo esta funcionando genial!

PD: Lo pongo aquí por si alguien lo necesita. Al entrar en la IP del medidor, en el usuario puse “user” y en el password “user” y me dejó entrar.

1 Like

Hi there!

Thanks for the integration!
I’ve two Wibeees those were more or less properly working with HA for a while, but now, it seems that with firmware v4.4.159, the internal web server works for only some minutes in the best of the cases.

I was trying to configure the proxy, but the HA doesn’t shows the values.
In my case, the Wibeee is reporting to http://wattius.mirubee.com. I’ve updated the nest.py file to include it here:

async def get_nest_proxy(
hass: HomeAssistant,
upstream=‘http://wattius.mirubee.com’,
local_port=8600,
) → NestProxy:

My questions are:

  • Even if the proxy is setup, is it still querying to the local ip/status? or if proxy is setup then it just gathering the data from the push?
  • Is it needed anything else to configure to have it working? (I see in the router that there is traffic from Wibeee to the HA but sensors show unavaiable data)

Thanks/Carlos

http://wattius.mirubee.com points to the old Mirubee service. I don’t think it works any more since April 2022. In any case, the integration doesn’t care too much what happens to the data that is sent upstream.

Yes, HA will still access the device API once in a while (according to the polling interval you configure). If the API does not respond then the sensors will be marked unavailable until they finally respond.

The only hard requirement is that /en/status.xml responds when it is used; the proxy configuration is currently only used to get more frequent updates but it does not receive data for all the sensors.

I think this could be improved, please raise an issue in GitHub to continue this discussion.

If /en/status.xml does not respond then the device’s web UI should not be working either. Is that the case? I would try setting the polling interval to a high number (e.g. 5 minutes). I would also report to Wibeee that the device UI is not responding under this firmware.

Dear luuuis, thank you for your hard work. Unfortunately, it seems that this integration does not work for me. I have an Mirubee Mirubox v1. I can access the web page to see the real time data, but not through the url: /en/status.xml, but through url: /index.html. Would there be any solution to be able to integrate the data from that Mirubee into HA.
Thank you very much

@Tarod1977 does the data update in real time without having to press the refresh button? If so, have a look at the browser developer tools to see how it is fetching the info.

Thank you very much for the reply @luuuis. Yes, the data is updated every second. I’m sorry, but I’m a complete newbie at this, do you mean something like this?

 * Helper function to make a block element visible.
 * 
 * @param node The node to be made block visible.
 */
function unHide (node){
	node.style.display = 'block';
}


function recvSmartplug(status, respXml, respTxt) {

	var spXml = parseResponse(respXml, respTxt);

	var spRoot = spXml.getElementsByTagName('smartplug');
	if (spRoot && spRoot.length > 0) {
		getEle('apiver').innerHTML = getTagContent(spRoot[0], 'version');
		getEle('sdkver').innerHTML = getTagContent(spRoot[0], 'sdk_version');
		var pm = spRoot[0].getElementsByTagName('pm');
		if (pm && pm.length > 0) {
			var voltage01 = getTagContent(pm[0], 'volts');
			var current01 = getTagContent(pm[0], 'current');
			var power01 = getTagContent(pm[0], 'power');
			var energy01 = getTagContent(pm[0], 'energy');
			var reactivepower01 = getTagContent(pm[0], 'reactive_power');
			
							
			getEle('voltage01').innerHTML = (voltage01 != null && voltage01 != "" && voltage01 != -1) ? voltage01
					: "NA";
			getEle('current01').innerHTML = (current01 != null && current01 != "" && current01 != -1) ? current01
					: "NA";
			getEle('power01').innerHTML = (power01 != null && power01 != "" && power01 != -1) ? power01
					: "NA";
			getEle('reactivepower01').innerHTML = (reactivepower01 != null && reactivepower01 != "" && reactivepower01 != -1) ? reactivepower01
					: "NA";
					
									
			if (energy01 != null && energy01 != "" && energy01 != -1) {
				unHide(document.getElementById('energyDivId'));
				getEle('energy01').innerHTML = energy01;
			} else {
				hide(document.getElementById('energyDivId'));

			}
			
			
			
		}
		
		if (pm && pm.length > 0) {
			var voltage02 = getTagContent(pm[0], 'vrms');
			var current02 = getTagContent(pm[0], 'irms');
			var power02 = getTagContent(pm[0], 'watt');
			var energy02 = getTagContent(pm[0], 'kwh');
			var reactivepower02 = getTagContent(pm[0], 'var');				
							
			getEle('voltage02').innerHTML = (voltage02 != null && voltage02 != "" && voltage02 != -1) ? voltage02
					: "NA";
			getEle('current02').innerHTML = (current02 != null && current02 != "" && current02 != -1) ? current02
					: "NA";
			getEle('power02').innerHTML = (power02 != null && power02 != "" && power02 != -1) ? power02
					: "NA";
			getEle('reactivepower02').innerHTML = (reactivepower02 != null && reactivepower02 != "" && reactivepower02 != -1) ? reactivepower02
					: "NA";
			if (energy02 != null && energy02 != "" && energy02 != -1) {
				unHide(document.getElementById('energyDivId02'));
				getEle('energy02').innerHTML = energy02;
			} else {
				hide(document.getElementById('energyDivId02'));

			}
		}

		var type = getTagContent(spRoot[0], 'type');

/* if (type != null && type != “”) {
unHide(document.getElementById(‘modelDivId’));
getEle(‘modelId’).innerHTML = type;
} else {
hide(document.getElementById(‘modelDivId’));
} */

		var curTime, hr, ms, sec, suf;
		curTime = new Date();
		hr = curTime.getHours();
		suf = ((hr > 11) ? ' PM' : ' AM');
		hr = ((hr > 11) ? (hr - 12) : hr);
		hr = (hr == 0) ? '12' : hr;
		ms = curTime.getMinutes();
		sec = curTime.getSeconds();
		getEle("curTime").innerHTML = hr + ':'
				+ ((ms > 9) ? ms : ('0' + ms)) + ':'
				+ ((sec > 9) ? sec : ('0' + sec)) + suf;
	}

}

	function resetEnergy() {
	var postXml = createXmlDoc('smartplug');
	var pm = postXml.createElement('pm');
	postXml.documentElement.appendChild(pm);

	var energy = 0;
	appendXmlElement(postXml, pm, 'energy', energy);
	execPOST('/gainspan/profile/smartplug', postXml, function() {

	});

}

/**
 * Helper function to hide an element. Works for both block and inline elements.
 * 
 * @param node The node to be hidden
 */
function hide(node) {
	node.style.display = 'none';
}

function updateTimeOut() {
	var newTimeOut = parseInt(getDropDownItemSelected());

	if (newTimeOut >= 1 && newTimeOut <= 60) {
		clearTimeout(timeOutId);
		timeOutValue = newTimeOut * 1000;
		timeOutId = setTimeout('updateSmartplug(1)', timeOutValue);
		return true;
	} else {
		alert("Please enter the Valid Time Out between 1 and 60.");
		return false;
	}
}

function getDropDownItemSelected() {
	var drop = document.getElementById('selRefresh');
	return drop.options[drop.selectedIndex].value;
}

function getContentOfId(id) {
	return document.getElementById(id).value;
}

function populateDropDown(min, max) {
	var drop = document.getElementById('selRefresh');

	var defaultTimeout = timeOutValue / 1000;
	for ( var i = min, index = 0; i <= max; i++, index++) {
		drop.options[index] = new Option(i, i, false);
	}

	drop.value = defaultTimeout;
}

function initialize() {
	populateDropDown(1, 60);
	updateSmartplug(true);
}

function updateSmartplug(refresh) {
	var lsResult = execGET('/gainspan/profile/smartplug', recvSmartplug);

	if (refresh == 1) {
		timeOutId = setTimeout('updateSmartplug(1)', timeOutValue);
	}
}
<div class="global">
	<div class="logo">
		<img src="pt_logo.jpg" alt="GainSpan" />
	</div>
	<br class="clear" />
	<div class="header_text1" align="center">
	  <h1>CT Meter Web Application</h1>
	<div class="clr"></div>
	</div>
	<div id="landing" class="section"></div>
	<hr>
	<div align="center">
		<b>Channel1 Voltage </b> : <span id="voltage01" style="padding-left: 20px;" class="sumval"></span> Volts <br
			class="clear" />
	</div>
	<div align="center">
		<b>Channel1 Current</b> : <span id="current01" style="padding-left: 20px;" class="sumval"></span> Amps <br
			class="clear" />
	</div>
	<div align="center">
		<b>Channel1 Power</b>: <span id="power01" class="sumval"  style="padding-left: 20px;"></span> Watt <br
			class="clear" />
	</div>
	<div align="center">
		<b>Channel1 Reactive Power</b>: <span id="reactivepower01"  style="padding-left: 20px;" class="sumval"></span> Var <br
			class="clear" />
	</div>
	<div align="center">
		<div id="energyDivId">
			<b>Channel1 Energy</b>: <span id="energy01" class="sumval"  style="padding-left: 20px;"></span>KWH
			<br
				class="clear" />
		</div>
		<div align="center">
		<b>Channel2 Voltage </b> : <span id="voltage02" style="padding-left: 20px;" class="sumval"></span> Volts <br
			class="clear" />
	</div>
	<div align="center">
		<b>Channel2 Current</b> : <span id="current02" style="padding-left: 20px;" class="sumval"></span> Amps <br
			class="clear" />
	</div>
	<div align="center">
		<b>Channel2 Power</b>: <span id="power02" class="sumval"  style="padding-left: 20px;"></span> Watt <br
			class="clear" />
	</div>
	<div align="center">
		<b>Channel2 Reactive Power</b>: <span id="reactivepower02"  style="padding-left: 20px;" class="sumval"></span> Var <br
			class="clear" />
	</div>
	<div align="center">
		<div id="energyDivId02">
			<b>Channel2 Energy</b>: <span id="energy02" class="sumval"  style="padding-left: 20px;"></span>KWH
			<br
				class="clear" />
		</div>

Thank you for your help. In the end I created the sensors I wanted using web scraping and finding the page from which this page took the data, because it was a dynamic page.

1 Like