BoBiene / Wolf-Smartset-to-openhab

Wolf Smartset Cloud-Connection for openhab
MIT License
2 stars 0 forks source link

Running this on Openhab 3.0.2 #8

Closed alxy closed 2 years ago

alxy commented 3 years ago

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:

2021-04-25 19:00:18.163 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'wolf_smartset.items'
2021-04-25 19:00:39.584 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'wolf_smartset.rules'
2021-04-25 19:04:52.540 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'wolf_smartset.rules', using it anyway:
The field Tmp_wolf_smartsetRules.tokenTime refers to the missing type Object
The field Tmp_wolf_smartsetRules.tokenTime refers to the missing type Object
2021-04-25 19:08:22.168 [WARN ] [e.runtime.internal.RuleContextHelper] - Variable 'tokenTime' on rule file 'wolf_smartset.rules' cannot be initialized with value 'org.eclipse.xtext.xbase.impl.XConstructorCallImplCustom@1c81e46 (invalidFeatureIssueCode: null, validFeature: false, explicitConstructorCall: true, anonymousClassConstructorCall: false)': An error occurred during the script execution: null
2021-04-25 19:08:22.359 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'wolf_smartset-1' failed: Unknown variable or command '<'; line 9, column 8, length 29 in wolf_smartset
2021-04-25 19:08:22.478 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'wolf_smartset-1' failed: Unknown variable or command '<'; line 9, column 8, length 29 in wolf_smartset
2021-04-25 19:08:22.544 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'wolf_smartset-1' failed: Unknown variable or command '<'; line 9, column 8, length 29 in wolf_smartset

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?

BoBiene commented 3 years ago

@alxy that's correct currently only OH 2.5.x is supported.

alxy commented 3 years ago

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?

BoBiene commented 3 years ago

@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.

alxy commented 3 years ago

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.

Hope these tips help someone :)

BoBiene commented 3 years ago

@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

BoBiene commented 2 years ago

Binding is Completed, please see https://next.openhab.org/addons/bindings/wolfsmartset/