Some new bindings to offer : Azure IOT Hub, Seneye monitor, Smappee monitor

I’ve coded some new Openhab 2 bindings.

  1. Azure IOT Hub (2.0 io module)

Sync status of all your items to microsoft azure IOT Hub (https://azure.microsoft.com/en-us/services/iot-hub/). Both device 2 cloud and cloud 2 device are supported.
I use it to make fancy powerbi reports for all my openhab items, you can also use it to trigger all sort of events in the cloud.

  1. Seneye monitor (2.0 binding)

Seneye aquarium monitoring system (https://www.seneye.com).
Monitors the water parameters (NH3/NH4/PH/O2) and light parameters of you indoor aquarium or outdoor pool.

  1. Smappee monitor (2.0 binding)

Smappee energy monitor (http://www.smappee.com/be_en/home).
Smart energy monitoring system for your energy consumption with support for solar systems.

Anyone interested in this ? I’m happy to contribute

2 Likes

Certainly interested in the Smappee binding!

Whether or not you get a great response from this posting, I think your contributions would be welcomed by the maintainers and future users of OH.

If you choose not to contribute these bindings to the core set of addons, at least get them listed in the IoT Marketplace.

+1 for Smappee

As a first step, you should make jars available for download (plus at least some information how to configure it). I guess there’s a number of interested enthusiasts willing to become beta testers.

For a guideline how to contribute in general, have a look here.

@NTanghe welcome to the community! :houses:

You have a few ways to share your bindings:

  • Submit the Pull Requests for them - one PR per binding. It will be reviewed by maintainers and after that they’ll become official openHAB Add-ons which would be awesome! As @mstormi highlighted, the Developer Guide should get you going.
    Note that when you submit a new Pull Request and it has no build errors, your binding becomes automatically available to download as a JAR from this URL

  • Other option is to distribute your JAR through the Eclipse IoT Marketplace - see this post for more details.

Thank you for your work!
Best regards

Great! I will contribute to SMAPPEE binding as JrtPec and I re-engineered the gateway and AWS cloud API already. The python code is available here https://github.com/EnergieID/smappy

In addition, this API requires a lot of testing… which I can do, too. My Openhub2 is running already :rofl:

ok, 3 new Pull requests.

Seneye : https://github.com/openhab/openhab2-addons/pull/2814
Smappee : https://github.com/openhab/openhab2-addons/pull/2815
Azure IOT Hub : https://github.com/openhab/openhab2-addons/pull/2816

Openhab is an open source project, so no marketplace for me :slight_smile:

3 Likes

I just found this integration with Azure IoT and thought, why not IoT edge?
It feels that opehab is a perfect example for implementing Azure IoT edge. (I am not sure if you are doing this internally).

@NTanghe, thanks for your work! the IotHub binding really opens a world of possibilities :slight_smile:

I just installed and configured it but I’m encountering some problems, I’ve logged them here if you’re interested.

Could you clarify the syntax for sending a cloud to device command?

@NTanghe, also thank you for your work!
I want to stream sensor data via openhab to the Azure IoT Hub. Similar to MichVw, items are created successfully and visible in the Azure IoT devices section, but the status of the item (e.g. temperature value) is not trasmitted. It seems to be that the openhab server (version 2.3) is unable to set up a stable connection to the Azure Hub. Following you will find my openhab-log entries:

15:36:41.786 [ERROR] [b.io.internal.azureiothub.CloudClient] - Failed to obtain azure device
java.io.IOException: Unable to connect to serviceMqttException
at com.microsoft.azure.sdk.iot.device.transport.mqtt.MqttIotHubConnection.open(MqttIotHubConnection.java:138) [229:org.openhab.io.azureiothub:2.3.0]
at com.microsoft.azure.sdk.iot.device.transport.mqtt.MqttTransport.open(MqttTransport.java:83) [229:org.openhab.io.azureiothub:2.3.0]
at com.microsoft.azure.sdk.iot.device.DeviceIO.open(DeviceIO.java:209) [229:org.openhab.io.azureiothub:2.3.0]
at com.microsoft.azure.sdk.iot.device.DeviceClient.open(DeviceClient.java:184) [229:org.openhab.io.azureiothub:2.3.0]
at org.openhab.io.internal.azureiothub.AzureDevice.(AzureDevice.java:47) [229:org.openhab.io.azureiothub:2.3.0]
at org.openhab.io.internal.azureiothub.AzureDevices.getDevice(AzureDevices.java:61) [229:org.openhab.io.azureiothub:2.3.0]
at org.openhab.io.internal.azureiothub.CloudClient.sendItemUpdate(CloudClient.java:82) [229:org.openhab.io.azureiothub:2.3.0]
at org.openhab.io.internal.azureiothub.CloudService.receive(CloudService.java:83) [229:org.openhab.io.azureiothub:2.3.0]
at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [101:org.eclipse.smarthome.core:0.10.0.oh230]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [101:org.eclipse.smarthome.core:0.10.0.oh230]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
15:36:42.113 [INFO ] [sdk.iot.device.IotHubConnectionString] - IotHubConnectionString object is created successfully for LightEngineNetwork.azure-devices.net, method name is
15:36:42.115 [INFO ] [ure.sdk.iot.device.DeviceClientConfig] - DeviceClientConfig object is created successfully with IotHubName=LightEngineNetwork.azure-devices.net, deviceID=TSmartLightA3_Radar , method name is
15:36:42.117 [INFO ] [crosoft.azure.sdk.iot.device.DeviceIO] - DeviceIO object is created successfully, method name is
15:36:42.118 [INFO ] [oft.azure.sdk.iot.device.DeviceClient] - DeviceClient object is created successfully, method name is
15:36:46.791 [WARN ] [ome.core.internal.events.EventHandler] - Dispatching event to subscriber ‘org.openhab.io.internal.azureiothub.CloudService@310c5d51’ takes more than 5000ms.

Do you already know this kind of error?

Im really keen to use this binding but am having some issues, the binding looks to have created all of the IOT devices in azure iot hub but only looks to send one set of values and does not update again until a reboot.

i get theses errors in the logs:

2018-08-22 17:47:39.636 [ERROR] [.iot.device.transport.IotHubSendTask] - IotHubSendTask constructor called with null value for parameter transport

2018-08-22 17:47:39.637 [ERROR] [t.device.transport.IotHubReceiveTask] - IotHubReceiveTask constructor called with null value for parameter transport

2018-08-22 17:47:39.833 [ERROR] [.iot.device.transport.IotHubSendTask] - IotHubSendTask constructor called with null value for parameter transport

2018-08-22 17:47:39.835 [ERROR] [t.device.transport.IotHubReceiveTask] - IotHubReceiveTask constructor called with null value for parameter transport

2018-08-22 17:47:40.277 [ERROR] [.io.internal.azureiothub.CloudClient] - Failed to obtain azure device

then i get this warning:

2018-08-22 17:48:58.240 [WARN ] [me.core.internal.events.EventHandler] - Dispatching event to subscriber ‘org.openhab.io.internal.azureiothub.CloudService@2a6969ce’ takes more than 5000ms.

then no more errors i think it gives up.

Any help would be great.

Shane

1 Like

Hi shanekuz. Did you manage to fix the issue?
I’m very interested in an Azure IoT Hub connector that really works…
I used a plugin in Home Assistant that worked pretty well, but I’m not a javascript, so I’m a little blocked with Openhab.

Hi Kloonich no i haven’t managed to fix this but understand what the issue is, The IOT Hub or service to send to it does not deal with NULL values. and a number of my devices when powered off like pioneer amps etc have null values when they are off.

The service does not deal with NULL values and after it gets one it times out and then the service stops and does not try again by the looks of it.

I cant get rid of NULL values in my environment so unless someone can fix the code then i cant use it.

If you have a simple setup then it will probably work fine i would say.

Shane

I am testing the Azure IoT binding in OpenHab 2.4.
The devices are visible in Azure eventually, but noe status updates goes through.

I see this in the OpenHab log:

[me.core.internal.events.EventHandler] - Dispatching event to subscriber ‘org.openhab.io.internal.azureiothub.CloudService@f2e127’ takes more than 5000ms.

Is the Azure IoT binding actually working? Does it require more config than what is described here?

1 Like

hello @dagmartinromslo,
Have you resolved your issue? I’ve got the same one.

Hi. I weren’t able to solve the issue :frowning:

I’ve reminded about this issue in https://github.com/openhab/openhab2-addons/issues/3647 and I’m still waiting for the fix.

The ideal fix for this seems simple, like for other persistence bindings there should be a persistence file and if the item is in this file then its state changes are send to IOT HUB.

If this was added to the code i feel this would resolve all of our issues. Im still really keen to use this but cant due to NULL values stopping the binding.

Anybody ever got this working? It’s a shame if it got abandoned. It is a very nice possibility to be able to add your devices to whole Azure eco system.