Shelly Binding

delete the thing and re-discover, the channel definition needs to be updated

Sorry, I tried that. Still the same. The 2nd decimal is displayed as 0 and the state from REST API is still 1 decimal:

 "state": "27.8 V",

ok, the code did the update with 1 digit too, check updated build
(both builds for 3.0 and 3.1 are updated)


Latest DEV builds: 3.1M5+ or 3.0.x/3.1M1-M4 - README - Installation - Avdanced Users - Shelly Manager - Bugs/Features - Firmware Index - Firmware Archive - API Doc
Note: A release for 2.5 is still available, but will not be updated anymore: 2.5.13

Thanks, that did it:

{
  "link": "http://localhost:8080/rest/items/ShellyUNIshellyunie8db84d6b3e510163199230_VoltageADC",
  "state": "27.81 V",
  "stateDescription": {
    "pattern": "%.2f %unit%",
    "readOnly": true,
    "options": []
  },

Please let me know if there is any info/testing you need to be able to add the Shelly EM Power Factor information if/when you get the chance to look at that.

Really appreciate your help.

There should already be the channel meter#meterPowerFactor
this gets created if pf is included in the emeter json

I don’t see it on mine:


Have deleted the Thing and rediscovered.

We access shows the PF as being available.

I created PR 10815

  • Feature #10090 New device#supplyVoltage channel for Shelly 2.5, 1PM and 1L
  • Change #10039 Info on “not reachable / timeout” should be warning, not info
  • Fix #10799 Missing Channel Definition for Vibration Events
  • Fix #10738 Shelly UNI - ADC Voltage units of measure missing
  • Fix #10111 Creating Equipment from Shelly Bulb Duo causes wrong min/max
  • README updated

maybe we could also a fix for PF if this doesn’t work
Please provide the output from /settings und /status

em-status.json (975 Bytes)
em-settings.json (1.9 KB)
Thanks

hmm, there is no pf in emeter json
Bildschirmfoto 2021-06-06 um 17.20.20

can you try http://<device ip>/emeter/0
and see if this includes pf

Hi,
sorry the provided link for 3.0.x isn’t compatibly with 3.0.x.


==> /var/log/openhab/openhab.log <==
2021-06-06 17:27:23.006 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.shelly-3.1.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.shelly [269]
  Unresolved requirement: Import-Package: javax.measure; version="[2.1.0,3.0.0)"
	at org.eclipse.osgi.container.Module.start(Module.java:444) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.4

{"power":766.62,"reactive":481.66,"voltage":222.50,"is_valid":true,"total":169336.3,"total_returned":0.0}

Appears not?

hmm, that’s the problem. If no pf is included in the JSON the channel doesn’t get created
which firmware are you running?

please try again, I did a rebuild
make sure to delete 3.1.0-SNAPSHOT.jar and use instead 3.0.3-SNAPSHOT.har, fo safety run openhab-cli clean-cache after deleting the old jar

Thank’s. The Sensor works now, everything seems fine.

Do you have an EM or 3EM?

It is an EM.

Thanks for your Feedback. After setting the IOT IP of the OH server within the Shelly binding config, all ColoT stuff started to work again.
Appreciate your help.
Thanks Sebastian

As you reported yourself the EM doesn’t return “pf” as part of the status JSON
The 3EM includes this field

{"power":13.16,"pf":0.62,"current":0.09,"voltage":236.20,"is_valid":true,"total":57771.5,"total_returned":0.1}

and therefore the channel shows up.

OK. Thanks. Have logged a query with Shelly - hopefully they get back to me?

If PF is shown in the EM Web UI it must be computed in the JavaScript code. Please save the html and post it here then I couild check. I have a EM and 3EM here, but currently I’m reworking by test bed.