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

Openhab 4.0.0 #8

Open
memphissk opened this issue Feb 19, 2023 · 24 comments
Open

Openhab 4.0.0 #8

memphissk opened this issue Feb 19, 2023 · 24 comments

Comments

@memphissk
Copy link

Hello,
can you please recompile your package for Openhab version 4.0.0. It should be similar as 3.4.0, but in Thing bridge configuration i have next error
HANDLER_INITIALIZING_ERROR
'void org.openhab.core.library.types.DecimalType.(long)'

Thanks in advance

@blockbasti
Copy link

I've compile my own version for OH4 for now and it seems to work.

org.openhab.binding.sonoff-4.0.0-SNAPSHOT.zip

@memphissk
Copy link
Author

memphissk commented Mar 20, 2023

Installation looks fine, but i didn't find any "sonoff" category under installed bindings. Also when i want to add new thing, then i don't have "sonoff" binding offered as in previous version.
In "bundle:list" command i also see that bundle is active -->
"276 | Active │ 80 │ 4.0.0.202303172314 │ openHAB Add-ons :: Bundles :: sonoff Binding"
Do you have idea how to use it now please?

@blockbasti
Copy link

No sorry. I've had the binding setup before and with replacing the jar, it started working again. Haven't tried creating a new thing yet. I don't have the necessary knowledge or time to debug this issue.

@memphissk
Copy link
Author

So when i copied part of jsondb definition for thing, then i can list it in Things list. But it shows that it cannot connect to cloud, but only local, but then i am not able to contorl device via local LAN and still showw as offline in local mode. Do you use Cloud or local connection to your devices?

@blockbasti
Copy link

I just use local connections

@JacekKac
Copy link

i installed the binding and get HANDLER_INITIALIZING_ERROR
Index 2 out of bounds for length 2

2023-04-16 12:22:29.980 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'sonoff:account:b0f2e86997': Index 2 out of bounds for length 2
java.lang.IndexOutOfBoundsException: Index 2 out of bounds for length 2
at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) ~[?:?]
at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) ~[?:?]
at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266) ~[?:?]
at java.util.Objects.checkIndex(Objects.java:359) ~[?:?]
at java.util.ArrayList.get(ArrayList.java:427) ~[?:?]
at com.google.gson.JsonArray.get(JsonArray.java:204) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffDeviceState.setParameters(SonoffDeviceState.java:112) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffDeviceState.updateState(SonoffDeviceState.java:80) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffDeviceState.(SonoffDeviceState.java:64) ~[?:?]
at org.openhab.binding.sonoff.internal.SonoffCacheProvider.getStates(SonoffCacheProvider.java:157) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffAccountHandler.restoreStates(SonoffAccountHandler.java:296) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffAccountHandler.initialize(SonoffAccountHandler.java:100) ~[?:?]
at jdk.internal.reflect.GeneratedMethodAccessor25.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:147) ~[?:?]
at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]

@JacekKac
Copy link

I've compile my own version for OH4 for now and it seems to work.

org.openhab.binding.sonoff-4.0.0-SNAPSHOT.zip

can you help me with the compilation steps, i got

1/ git clones openhab-addons
2/ git clone sonoff binding respository
3/ Move it to bundles, included in bundles .pom

C:\Users\J\Documents\OPENHAB\openhab-addons>C:\Users\J\Downloads\apache-maven-3.9.2\bin\mvn clean install -pl :org.openhab.binding.sonoff
[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/org/openhab/addons/bundles/org.openhab.addons.reactor.bundles/3.2.0/org.openhab.addons.reactor.bundles-3.2.0.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.openhab.addons.bundles:org.openhab.binding.sonoff:3.2.0: The following artifacts could not be resolved: org.openhab.addons.bundles:org.openhab.addons.reactor.bundles:pom:3.2.0 (absent): Could not find artifact org.openhab.addons.bundles:org.openhab.addons.reactor.bundles:pom:3.2.0 in central (https://repo.maven.apache.org/maven2) and 'parent.relativePath' points at wrong local POM @ line 7, column 11
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.openhab.addons.bundles:org.openhab.binding.sonoff:3.2.0 (C:\Users\J\Documents\OPENHAB\openhab-addons\bundles\org.openhab.binding.sonoff\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.openhab.addons.bundles:org.openhab.binding.sonoff:3.2.0: The following artifacts could not be resolved: org.openhab.addons.bundles:org.openhab.addons.reactor.bundles:pom:3.2.0 (absent): Could not find artifact org.openhab.addons.bundles:org.openhab.addons.reactor.bundles:pom:3.2.0 in central (https://repo.maven.apache.org/maven2) and 'parent.relativePath' points at wrong local POM @ line 7, column 11 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

@proggprod
Copy link

I am having the same problem.

I can't see anything in the inbox or when trying to manually add things.
My previously working thing doesn't "wake up".

I do see a message in the logs "Sonoff Access Mode set to: local" but that is all

@FrancescoTalotta
Copy link

Cloud keys need to be updated: AlexxIT/SonoffLAN@4ae7ee2

@blockbasti could you recompile it with the new keys for OpenHAB 4?

@FrancescoTalotta
Copy link

I just tried the new release https://github.com/jgesser/openhab-3.x-sonoff/releases/tag/v4.4.0-SNAPSHOT on OH4 but I get this error: HANDLER_INITIALIZING_ERROR 'void org.openhab.core.library.types.DecimalType.<init>(long)' @jgesser any idea?

@JacekKac
Copy link

@FrancescoTalotta it is not for openhab 4.0

@jgesser
Copy link

jgesser commented Jul 28, 2023

@FrancescoTalotta , that release was compiled for OH 3.4.0. I am still running 3.4. But I will upgrade my environment to OH4 next week and then compile and test this addon. I hope no major change will be required and be able to release a 4.0 compatible binary.

@JacekKac
Copy link

btw may i ask somebody to check my error with 4.0 binary https://github.com/delid4ve/openhab-sonoff-compiled/files/11006939/org.openhab.binding.sonoff-4.0.0-SNAPSHOT.zip

`i installed the binding and get HANDLER_INITIALIZING_ERROR
Index 2 out of bounds for length 2

2023-04-16 12:22:29.980 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'sonoff:account:b0f2e86997': Index 2 out of bounds for length 2
java.lang.IndexOutOfBoundsException: Index 2 out of bounds for length 2
at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) ~[?:?]
at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) ~[?:?]
at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266) ~[?:?]
at java.util.Objects.checkIndex(Objects.java:359) ~[?:?]
at java.util.ArrayList.get(ArrayList.java:427) ~[?:?]`

@jgesser
Copy link

jgesser commented Jul 28, 2023

@FrancescoTalotta, I just released a binary for OH4 in my fork, please test and let me know if it is working as expected:
https://github.com/jgesser/openhab-3.x-sonoff/releases/tag/v4.0.0-SNAPSHOT

@JacekKac
Copy link

@jgesser working well on Version: 4.0.0 (Build)
thank you so much!

@FrancescoTalotta
Copy link

It works fine! Thank you very much!!

@josefsch15
Copy link

Yes, it's working fine, thank you for the great update!

@3volution91
Copy link

hi, there is a problem when trying to add new device. the bridge is missing from things.

@FrancescoTalotta
Copy link

Hello. This morning again I get this error Api Login Response:{"error":408,"msg":"appid has expired","data":null} in OH4. How to get new appid and appsecret keys?

@enrico-cc
Copy link

Same issue here

@jgesser
Copy link

jgesser commented Mar 28, 2024

appId and appSecret are externalized as configurations on the Thing in my fork. We only need to find a new pair that is working.
The one that is already there was taken from the Home Assistant extension for Sonoff devices.

@jgesser
Copy link

jgesser commented Mar 28, 2024

This one seems to be working:

appId="4s1FXKC9FaGfoqXhmXSJneb3qcm1gOak", appSecret="oKvCM06gvwkRbfetd6qWRrbC3rFrbIpV"

@FrancescoTalotta
Copy link

@jgesser Thank you very much, it works now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants