If value in Widget

It is a “String”

Then do this:

rule "Heating Valve changed"
when
    Item ebus_bai_5d51fcb4_08_bai_boiler_state-diverter-valve changed
then
    val valve = Integer::parseInt(ebus_bai_5d51fcb4_08_bai_boiler_state-diverter-valve.state.toString)
    if (valve == 0) HeatingValveSwitch.postUpdate(OFF)
    if (valve == 100) HeatingValveSwitch.postUpdate(ON)
end

Hmmm … So does not work.

rule "Heating Valve changed"
when
    Item ebus_bai_5d51fcb4_08_bai_boiler_state-diverter-valve changed
then
    logInfo("VALVE STATE", ebus_bai_5d51fcb4_08_bai_boiler_state-diverter-valve.state.toString)
    val valve = Integer::parseInt(ebus_bai_5d51fcb4_08_bai_boiler_state-diverter-valve.state.toString)
    if (valve == 0) HeatingValveSwitch.postUpdate(OFF)
    if (valve == 100) HeatingValveSwitch.postUpdate(ON)
end

What does the logs say?

openhab.log (654.3 KB)

Here’s the log

Ok, you can post the relevant logs in here:

2019-01-12 11:33:48.601 [vent.ItemStateChangedEvent] - Bathroom_ThermostatHumidity changed from 73.6 % to 73.7 %
2019-01-12 11:34:14.838 [vent.ItemStateChangedEvent] - OutsideHumidity changed from 87 % to 81 %
2019-01-12 11:34:41.050 [vent.ItemStateChangedEvent] - SmallBedroom_ThermostatHumidity changed from 63.1 % to 63.2 %
2019-01-12 11:35:40.252 [vent.ItemStateChangedEvent] - MasterBedroom_HotBlanket_RSSI changed from 34 to 36
2019-01-12 11:35:40.254 [GroupItemStateChangedEvent] - gRSSI changed from 48 to 49 through MasterBedroom_HotBlanket_RSSI
2019-01-12 11:36:01.497 [vent.ItemStateChangedEvent] - WindGustMph changed from 27.35 mph to 27.22 mph
2019-01-12 11:36:01.517 [vent.ItemStateChangedEvent] - AtmosphericPressure changed from 1022.61 mbar to 1022.58 mbar
2019-01-12 11:36:01.519 [vent.ItemStateChangedEvent] - WindSpeedMph changed from 14.15 mph to 14.45 mph

I need you to monitor the log for then the item ebus_bai_5d51fcb4_08_bai_boiler_state-diverter-valve changes
Then post the relevant logs openhab.log AND events.log

When the item changes you should see an INFO line in the openhab.log created by the logInfo command
That will tell us if the rule actually triggers

I’ve been running this for a while now.
There is no entry in the LOG.
The value has changed a few times.
I think he does not read the item.

Then it is the wrong item
You have a fundamental misunderstanding of the difference between things and items
To what item is the channel of that thing linked to?

Hello,

the event log says:
2019-01-13 12: 01: 06.804 [vent.ItemStateChangedEvent] - ebus_bai_5d51fcb4_08_bai_boiler_state_diverter_valve_state_diverter_valve changed from 100 to 0

So the address ebus_bai_5d51fcb4_08_bai_boiler_state_diverter_valve_state_diverter_valve is the ITEM?

There is nothing in the openhab log at the time.

YES!!!

the rule:

rule "Heating Valve changed"
when
    Item ebus_bai_5d51fcb4_08_bai_boiler_state_diverter_valve_state_diverter_valve changed
then
    logInfo("VALVE STATE", ebus_bai_5d51fcb4_08_bai_boiler_state_diverter_valve_state_diverter_valve.state.toString)
    val valve = Integer::parseInt(ebus_bai_5d51fcb4_08_bai_boiler_state_diverter_valve_state_diverter_valve.state.toString)
    if (valve == 0) HeatingValveSwitch.postUpdate(OFF)
    if (valve == 100) HeatingValveSwitch.postUpdate(ON)
end

Hey,

i thank you. It is running now. I have one more question.
The result is now ON or OFF. It is a switch object. Can I also have that as a text?
So ON = hot water and OFF = heating

Where? In HABpanel?

Yes in HABPanel

You need to use a MAP transformation:

The .item:

Switch HeatingValveSwitch "Heating [MAP(heating.map):%s]"

and in sitemaps/heating.map

ON=Warmwasser
OFF=Heizung
-=-
undefined=-
uninitialized=-
NULL=-

?

Your still not using code fences
This is important

Yes that should work

I’m sorry about it. This is my first article in the forum. Unfortunately there is still ON or OFF in the widget.

Change widget and use a button widget

The result is still ON or OFF

Then change the settings of the widget…
Play with it a bit, you can’t break anything, experiment, try stuff
With all the information you have now you should be able to figure it out by yourself