Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[shelly] Addon channels not discovered when in cover mode with Shelly Plus 2PM #14 #16724

Closed
aenotiad opened this issue May 7, 2024 · 8 comments · Fixed by #16746
Closed
Assignees
Labels
enhancement An enhancement or new feature for an existing add-on PR pending There is a pull request for resolving the issue

Comments

@aenotiad
Copy link

aenotiad commented May 7, 2024

Moving this from Markus' repo to here

Openhab 4.0.3 stable as openhabian on Pi 4B
Shelly binding installed from UI
Shelly plus 2pm version 1.0.3 with sensor add-on and DS18B20
When discovering the Shelly and adding it to the things DB the temperature sensor in the add-on is added as a channel only if the Shelly is in switch mode. If in cover mode then the Shelly reports the add-on during the thing add process but the channel never gets created.

[Edit] - Tested on 4.2.0 snapshot #4072 with similar results

Relevant messages when in switch mode
2023-09-24 19:36:20.445 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplus2pm-c049ef8b2474: Shelly Add-On detected with at least 1 external sensor 2023-09-24 19:36:22.667 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplus2pm-c049ef8b2474: NotifyStatus update received: {"id":1719399656,"src":"shellyplus2pm-c049ef8b2474","dst":"shellyplus2pm-c049ef8b2474","params":{"ble":null,"cloud":{"connected":false},"mqtt":{"connected":false},"sys":{"mac":"C049EF8B2474","restart_required":false,"time":"19:36","unixtime":1695573382,"uptime":86,"ram_size":257964,"ram_free":112932,"fs_size":458752,"fs_free":143360,"cfg_rev":10,"available_updates":null,"webhook_rev":2},"wifi":{"sta_ip":"192.168.10.230","status":"got ip","ssid":"HomeAuto","rssi":-46},"input:0":{"id":0,"state":false},"input:1":{"id":1,"state":false},"switch:0":{"id":0,"source":"init","output":false,"apower":0.0,"voltage":227.6,"current":0.0,"pf":0.0,"aenergy":{"total":0.0,"by_minute":[0.0,0.0,0.0],"minute_ts":1695573380},"temperature":{"tC":67.0,"tF":152.6}},"switch:1":{"id":1,"source":"init","output":false,"apower":0.0,"voltage":227.7,"current":0.0,"pf":0.0,"aenergy":{"total":0.0,"by_minute":[0.0,0.0,0.0],"minute_ts":1695573380},"temperature":{"tC":67.0,"tF":152.6}},"temperature:100":{"id":100,"tC":32.8,"tF":91.1}},"result":{"ble":{},"cloud":{"connected":false},"mqtt":{"connected":false},"sys":{"mac":"C049EF8B2474","restart_required":false,"time":"19:36","unixtime":1695573382,"uptime":86,"ram_size":257964,"ram_free":112932,"fs_size":458752,"fs_free":143360,"cfg_rev":10,"available_updates":{},"webhook_rev":2},"wifi":{"sta_ip":"192.168.10.230","status":"got ip","ssid":"HomeAuto","rssi":-46},"input:0":{"id":0,"state":false},"input:1":{"id":1,"state":false},"switch:0":{"id":0,"source":"init","output":false,"apower":0.0,"voltage":227.6,"current":0.0,"pf":0.0,"aenergy":{"total":0.0,"by_minute":[0.0,0.0,0.0],"minute_ts":1695573380},"temperature":{"tC":67.0,"tF":152.6}},"switch:1":{"id":1,"source":"init","output":false,"apower":0.0,"voltage":227.7,"current":0.0,"pf":0.0,"aenergy":{"total":0.0,"by_minute":[0.0,0.0,0.0],"minute_ts":1695573380},"temperature":{"tC":67.0,"tF":152.6}},"temperature:100":{"id":100,"tC":32.8,"tF":91.1}}} 2023-09-24 19:36:22.697 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplus2pm-c049ef8b2474: Adding channel sensors#temperature1

Relevant messages when in cover mode

2023-09-24 19:43:58.649 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplus2pm-c049ef8b2474: Shelly Add-On detected with at least 1 external sensor 2023-09-24 19:44:00.890 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplus2pm-c049ef8b2474: NotifyStatus update received: {"id":212392860,"src":"shellyplus2pm-c049ef8b2474","dst":"shellyplus2pm-c049ef8b2474","params":{"ble":null,"cloud":{"connected":false},"mqtt":{"connected":false},"sys":{"mac":"C049EF8B2474","restart_required":false,"time":"19:44","unixtime":1695573840,"uptime":43,"ram_size":257688,"ram_free":109772,"fs_size":458752,"fs_free":143360,"cfg_rev":11,"available_updates":null,"webhook_rev":3},"wifi":{"sta_ip":"192.168.10.230","status":"got ip","ssid":"HomeAuto","rssi":-42},"input:0":{"id":0,"state":false},"input:1":{"id":1,"state":false},"cover:0":{"id":0,"source":"init","state":"stopped","apower":0.0,"voltage":226.6,"current":0.0,"pf":0.0,"aenergy":{"total":0.0,"by_minute":[0.0,0.0,0.0],"minute_ts":1695573840},"pos_control":false,"temperature":{"tC":66.9,"tF":152.5}},"temperature:100":{"id":100,"tC":32.8,"tF":91.1}},"result":{"ble":{},"cloud":{"connected":false},"mqtt":{"connected":false},"sys":{"mac":"C049EF8B2474","restart_required":false,"time":"19:44","unixtime":1695573840,"uptime":43,"ram_size":257688,"ram_free":109772,"fs_size":458752,"fs_free":143360,"cfg_rev":11,"available_updates":{},"webhook_rev":3},"wifi":{"sta_ip":"192.168.10.230","status":"got ip","ssid":"HomeAuto","rssi":-42},"input:0":{"id":0,"state":false},"input:1":{"id":1,"state":false},"cover:0":{"id":0,"source":"init","state":"stopped","apower":0.0,"voltage":226.6,"current":0.0,"pf":0.0,"aenergy":{"total":0.0,"by_minute":[0.0,0.0,0.0],"minute_ts":1695573840},"pos_control":false,"temperature":{"tC":66.9,"tF":152.5}},"temperature:100":{"id":100,"tC":32.8,"tF":91.1}}}

@aenotiad aenotiad added the enhancement An enhancement or new feature for an existing add-on label May 7, 2024
@lsiepel
Copy link
Contributor

lsiepel commented May 7, 2024

As you are using 4.0.3 a double check, this is not allready fixed?
See PR's since then:
https://github.com/openhab/openhab-addons/pulls?q=is%3Apr+shelly+created%3A%3E2023-11-01+is%3Amerged

@aenotiad
Copy link
Author

aenotiad commented May 8, 2024

I did - and it was not there :)
I also tested on the latest snapshot 4.2.0 build #4072 just in case :) and while there is a change in the channels reported the temperature channel added is the 'internal temperature' one rather than the addon

@aenotiad aenotiad changed the title [Shelly] Addon channels not discovered when in cover mode with Shelly Plus 2PM #14 [shelly] Addon channels not discovered when in cover mode with Shelly Plus 2PM #14 May 9, 2024
@markus7017
Copy link
Contributor

please try latest DEV build, logic has been added in roller mode and report result
https://github.com/markus7017/myfiles/blob/master/shelly/org.openhab.binding.shelly-4.2.0-SNAPSHOT.jar?raw=true

@markus7017 markus7017 self-assigned this May 11, 2024
@markus7017 markus7017 added the awaiting feedback Awaiting feedback from the pull request author label May 11, 2024
markus7017 added a commit to markus7017/openhab-addons that referenced this issue May 11, 2024
…e with

Shelly Plus 2PM

Signed-off-by: Markus Michels <markus7017@gmail.com>
@aenotiad
Copy link
Author

aenotiad commented May 12, 2024

Channel now gets discovered and added as 'Outdoor Temperature' but does not seem to get updates when the temperature changes in the Shelly device.

Notification is sent by the Shelly device :

2024-05-12 14:06:23.719 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplus2pm-c049ef8b2474: NotifyStatus update received: {"id":1519201963,"src":"shellyplus2pm-c049ef8b2474","dst":"shellyplus2pm-c049ef8b2474","params":{"ble":{},"cloud":{"connected":false},"mqtt":{"connected":true},"sys":{"mac":"C049EF8B2474","restart_required":false,"time":"14:06","unixtime":1715511983,"uptime":872771,"ram_size":257664,"ram_free":116748,"fs_size":458752,"fs_free":143360,"cfg_rev":23,"available_updates":{"stable":{"version":"1.3.1"}},"webhook_rev":3},"wifi":{"sta_ip":"192.168.10.230","status":"got ip","ssid":"HomeAuto","rssi":-47},"input:0":{"id":0},"input:1":{"id":1},"cover:0":{"id":0,"source":"limit_switch","state":"open","apower":0.0,"voltage":226.1,"current":0.0,"pf":0.0,"aenergy":{"total":35.869,"by_minute":[0.0,0.0,0.0],"minute_ts":1715511983},"current_pos":100,"pos_control":true,"temperature":{"tC":59.7,"tF":139.4}},"temperature:100":{"id":100,"tC":30.8,"tF":87.5}},"result":{"ble":{},"cloud":{"connected":false},"mqtt":{"connected":true},"sys":{"mac":"C049EF8B2474","restart_required":false,"time":"14:06","unixtime":1715511983,"uptime":872771,"ram_size":257664,"ram_free":116748,"fs_size":458752,"fs_free":143360,"cfg_rev":23,"available_updates":{"stable":{"version":"1.3.1"}},"webhook_rev":3},"wifi":{"sta_ip":"192.168.10.230","status":"got ip","ssid":"HomeAuto","rssi":-47},"input:0":{"id":0},"input:1":{"id":1},"cover:0":{"id":0,"source":"limit_switch","state":"open","apower":0.0,"voltage":226.1,"current":0.0,"pf":0.0,"aenergy":{"total":35.869,"by_minute":[0.0,0.0,0.0],"minute_ts":1715511983},"current_pos":100,"pos_control":true,"temperature":{"tC":59.7,"tF":139.4}},"temperature:100":{"id":100,"tC":30.8,"tF":87.5}}}

Running the supplied jar in 4.2.0 build #4077

@aenotiad
Copy link
Author

Did another test on another device that has a DHT-22 sensor and the binding does discover both channels - Temperature and Humidity - but still does not update them.
lmk if I can help in any better way

@markus7017
Copy link
Contributor

please try the updated build

@aenotiad
Copy link
Author

aenotiad commented May 13, 2024

Seems to work! Both the DS sensor from one add-on and the DHT-22 from another one get discovered properly and reported properly.
Also did some more through testing adding one of all the types of Shelly devices I have in my network ie
2pm
dimmer2
2.5 switch

with all their main channels and they seem to work all fine :)

Thanks!

I assume this will roll into the 4.2 release when out?

@markus7017
Copy link
Contributor

thanks for feedback !

@markus7017 markus7017 added PR pending There is a pull request for resolving the issue and removed awaiting feedback Awaiting feedback from the pull request author labels May 24, 2024
markus7017 added a commit to markus7017/openhab-addons that referenced this issue May 24, 2024
Signed-off-by: Markus Michels <markus7017@gmail.com>
markus7017 added a commit to markus7017/openhab-addons that referenced this issue Jun 21, 2024
…e with

Shelly Plus 2PM

Signed-off-by: Markus Michels <markus7017@gmail.com>
markus7017 added a commit to markus7017/openhab-addons that referenced this issue Jun 21, 2024
Signed-off-by: Markus Michels <markus7017@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on PR pending There is a pull request for resolving the issue
Projects
None yet
3 participants