openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.58k forks source link

[shelly] Shelly1 temp addon senosr channels don't show up #11271

Closed uschreib closed 1 year ago

uschreib commented 2 years ago

Expected Behavior

With clean/new openhab 3.1.0 installation and Shelly binding adding thing shelly1 with temp addon the sensors für temp should be visible. The shelly1 with the temp addon is showing up in the original shelly app, so correct working.

Current Behavior

Only the standard channels (11) showing up in the openhab.

Possible Solution

Steps to Reproduce (for Bugs)

  1. Add a Shelly1 thing with temp addon installed

Context

Your Environment

markus7017 commented 2 years ago

this should work;: please enable DEBUG logging and post extract of device initialization

uschreib commented 2 years ago

I'm on vacation and after my return I'll provide the DEBUG logging. BR Uwe

Original Message processed by david® Re: [openhab/openhab-addons] [Shelly1] temp addon senosr channels don't show up (#11271) 5. Oktober 2021, 16:52 Uhr Von Markus Michels An openhab/openhab-addons Cc (2) uschreib|Author

this should work;: please enable DEBUG logging and post extract of device initialization — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

uschreib commented 2 years ago

Hi markus,

I'm back from vacation, did the debug and I thinik locate the "problem". I think we are talking about two different things. I do NOT use the AddOn to messure temperature. I use it as external switch for detecting, if me garage door is open or closed via a reed contact. This is configured in the shelly app via Settings/External Switch/Enable external switch add-on. Works fine in the applikation und shows, if garage door is open or closed.

In the binding there is "ext_sensors":null which is off course correct because it means temp sensors (I suggest). But in the binding although there are three parameters for "external_switch" which corrospond with my setting in the app. The relevant parameter is ext_switch":{"0":{"input":0}} resp. the input. This displays the state of the reed contact. See https://www.shelly-support.eu/forum/index.php?thread/7554-shelly1-add-on-mit-home-assistant-reed-switch-garagentor/

I do not see how this is implemented in the binding. Here the debug initialisation: Shelly1-Init.txt

Sorry for the confusion about the temp, but I thought it is the same interface as it is the same pins at the add-on board. Hope it is now a little bit more clear.

Best regards Uwe

xvs03 commented 2 years ago

Hello, I have the same problem with the openHAB Binding. The channel of the external reed contact is not displayed. The status appears in the http status requests of the Shelly. I also assume this is a bug because other sensors are displayed without any problems. It's a pity that no one else seems to have the problem. Some simply connect the reed contact to the button input, which is displayed as a channel. Personally, I don't find this a clean solution. Dear shelly binding developers, please get in touch.

markus7017 commented 2 years ago

I heard about this, but don't understand the details. #11970 seems to be the same, correct?

uschreib commented 2 years ago

Yes, the same...

xvs03 commented 2 years ago

This is the Shelly addon, which you can put on a Shelly 1 for example. Here you can connect up to three sensors. Temperature sensors or DS18B20 or a DHT22. But you can also connect only one reed contact. This contact is displayed by the Shelly app with a garage symbol, which represents the state.

https://shop.shelly.cloud/temperature-sensor-addon-for-shelly-1-1pm-wifi-smart-home-automation#315

https://www.openhab.org/addons/bindings/shelly/ Shelly 1(thing-type: shelly1) Extern Sensors:

  1. temperature1
  2. temperature2
  3. temperature3
  4. humidity

There is missing Reed Contact Status

This video (German) shows setup and processing of the signal in the app. Timecode: 10:00 https://www.youtube.com/watch?v=0q8pBCqb65w

If you still have questions. Feel free to contact

uschreib commented 2 years ago

Crosspost from markus7017 to get all details in one place / myfiles


I have connected a reed contact as external switch to a Shelly 1 Addon as sensor for position of a garage door. The external switch is reflected in the JSON output, but not in OH3

Full JSON Output (provided by Sven_S):

{"wifi_sta":{"connected":true,"ssid":"SECRET","ip":"192.168.xxx.xxx","rssi":-61},"cloud":{"enabled":true,"connected":true},"mqtt":{"connected":false},"time":"00:19","unixtime":1632781182,"serial":24,"has_update":false,"mac":"40F520XXXXXX","cfg_changed_cnt":0,"actions_stats":{"skipped":0},"ext_switch":{"0":{"input":0}},"relays":[{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"source":"timer"}],"meters":[{"power":0.00,"is_valid":true}],"inputs":[{"input":0,"event":"","event_cnt":0}],"ext_sensors":{},"ext_temperature":{},"ext_humidity":{},"update":{"status":"idle","has_update":false,"new_version":"20210909-144114/v1.11.4-DNSfix-ge6b2f6d","old_version":"20210909-144114/v1.11.4-DNSfix-ge6b2f6d"},"ram_total":50872,"ram_free":35536,"fs_size":233681,"fs_free":149596,"uptime":6431}

Relevant Detail:

Door closed (Switch open) => "ext_switch":{"0":{"input":0}} Door open (Switch closed) => "ext_switch":{"0":{"input":1}}

No function in OH3. Not showing up as relay or sensor.

xvs03 commented 2 years ago

Please have a look at this topic in the German openHab Forum. There different procedures are explained.

I know this is the way around the missing shelly binding channel, but it is not a shelly binding problem.

For me the open close of the garage door via HTTP binding in OH3 works fine. I think some detail doesn't fit for you yet. You can do it. https://openhabforum.de/viewtopic.php?t=6623

markus7017 commented 1 year ago

ok guys, let's get back. I now explored the featured and work on implementation @uschreib @xvs03 are you available for testing?

markus7017 commented 1 year ago

I updated the DEV build for OH 3.3 M3/M4 and added support for Shelly1's/Shelly1PM's external switch add-on (reed contact). Please verify (I can't test).

org.openhab.binding.shelly-3.4.0M3-SNAPSHOT.jar

HelgeT1 commented 1 year ago

Hi Markus,

testing it with a Shelly 1 which was connected without problems before (missing ext. contact channel per add on). Now with the Snapshot.jar mentioned above i get a "COMMUNICATION_ERROR Unerwarteter Fehler: API Timeout for" in the openhab Thing. Another Shelly, a 1L, which i run in my setup has no Problem.

Greetings Helge

HelgeT1 commented 1 year ago

Hi,

just wanted to add the Info, the same Problem appears with my 1PM with add on installed.

Greetings

markus7017 commented 1 year ago

please verify with the latest DEV build, there was an inconsistency with JSON format handling

jwsp1 commented 1 year ago

I ordered a Shelly Plus 1 PM with Plus AddOn but it will take 2-3 weeks until it arrives. Maybe @HelgeT1 can test it sooner?

anste commented 1 year ago

I'd like to test the build on OH3.4.2 but after copying the jar (3.4.2-SNAPSHOT or 3.4.3-SNAPSHOT) to the "addons" folder, openhab.log shows several errors (NullPointerException and IllegalArgumentException). Am I missing a something?

markus7017 commented 1 year ago

Did you checked READMEbeta?

markus7017 commented 1 year ago

@HelgeT1 @uschreib @anste @jwsp1 Did you tried the last 3.4.3 DEV build?

anste commented 1 year ago

I'm not familiar with beta-testing in openhab. I tried again, while following the steps from READMEbeta.md. After clearing the cache the binding is initialized correctly.

The Shelly 1 now has a humidity channel with value NULL. The addon is actually used as "external switch".

jwsp1 commented 1 year ago

Did you tried the last 3.4.3 DEV build?

I have ordered a Shelly Plus 1 PM with the Plus Addon (not the old non-plus version). After I activated the Addon in the official Shelly App and added the sensors in the official Shelly App as well, channels for the sensors were automatically created in openhab. I'm on OH 3.4.3 stable.

markus7017 commented 1 year ago

closed check latest DEV build https://community.openhab.org/t/shelly-binding/56862/3311