Smappee Binding

Have just tried this out on latest snapshot. The monitor thing and overall energy is fine but the discovered appliances remain as INITIALIZING. Any idea how to go about solving this?

Hey all,
since a few days my smappee binding is logging like hell for 2 appliances.
Logs look like this:

2018-12-04 23:00:01.502 [WARN ] [ppee.handler.SmappeeApplianceHandler] - failed to read to read power consumption for appliance 60
2018-12-04 23:00:01.614 [WARN ] [ppee.handler.SmappeeApplianceHandler] - failed to read to read power consumption for appliance 11
2018-12-04 23:00:01.678 [WARN ] [ppee.handler.SmappeeApplianceHandler] - failed to read to read power consumption for appliance 60
2018-12-04 23:00:01.811 [WARN ] [ppee.handler.SmappeeApplianceHandler] - failed to read to read power consumption for appliance 11

Its roughly 10 lines per second.

swa@nuc:/var/log/openhab2$ grep -c "failed to read to read power consumption" openhab.log
99922

Its only applicance 11 & 60. Both are online things in OH, so wondering what the problem might be? Already restarted OH as well as Smappee monitor. Anyone an idea?
Thanks much

Bump

1 Like

Thx for the binding. I just installed it on MacOs Catalina 10.15.1 (19B88) on my MacMini (2012) with openHAB 2.4.0.

Has anyone managed to get gas & water sensors working on this binding? They are detected automatically but stuck on INITIALIZING

I was able to make more progress with the water/gas sensors when i took a look at this today. I’ve installed the 2.3 version as this made it further, and based on the logs and looking in the github folder i noticed an error in the code
Within: org.openhab.binding.smappee/src/main/java/org/openhab/binding/smappee/internal/SmappeeService.java

Line: 248 has the following code:
String responseReadings = getData(
“/dev/v1/servicelocation/” + this.serviceLocationId + “/sensor” + sensorId + “/consumption?”
+ “aggregation=1&from=” + nowUtcMinus1YearMillis + “&to=” + nowUtcMillis);

This should actually be:
String responseReadings = getData(
“/dev/v1/servicelocation/” + this.serviceLocationId + “/sensor/” + sensorId + “/consumption?”
+ “aggregation=1&from=” + nowUtcMinus1YearMillis + “&to=” + nowUtcMillis);

This is missing a / in the URL resulting in this giving a 404 not found error,
Its using URL: https://app1pub.smappee.net/dev/v1/servicelocation/1/sensor4/consumption?from=1457597400000&to=1458666049000&aggregation=1
When it should be:
https://app1pub.smappee.net/dev/v1/servicelocation/1/sensor/4/consumption?from=1457597400000&to=1458666049000&aggregation=1

Is this something that can be fixed within the main code?

Hi @NTanghe , hi all
any hints what happened to the smappee binding? It obviously was pulled from GitHub and unfortunately, the current version does not run on OH3. Any ideas?

2021-03-21 10:34:59.272 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.smappee-2.4.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.smappee [245]
  Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:="optional"
  Unresolved requirement: Import-Package: org.eclipse.smarthome.config.core

Hello All,
where can I find the description of the binding how to use it?
The links to GitHub are not working anymore.
Anyone an idea how to configure it?
Or same examples ?

You can enable MQTT in the Smappee monitor if that helps at all. Go to /smappee.html, log in, select “advanced” on the left and click the “advanced” checkbox at the bottom under “Advanced action”.

I’m not sure if you can change settings in the Smappee, but you certainly get more data than you can shake a sh**** stick at.

I got this information from Smappee support, so you’d best ask them if you need any more info. I don’t know much more than this.

Steve

Hello Steve,
thanks for the tipp.
MQTT Activation worked, now I have to read the valus and input them into my sidemap.
Will follow up.

Bernd

MQTT works perfect, I can get all data needed form the monitor.
Thanks for the tip

Bernd

Hi Bernd,
I’m trying to achieve the same thing, could you please give me some more info?
Thank you

Hello,
of course if I can help you.

maybe some general topic:
first you have to login locally as described by Steve.
http://SmappeelocalIPAdress/smappee.html
PWD: admin

Then you can enable the MQTT protocoll and configure your MQTT broker which gives you all the data you need.
here an example:

Message: servicelocation/22e89ec4-edad-4a72-8b6d-357f63e49f43/realtime:
{"totalPower":768,"totalReactivePower":749,"totalExportEnergy":0,
"totalImportEnergy":104037,"monitorStatus":0,"utcTimeStamp":1618754057956,
"channelPowers":[
{"ctInput":0,"power":485,"exportEnergy":0,"importEnergy":68975,"phaseId":1,"current":26},
{"ctInput":1,"power":136,"exportEnergy":0,"importEnergy":17218,"phaseId":0,"current":10},
{"ctInput":2,"power":146,"exportEnergy":0,"importEnergy":17834,"phaseId":2,"current":10}
],
"voltages":[{"voltage":239,"phaseId":0}]}

Reading the data in openHab
here my things file:

Thing mqtt:topic:smappee "Smappee Stromwerte" {

        Channels:

            Type number : Hauspower         "Gesamtleistung"    [ stateTopic="servicelocation/22e89ec4-edad-4a72-8b6d-357f63e49f43/realtime", transformationPattern="JSONPATH:$.totalPower"]

            Type number : HauspowerL1       "Leistung L1"       [ stateTopic="servicelocation/22e89ec4-edad-4a72-8b6d-357f63e49f43/realtime", transformationPattern="JSONPATH:$.channelPowers[0].power"]

            Type number : HausL1Curr        "Strom L1"          [ stateTopic="servicelocation/22e89ec4-edad-4a72-8b6d-357f63e49f43/realtime", transformationPattern="JSONPATH:$.channelPowers[0].current"]

            Type number : HauspowerL2       "Leistung L2"       [ stateTopic="servicelocation/22e89ec4-edad-4a72-8b6d-357f63e49f43/realtime", transformationPattern="JSONPATH:$.channelPowers[1].power"]

            Type number : HausL2Curr        "Strom L1"          [ stateTopic="servicelocation/22e89ec4-edad-4a72-8b6d-357f63e49f43/realtime", transformationPattern="JSONPATH:$.channelPowers[1].current"]

            Type number : HauspowerL3       "Leistung L3"       [ stateTopic="servicelocation/22e89ec4-edad-4a72-8b6d-357f63e49f43/realtime", transformationPattern="JSONPATH:$.channelPowers[2].power"]

            Type number : HausL3Curr        "Strom L3"          [ stateTopic="servicelocation/22e89ec4-edad-4a72-8b6d-357f63e49f43/realtime", transformationPattern="JSONPATH:$.channelPowers[2].current"]

            Type number : HausVolt          "Spannung"          [ stateTopic="servicelocation/22e89ec4-edad-4a72-8b6d-357f63e49f43/realtime", transformationPattern="JSONPATH:$.voltages[0].voltage"]

        }

Then defining the items:

// MQTT Kanäle SMAPPEE

Number UG_StromHaus    "Gesamt Leistung [%d W]"         <house>  (gUG_Strom)     {channel="mqtt:topic:smappee:Hauspower"}

Number UG_HauspowerL1  "Leistung L1 [%d W]"             <house>  (gUG_Strom)     {channel="mqtt:topic:smappee:HauspowerL1"}

Number UG_HausStromL1  "Strom L1 (A) [JS(divide10.js):%.1f A]"                <house>  (gUG_Strom)     {channel="mqtt:topic:smappee:HausL1Curr"}

Number UG_HauspowerL2  "Leistung L2 [%d W]"             <house>  (gUG_Strom)     {channel="mqtt:topic:smappee:HauspowerL2"}

Number UG_HausStromL2  "Strom L2 (A) [JS(divide10.js):%.1f A]"                <house>  (gUG_Strom)     {channel="mqtt:topic:smappee:HausL2Curr"}

Number UG_HauspowerL3  "Leistung L3 [%d W]"             <house>  (gUG_Strom)     {channel="mqtt:topic:smappee:HauspowerL3"}

Number UG_HausStromL3  "Strom L3 (A) [JS(divide10.js):%.1f A]"                <house>  (gUG_Strom)     {channel="mqtt:topic:smappee:HausL3Curr"}

Number UG_HausVolt     "Spannung [%d V]"                <house>  (gUG_Strom)     {channel="mqtt:topic:smappee:HausVolt"}


I hope this helps.
Bernd