Closed alxy closed 2 years ago
@alxy that's correct currently only OH 2.5.x is supported.
Ok, I'll try to look into it and see how difficult it is to make it work with v3. Do you have any good hints to start with, especially on how to test the code. So far I've just modified thje generated rules file and re-uploaded it to the openhab server and watched the logs for any errors. Is that the way to go?
@alxy the intention is to implement the auth part in the http binding to get rid of the rules and scripting.
If you like you can support this https://github.com/openhab/openhab-addons/pull/9816 as i'm a bit out of time at the moment.
Ok, I was able to make that run on OH 3.0 with some modifications. Trying to give a short summary here for anyone interested in doing the modifications: Basically, mainly the wolf_smartset.rules
file needs to be edited as the syntax for rules changed a bit between the versions.
tokenTime
to var ZonedDateTime tokenTime = ZonedDateTime.parse("1970-01-01T00:00:00.000Z").withZoneSameInstant(ZoneId.systemDefault())
if(tokenTime.isBefore(now.plusHours(-1)))
executeCommandLine
changed. The new syntax looks like this: executeCommandLine(Duration.ofSeconds(5), "/etc/openhab/scripts/request_config.sh", token, "21309", "27781");
. Note that there are quite a few calls to the function in the generated rules file. All need to be replaced. The old token @@
isn't valid anymore, all arguments to the script must be passed as comma-separated arguments to the function itself.Hope these tips help someone :)
@alxy i have started a new binding for wolf smartset, if you like you can try this out: https://github.com/openhab/openhab-addons/pull/10751
Binding is Completed, please see https://next.openhab.org/addons/bindings/wolfsmartset/
Hi,
first of all thanks for the cool tool that I just wanted to try with our new heating system and Openhab. Unfortunately, it seems there has been a new major version of Openhab since this tool has been created.
When loading the generated files in the openhab configuration folder I get some new items created (so this seems to work), however, I get the following errors when it tried to parse/apply the rules:
By any chance, do you know how to resolve this? I have no prior experience with Openhab so its pretty hard for me to tell where the error in the end comes from, but I expect the syntax for the rules has changed a bit between the versions?