Smappee Binding

Thx. updated it…

also fixed the problem with the plugs.

Hi @NTanghe.Got my api credential from smappee support and downloaded org.openhab.binding.smappee-2.3.0-SNAPSHOT 28/3 latest change.Smappee monitor report online and can see the power and always in.But how are the appliances auto detected?Where will i find them?Thanks.

installed the latest snapshot and I’m currently experiencing two issues:

  • Openhab is not updating in line with the set Polling time. I did set it up at 1 minute but I only see a refresh evry 5-10min (while consumption is changing in mysmappee)
  • can’t detect smappee things via inbox

see log below:
https://pastebin.com/eQFJXTTS

@NTanghe: I upgraded openhab to 2.3 and the Discovery works again! However, the polling is still very unpredictable. I have enabled debugging and See the following:

Also, how do you get the state of a plug? I can switch it on/off but don’t get the current state

@pallie42 what do you mean with “polling is unpredictable” ?

The smappee api doesn’t allow to get the state of a plug :frowning:

As you cansee in my post abve, the polling is done each minute (8:57, 8:58,…) but the value was only received at 09:02 which is 6 minutes after the previous update. While I have set polling to 1 min. Hope that makes sense.

On the plug, I indeed verified last week with Smappee support and that is not an option currently. Would have been very useful though…

@pallie42 ok, To what I see, the polling in the smappee binding seems to work OK, as configured to 1 minute. But the smappee API will aggregate all consumption results to 5 minutes, that is why you don’t see any change for 5 minutes.
their documentation ->
https://smappee.atlassian.net/wiki/spaces/DEVAPI/pages/8552485/Get+Consumption
I’ve set the aggregation parameter to 1 (5 min), the smallest value possible.

More requests / issues on this binding ? If not, maybe it’s time to get it merged…

@NTanghe Windows 10 openhab 2.3.0,snappee 2.3.0 snapshot error.Jetty bug??

2018-04-27 15:35:34.799 [WARN ] [ding.smappee.internal.SmappeeService] - Communication error
org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
	at org.eclipse.jetty.client.AuthenticationProtocolHandler$AuthenticationListener.onComplete(AuthenticationProtocolHandler.java:114) [72:org.eclipse.jetty.client:9.3.21.v20170918]
	at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:193) [72:org.eclipse.jetty.client:9.3.21.v20170918]
	at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:185) [72:org.eclipse.jetty.client:9.3.21.v20170918]
	at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:458) [72:org.eclipse.jetty.client:9.3.21.v20170918]
	at org.eclipse.jetty.client.HttpReceiver.responseSuccess(HttpReceiver.java:405) [72:org.eclipse.jetty.client:9.3.21.v20170918]
	at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.messageComplete(HttpReceiverOverHTTP.java:277) [72:org.eclipse.jetty.client:9.3.21.v20170918]
	at org.eclipse.jetty.http.HttpParser.parseContent(HttpParser.java:1617) [75:org.eclipse.jetty.http:9.3.21.v20170918]
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1350) [75:org.eclipse.jetty.http:9.3.21.v20170918]
	at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.parse(HttpReceiverOverHTTP.java:159) [72:org.eclipse.jetty.client:9.3.21.v20170918]
	at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:120) [72:org.eclipse.jetty.client:9.3.21.v20170918]
	at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:70) [72:org.eclipse.jetty.client:9.3.21.v20170918]
	at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:90) [72:org.eclipse.jetty.client:9.3.21.v20170918]
	at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:115) [72:org.eclipse.jetty.client:9.3.21.v20170918]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283) [77:org.eclipse.jetty.io:9.3.21.v20170918]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108) [77:org.eclipse.jetty.io:9.3.21.v20170918]
	at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:251) [77:org.eclipse.jetty.io:9.3.21.v20170918]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283) [77:org.eclipse.jetty.io:9.3.21.v20170918]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108) [77:org.eclipse.jetty.io:9.3.21.v20170918]
	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [77:org.eclipse.jetty.io:9.3.21.v20170918]
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [88:org.eclipse.jetty.util:9.3.21.v20170918]
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [88:org.eclipse.jetty.util:9.3.21.v20170918]
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [88:org.eclipse.jetty.util:9.3.21.v20170918]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [88:org.eclipse.jetty.util:9.3.21.v20170918]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [88:org.eclipse.jetty.util:9.3.21.v20170918]
	at java.lang.Thread.run(Thread.java:748) [?:?]
2018-04-27 15:35:34.799 [WARN ] [ding.smappee.internal.SmappeeService] - Could not get access token

@garban The smappee binding can not authenticate to the smappee api. Are your credentials correct ? See smappee thing configuration on https://github.com/openhab/openhab2-addons/pull/2815

@NTanghe Yes. Credentials are ok. In mac works fine. In windows 10 is the issue.
This is the only thing relevant that I found https://github.com/eclipse/jetty.project/issues/1555

Update:Comletely uninstalled java and reinstalled jdk and now everything works.

@hilbrand Can you have a look at this pull request ?

There is a new build available, only minor functional changes. But the id of the things & channels changed ! Make sure to re-create your things / update your things file (see doc) !

I have read the discussions about the Smappee binding. It sounds great!
If I understand it right, the binding will only work with the Smappee API. I tried to contact the Smappee support but they didn’t tell me how much the usage of the API will cost.
Does anyone know how much I would have to pay?

Thanks in advance!

You buy a smappee, you can use their api, there are no extra costs.

Thank you for your answer.
It’s getting a bit confusing now: In the meantime the Smappee support wrote me that the API costs 2,50€ per month with a minimum of 24 month. So I would have to pay 60€ for 2 years.
They do not differentiate between professional and private users.

With this costs I do not want to buy Smappe.:frowning:

This is something new.
The line “The API is based on a recurring monthly fee.” was not in their documentation before
Also, not so very kind of them. I wonder what their motivation is in times that a product should be open and must have an api to integrate with.

Indeed, there are alternative openhab bindings for energy consumption monitoring :

If you have a smart meter :

:confused: does any of these have the same ability as smappee to differentiate between different electrical household products?

Just upgraded to 2.3.0-1 and your most recent Smappee binding from post above. Since them I’m getting the following error message:

2018-07-26 12:18:54.577 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.smappee-2.3.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.smappee [268]
  Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="2.2.0.201711142111"; osgi.identity="org.openhab.binding.smappee"; singleton:="true"

        at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) [?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [9:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [9:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [9:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [9:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [9:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [9:org.apache.felix.fileinstall:3.6.4]

Any idea how to get around this?
Thanks much

EDIT:
Found the mistake myself. The .things file syntax changed. After updating to the most recent syntax, Smappee came online and found new items.