I‘m making good progress already covering most of the features for Shelly1/2/2.5, @hmerk will add the HT., 1PM should work if 1 is dine.
Who could do some testing for the other device types?
I‘m making good progress already covering most of the features for Shelly1/2/2.5, @hmerk will add the HT., 1PM should work if 1 is dine.
Who could do some testing for the other device types?
I’ll be happy to test when possible.
/t
sounds good, which devices do you have?
I can also help with testing. After I have set up the development environment I can also help with debugging especially for devices that you can’t test.
I have got the following devices:
good to know
I checked in my current status, it’s work in progress, just as a snapshot for debugging purposes! Do not use this status when you expect a working binding.
Still 2 issues on the list I need to fix before I could share an alpha release:
Support for the Shelly relays and rollers is almost done. There are some more attributes, which might be useful, but those could be added at a later stage.
Support for Plug/PlugS and the Bulb should be easy to integrate. The json structures are usually the same across devices. I want to have explicit handling for each device type so we could also utilize additional/new features.
Shelly Sense is very specific and requires a lot of typing. In addition I need to understand how it works = what is required to support it in a proper way (there are tons of config options).
In general I have to say that the documentation is useful, but not bugfree and sometimes incomplete (e.g. the event urls are not described, I found them while debugging the return JSON).
@MHerbst Maybe you could contribute the GSON mapping for the Sense (internal.api/ShellyApiJSon.java).
Please make sure to send the log level to TRACE. Especially the startup sequence to unsupported devices are interesting. Please post the log here or send me a PM.
http authentication is not yet support, so you need to turn that off for now
One note: Shelly does NOT encrypt or hash the http user credentials in the return JSON so you may want to remove them before posting a log. For me this is a security issues, which should be changed by Shell.
I added a first .jar build to the repo - this is work in progress - just as a snapshot for debugging purposes! Do not use this status when you expect a working binding.
https://github.com/markus7017/org.openhab.binding.shelly/blob/alpha1-wip/target/org.openhab.binding.shelly-2.4.0-SNAPSHOT.jar
Please make sure to send the log level to TRACE. Especially the startup sequence to unsupported devices are interesting. Please post the log here or send me a PM.
http authentication is not yet support, so you need to turn that off for now
One note: Shelly does NOT encrypt or hash the http user credentials in the return JSON so you may want to remove them before posting a log. For me this is a security issues, which should be changed by Shell.
I have a couple of shelly 1 V.3 lying around doing nothing at the moment.
/t
Here are my first test results: I have copied the jar file to the addons folder of my openHAB 2.4 installation. The binding did not load because it was missing the Californium bundle. So I installed the Tradfri binding which also uses this bundle.
Auto discovery did not find any of my devices.
I will send you the trace as PM.
Unfortunately I don’t have a running development environment for openHAB 2.4 resp. a Tycho-based environment. I will install the latest development environment and try to convert the structure of the add-in to the new bndtools-based environment.
That’s correct, the Tradfri binding brings californium so no need to install the dependencies manually. I’ll find out, which components to install (feature:install) and add that to the readme.
“Auto discovery did not find any of my devices”. The binding uses mDNS, did you tried a runtime environment or IDE? I had/have the same problem in the IDE whereas it found the devices in the runtime environment on the same system.
I’ll stay on 2.4 as long as I have the feeling that 2.5 is stable. So also my dev & test environment is 2.4.
I added detection of shellyplug and shellyplug-s and avoid an Exception when a json config parameter is not available.
https://github.com/markus7017/org.openhab.binding.shelly/blob/alpha1-wip/target/org.openhab.binding.shelly-2.4.0-SNAPSHOT.jar
Running a manual scan also helps when the device is not discoverd or a restart in the IDE.
@MHerbst please try again
The feature that has to be installed on the OH console is openhab-transport-coa
feature:install openhab-transport-coap
this makes installation of the Tradfri binding obsolete
Doing a
mvn clean install karaf:kar
should build a kar file with the needed dependencies. That kar file can be copied into addons folder.
I checked in a new build (alpha1)
https://github.com/markus7017/org.openhab.binding.shelly/blob/alpha1-wip/target/org.openhab.binding.shelly-2.4.0-SNAPSHOT.jar
Changes:
This is the first build, which provides regular functions
Please make sure to delete ALL things before installing the new version (thing definitions have changed). If the things get not discovery immediately be patient, wait some time and retry a manual scan - this might have to be done several times.
Next build will be alpha2 (please make sure to use the current release in the repo / correct download link)
alpha2 is online
https://github.com/markus7017/org.openhab.binding.shelly/blob/alpha2/target/org.openhab.binding.shelly-2.4.0-SNAPSHOT.jar
Shelly HT, Shelly Bulb, Shelly Smoke are not verified - please help testing. @MHerbst
Does someone has a Shelly Smoke. The documentation seems to be incorrect, it includes only temperature sensor data, but no smoke alarm. I expect a smoke sensor to report a smoke alarm.
I have performed the first tests (alpha1) with a Shelly Plug S.
The discovery did not work:
2019-07-15 20:13:22.068 [WARN ] [discovery.ShellyDiscoveryParticipant] - Discovered Shelly device doesn't have an IP address: [ServiceInfoImpl@10810566 name: 'shellyplug-s-376D1F._http._tcp.local.' address: '(null):0' status: 'DNS: JmDNS-/192.168.2.80 [/192.168.2.80] state: probing 1 task: null', has NO data
shellyplug-s-376D1F._http._tcp.local.: ]
2019-07-15 20:13:22.080 [INFO ] [discovery.ShellyDiscoveryParticipant] - Shelly device discovered: IP-Adress=192.168.2.73, name=shellyplug-s-376d1f
2019-07-15 20:13:22.266 [DEBUG] [helly.internal.handler.ShellyHandler] - Shelly settings info : {"device":{"type":"SHPLG-S","mac":"CC50E3376D1F","hostname":"shellyplug-s-376D1F","num_outputs":1,"num_meters":1},"wifi_ap":{"enabled":false,"ssid":"shellyplug-s-376D1F","key":""},"wifi_sta":{"enabled":true,"ssid":"Ankh-Morpork","ipv4_method":"static","ip":"192.168.2.73","gw":"192.168.2.1","mask":"255.255.255.0","dns":"192.168.2.1"},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"mqtt": {"enable":false,"server":"192.168.33.3:1883","user":"","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"will_topic":"shellies/shellyplug-s-376D1F/online","will_message":"false","max_qos":0,"retain":false,"update_period":30},"sntp": {"server":"time.google.com"},"login":{"enabled":false,"unprotected":false,"username":"xxxx","password":"xxxx"},"pin_code":"xxx","coiot_execute_enable":true,"name":"","fw":"20190711-084501/v1.5.0-hotfix4@3b4f7414","build_info":{"build_id":"20190711-084501/v1.5.0-hotfix4@3b4f7414","build_timestamp":"2019-07-11T08:45:01Z","build_version":"1.0"},"cloud":{"enabled":true,"connected":true},"timezone":"Europe/Berlin","lat":50.110901,"lng":8.682130,"tzautodetect":true,"time":"20:13","hwinfo":{"hw_revision":"prod-190325-test","batch_id":1},"max_power":2500,"led_status_disable":true,"led_power_disable":false,"relays":[{"ison":true,"has_timer":false,"overpower":false,"default_state":"off","auto_on":0.00,"auto_off":0.00,"btn_on_url":null,"out_on_url":null,"out_off_url":null,"schedule":true,"schedule_rules":["1730-0123-on","2350-0123456-off","0800-456-on"]}],"meters":[{"power":3.68,"is_valid":true,"timestamp":1563221602,"counters":[3.690, 3.693, 3.677],"total":11145}]}
2019-07-15 20:13:22.296 [ERROR] [discovery.ShellyDiscoveryParticipant] - Device discovery failed: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1550 path $.relays[0].schedule_rules[0]
2019-07-15 20:13:23.912 [WARN ] [discovery.ShellyDiscoveryParticipant] - Discovered Shelly device doesn't have an IP address: [ServiceInfoImpl@6255384 name: 'shellyplug-s-376E9E._http._tcp.local.' address: '(null):0' status: 'DNS: JmDNS-/192.168.2.80 [/192.168.2.80] state: probing 1 task: null', has NO data
shellyplug-s-376E9E._http._tcp.local.: ]
Adding the device manually worked.
I have create one switch item for power on and off and another number item to display the current watts.
Switching the plug on and off works. The display of the power does not work (shows only “NaN”). This is the trace output:
Shelly status info : {"wifi_sta":{"connected":true,"ssid":"Ankh-Morpork","ip":"192.168.2.72","rssi":-49},"cloud":{"enabled":true,"connected":true},"mqtt":{"connected":false},"time":"20:03","serial":1627,"has_update":false,"mac":"CC50E3376EAF","relays":[{"ison":true,"has_timer":false,"overpower":false}],"meters":[{"power":5.50,"is_valid":true,"timestamp":1563221014,"counters":[5.384, 6.031, 6.089],"total":8076}],"temperature":31.71,"overtemperature":false,"update":{"status":"idle","has_update":false,"new_version":"20190711-084501/v1.5.0-hotfix4@3b4f7414","old_version":"20190711-084501/v1.5.0-hotfix4@3b4f7414"},"ram_total":50832,"ram_free":37512,"fs_size":233681,"fs_free":176202,"uptime":336312}
Will now install alpha2.
I have installed alpha2:
Discovery results have not been changed (same error message):
After adding the Bulb manually, I got this error message:
Cannot create thing. No binding found that supports creating a thing of type 'shelly:shellybulb-white'.
With “Shelly Bulb Color” I got the same result.
Shelly Plug S can be switched on and off (display of Watt and also Max Power) don’t work:
I have several shelly 2.5 in rollershutter mode, a couple of HT sensor and some shelly Plug S.
I would like to help testing because I’d really loved to have a binding for shellies but I don’t have a test environment…is it safe to install it in my prod. env.? (openhab 2.4 installed from repository on a rasberry 3b+) or could it break openhab?
Is there something I could do to be helpful?
@MHerbst I fixed the thing type handling for bulb - two types for color and white
@alexxio that should not be a problem even you have the mqtt items running (same with me, works in parallel).
Please note: Currently the binding polls every 15s the devices. I’m working on a more intelligent event driven approach, but still have an initialization problem to catch the events. I’m not sure how the HT and Smoke react, I suppose that the http call fails when they are in sleep mode, but this is also interesting to see.