Seite 1 von 1

How to get Item Tempearture in DSL Rule

Verfasst: 1. Dez 2023 18:22
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?

Re: How to get Item Tempearture in DSL Rule

Verfasst: 1. Dez 2023 18:30
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 😉