How to get Item Tempearture in DSL Rule

Einrichtung der openHAB Umgebung und allgemeine Konfigurationsthemen.

Moderatoren: seppy, udo1toni

Antworten
eaglesky
Beiträge: 7
Registriert: 29. Nov 2023 19:08
Answers: 0

How to get Item Tempearture in DSL Rule

Beitrag von eaglesky »

Im using simple Rules with some DSL Code and want to avoid to use javascript.

In order to change an item commands are used commands like this:
Bibliothek_Solltemperatur.sendCommand("20");

How can I read the values. Im Looking for something like
Bibliothek_Solltemperatur.getvalue();

But can't find it. Do you have an idea?

nw378
Beiträge: 296
Registriert: 22. Sep 2018 10:38
Answers: 5

Re: How to get Item Tempearture in DSL Rule

Beitrag von nw378 »

Code: Alles auswählen

Bibliothek_Solltemperatur.state
Je nachdem, was du damit machen willst, aber auch:

Code: Alles auswählen

(Bibliothek_Solltemperatur.state as Number).floatValue
Damit hast du eine Kommazahl, die du z. B. mit < oder > mit einem Wert vergleichen kannst.

By the way: you‘re allowed to use German language as this is the German community 😉
openHAB 4.3.3 @ RPi 4 / SSD - InfluxDB2 und Grafana @ Synology Docker - KNX

Antworten