Had the same problem.
The secret token has changed.
Go to the code tab of the rule and find and replace the line with “var X_SECRET=” to:
var X_SECRET = "8eTFgy3AQH0mzAcj3xMwaKnNyNnijEFIEegjgNpBHifqtQ4IEyWqmJGFz3ggKQ7B4vwUYS8xz8KwACZihCmboGb6brtVB3rpne2Ww5uUM2n3i4SKNUg6Vp7lhAS8INDUNH8Ll7WPhWRsQOXBCjVz5H8fr0q6fqZCosXdndbNeiNy73FqJBn794qKuUAPTFj8CuAbwI6Wom98g72Px1MPRYHwyrlHUbCijmDmA2zoWikn34LNTUZPd7kS0uuFkibkLxCc1PeOVYVHeh1xVxxwGBsMINWJEUiIBqZt9VybcHpUJTYzureqfund1aeJvmsUjwyOMhLSxj9MLQ07iTbvzQa6vbJdC0hTsqTlndccBRm9lkxzNpzJBPw8VpYSyS3AhaR2U1n4COZaJyFfUQ3LUBzdj5gV8QGVGCHMlvGJM0ThnRKENSWZLVZoHHeCBOkfgzp0xl0qnDtR8eJF0vLkFiKwjX7DImGoA8IjqOYygV3W9i9rIOfK";
here is some more info how to find the new secret if it should change:
Works for me. I hope it also does work for you.
@Mherwege maybe you can update the template with this new secret?
When checking the new token, I also noticed they use a new/other URL.
Old one is still working but it might fail in the future. current URL used by binding/script : https://recycleapp.be/api/app/v1 new URL used by the website : https://api.fostplus.be
One is a redirection to the other I think. Something to take into account. When having time, I need to update my binding as well.
Seems that we (East-Flandres?) need “restafval” in the residual_waste list to have it working. Bit weird that they have so many terms for it. Seems to be a garbage bin of garbages…
Any plans to make it available for OH4? Seems it spits out an error as we speak
2023-04-26 12:50:52.189 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID '07f5211181' failed: org.graalvm.polyglot.PolyglotException: TypeError: invokeMember (now) on java.time.ZonedDateTime failed due to: Unknown identifier: now
I added “restafval” in the template. I also live in East-Flanders, and there is no issue for me. I believe it depends on the “intercommunale”. As soon as there is a slight difference from the standard in the definition of the allowed content of the fraction, the “intercommunale” creates a new name for the fraction.
The template still works in OH4 if you install the Nashorn extension. It may work with OH4 javascript (without Nashorn, but with graalVM) after the fix I just applied, but I did not test. I am still running 3.4 in my main instance, so did not switch yet. I intend to do so closer to the OH4 release date when I make the switch myself.
I need to copy/paste from 2 installation since I can’t find the rule template in OH4. But if I did it correct, I’m getting now following error:
Script execution of rule with UID '07f5211181' failed: java.lang.NullPointerException: Cannot invoke "java.time.temporal.TemporalUnit.addTo(java.time.temporal.Temporal, long)" because "unit" is null
I just tried with an OH4 snapshot and Nashorn js installed. It runs fine.
Check out line 66 in the script. That’s where I have made the change. It should be:
Guess something is wrong in my system, but not sure where. Everything else seems to be working fine. Can I add extra debugs to the logs?
Just did an upgrade towards 4.0.0.M2, but no luck
When I check the installed bundles, I see I have 2 JavaScript Scripting? Not sure why. But no difference with 1 installed, the other or both. Always the same error.
openhab> bundle:list | grep ava
37 │ Active │ 80 │ 30.1.0.jre │ Guava: Google Core Libraries for Java
38 │ Active │ 80 │ 1.0.1 │ Guava InternalFutureFailureAccess and InternalFutures
54 │ Active │ 80 │ 1.2 │ javax.annotation API
88 │ Active │ 80 │ 1.0.0.2 │ Apache ServiceMix :: Bundles :: javax.inject
234 │ Active │ 80 │ 2.1.0 │ Units of Measurement Common Library for Java
240 │ Active │ 80 │ 1.6.2 │ JavaMail API
253 │ Active │ 80 │ 2.2.19 │ rxjava
256 │ Active │ 80 │ 20180813.0.0 │ JSON in Java
257 │ Active │ 80 │ 0.3.0.v20220506-1020 │ EdDSA-Java
258 │ Active │ 80 │ 5.2.1.OH1 │ nrjavaserial
266 │ Active │ 80 │ 2.1.2 │ Java Concurrency Tools Core Library
268 │ Active │ 80 │ 4.0.0.M2 │ openHAB Add-ons :: Bundles :: Automation :: JavaScript Scripting (Nashorn)
323 │ Active │ 80 │ 4.0.0.M2 │ openHAB Add-ons :: Bundles :: Automation :: JavaScript Scripting
You installes both the old javascript addon (nashorn) and the new one (using graalvm). It is likely the code is run using the newer one. I did not test that, so that’s likely the problem. I will look into it when I move to OH4.
@lvdh
“huisvuil diftar” and “gft-diftar” should already work (“huisvuil” and “gft” are in the search strings and it looks for substrings.
Do you have an example output where “snoeihout” and/or “grofvuil” are used? I can then add them.