openhab / openhab-vscode

VS Code extension for openHAB configuration files
https://marketplace.visualstudio.com/items?itemName=openhab.openhab
Eclipse Public License 2.0
159 stars 47 forks source link

vscode extension shows error wrongly with temperature variable in rules #320

Open Spiev opened 1 year ago

Spiev commented 1 year ago

Good morning everyone!

I use a "virtual" temperature item to set a target temperature with the type "number:temperature". In the rules I use this item to compare the "target" with the "current" temperature. If target is higher, I switch on the powerplug of the electric heater.

The current temperature comes from an LoraWan device. The powerplug is an zigbee device from ikea.

Everything works fine. Except that vscode extension shows me an error. In my unterstanding, this is wrong. vscode extension error: [{ "resource": "/c:/repo/openHAB/rules/noahheater.rules", "owner": "_generated_diagnostic_collectionname#0", "code": "org.eclipse.xtext.xbase.validation.IssueCodes.incompatible_types", "severity": 8, "message": "Type mismatch: cannot convert from State to Number", "startLineNumber": 7, "startColumn": 32, "endLineNumber": 7, "endColumn": 50 }]

image image image image

Here the technical informations from my system, which runs on a Raspberry Pi 3 Model B Plus Rev 1.3.

runtimeInfo: version: 3.4.2 buildString: Release Build locale: de-DE systemInfo: configFolder: /etc/openhab userdataFolder: /var/lib/openhab logFolder: /var/log/openhab javaVersion: 11.0.18 javaVendor: Raspbian osName: Linux osVersion: 5.15.84-v7+ osArchitecture: arm availableProcessors: 4 freeMemory: 132686304 totalMemory: 300888064 startLevel: 100 bindings: