Shelly Beta with Plus/Pro and BLU Support

I’m already working on the next version, which will become a beta build again

@markus7017 : there were several negative feedbacks reported with the OH 3.4 release… but also positive…
Could you go through all the messages regarding Shelly binding and OH 3.4?

@markus7017, I get the following error with the beta binding for 3.4.2 when trying to initialize a Pro 3EM.

OMMUNICATION_ERROR
Unexpected error: Unable to create object of type Shelly2DeviceStatus$Shelly2DeviceStatusResult from JSON (syntax/format error: java.lang.IllegalStateException: Expected null but was NUMBER at line 1 column 339 path $.em:0.total_current): {"ble":{},"cloud":{"connected":true},"em:0":{"id":0.0,"a_current":0.726,"a_voltage":240.9,"a_act_power":33.9,"a_aprt_power":174.8,"a_pf":-0.55,"b_current":1.067,"b_voltage":237.9,"b_act_power":162.8,"b_aprt_power":253.7,"b_pf":-0.74,"c_current":0.809,"c_voltage":238.4,"c_act_power":95.3,"c_aprt_power":192.6,"c_pf":-0.66,"total_current":2.601,"total_act_power":292.057,"total_aprt_power":621.023,"user_calibrated_phase":[]},"emdata:0":{"id":0.0,"a_total_act_energy":9782.02,"a_total_act_ret_energy":0.0,"b_total_act_energy":22545.2,"b_total_act_ret_energy":0.0,"c_total_act_energy":20184.03,"c_total_act_ret_energy":0.0,"total_act":52511.24,"total_act_ret":0.0},"eth":{},"modbus":{},"mqtt":{"connected":false},"sys":{"mac":"C8F09E8966D0","restart_required":false,"time":"12:58","unixtime":1.680001083E9,"uptime":442667.0,"ram_size":232136.0,"ram_free":118340.0,"fs_size":524288.0,"fs_free":172032.0,"cfg_rev":11.0,"kvs_rev":0.0,"webhook_rev":0.0,"available_updates":{}},"temperature:0":{"id":0.0,"tC":47.7,"tF":117.9},"wifi":{"sta_ip":"192.168.0.34","status":"got ip","ssid":"Skynet","rssi":-70.0},"ws":{"connected":false}}(class com.google.gson.JsonSyntaxException)

try the updated 3.4.3-SNAPSHOT


3.4.3-DEV Gen1/Plus/Pro | 4.0.0-DEV Gen1/Plus/Pro | README | READMEbeta
Avdanced Users - Shelly Manager - Bugs/Features - API Doc | Firmware Index - Firmware Archive


Note: The DEV build is always newer than the version in the official Distro or Milestone builds

Thanks Markus, now it works. Only thing I noticed is that the Accumulated Total Power channel always stays at 0 kWh.

Best,
Florian

I updated the DEV build to take those values from the device rather computing them from the 3 phases. It requires fw 0.14.1, previous versions do not report total_xxx

See also here: Shelly Binding - #3188 by markus7017

1 Like

Hi guys,

I was on OH 3.3 (Windows 10) until I updated to 3.4.3 today due to my new Shelly Plus Plugs were not supported by former binding version. After the update, I unistalled the official Shelly binding, did feature:install openhab-transport-coap via console and put org.openhab.binding.shelly-3.4.3-SNAPSHOT into addons folder. After restarting OH, all Shelly things showed up Error:Handler (not sure about the exact wording). I then tried to install Shelly Beta from Marketplace, but I got the same error-message in Main UI as mentioned a few times at the beginning of this thread (Installation of add-on marketplace:139554 failed). I then went through this thread compeltely and recoginzed that the official binding does support plus devices also. I then deleted the jar and installed the official binding again. All existing Shelly Things come back online, and the plus plugs were found by autodiscover. However, both plus plugs are shown offline and following errors are shown:
shelly1
English: IP-address of shelly device not configured


English: the device is currently not supported. A newer version of the binding might be required.

Clearing cache and tmp, restarting OH and Windows did not help. Any hint what to do now?

Edit: I also get tons of log entries - not sure whether this is somehow related to the issue above:

2023-04-28 12:31:00.001 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ShellyRelayHandler tried updating the thing status although the handler was already disposed.

I found this thread on github where changing CoIoT to peer mode solves the issue for others. But unfortunately not for me :frowning: Any help is appreciated!

logging is now working again. It seems there was another issue at my setup, see here for reference.

However, my plus plugs are auto-detected but still not working (see screenshots above). @markus7017 - may I send you TRACE logs per PM?

You need to use the DEV build, this is linked above. The market place installation doesn‘t work. I assume a syntax error in the definition, but couldn‘t figure out the problem.

Download the 3.4.3-SNAPSHOT jar
remove the version, which comes with the dist
re-install the coap transport feature
copy jar into addons folder
run discovery

Hi @markus7017,

I just added a ShellyPlus 1PM (FW 0.14.1) to my Home and integrated it to my OH 3.4.4 installation. I replaced the Shelly binding with your current 3.4.5-SNAPSHOT release. The ShellyPlus 1PM gets found and added to the list of things - great!

Yet there are a few issues or questions:

  • channel shelly:shellyplus1pm:[id]:device#accumulatedWTotal is of type Number:Power - that should be of type Number:Energy when reporting kWh, no?
  • that channel is reported as kWh and incrementing very slowly. Looks like its divided by 1000, so its actually reporting MWh?!?
  • how is that channel related to the MQTT status? Right now the item linked to that channel is reporting 0.002kWh while this is the MQTT message:
    shelly_notification:161 Status change of switch:0: {"id":0,"aenergy":{"by_minute":[42.844,43.326,43.326],"minute_ts":1687111259,"total":6743.324}}
  • in the Shelly Manager I see a large count (>1k) of “Protocol Messages”. When hovering over that count is says: “CoIOT Status: Events are disabled”. What does this mean and how do I enable CoIOT, if needed?

Thanks for your fantastic work!

Installation from Marketplace has been fixed:

When trying to install the Shelly Beta version from the OH marketplace, installation was aborted with a genetic message “installation failed”. The syntax on the page Shelly Beta with Plus/Pro and BLU Support has been updated to fix the issue.

However, you might need to clean the Marketplace cache folder ‘/var/lib/openhab/marketplace/bundles/139554’.
There should be only one file: org.openhab.binding.shelly-4.1.0-SNAPSHOT.jar
Remove all others.

You might need to restart OH, because the marketplace entries are cached on runtime.

Hi Markus,
great news.
This beta version is the same as your dev build, correct?
Does installation via market place als install all dependencies?

Today yes, tomorrow no.

I can’t point the resource file to my myfiles repo, the link format for the installer is not supported.
So, I created a GitHub release in my code repo (e.g. blu_motion2 branch as of today). In the future I’ll create Beta release from time to time, when I have something stable (e.g. after a PR has merged). Check the release notes for the current one.

I am still unsure. So your dev builds will still be more up to date than the beta version?

In general yes, let’s define this:

  • The is a version included in the official list
  • The might be merged PRs, which go into the next milestone build
  • I’ll provide beta versions (stable DEV versions)
  • And the myfiles repo holds the current development status (unstable)

I think most users should go with the release or beta version, but it you want to stay top of line (e.g. you need supported for new Shelly devices), then you could select the DEV build.

Hi,
I don’t know whether it is the right place for this topic. If not please advise :wink:
On autodiscover of shellies (Shelly3EM in this case) with the shelly beta binding I have following issue: there is no differentiation between the separate meters of some items!

For example the electrical current for meter 1:
image

…for meter 2:
image

… and for meter 3:
image

They all have the same name. Do I have to change that manually to seperate between the different meters? Or did I a mistake?

Many thanks in advance for your help!!

Just assign different names

Ok, thanks!

Hello @markus7017,
Can you tell me when the support for blu gateway will be available in a version ? Beta or DEV.
Thank you very much.

I’ve posted a question about totalKWH on e Pro 3EM (here).
Should that be solved with the Beta Binding for Shelly?

Unfortunately, I wasn’t able to uninstall the official version yet. When trying to uninstall from the UI, I get errors in openhab.log
[ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'washingmachine-5' failed: An error occurred during the script execution: Cannot invoke "org.openhab.core.model.rule.scoping.RulesClassCache.get(Object)" because "cache" is null in washingmachine
for seemingly unrelated items, the UI breaks (404) and I have to restart openhab completely.
What’s the right procedure to uninstall the official binding and switching to beta?