If value in Widget

habpanel
Tags: #<Tag:0x00007fe057341720>

(Marcus) #17

It is a “String”


(Vincent Regaud) #18

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

(Marcus) #19

Hmmm … So does not work.


(Vincent Regaud) #20
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?


(Marcus) #21

openhab.log (654.3 KB)

Here’s the log


(Vincent Regaud) #22

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


(Marcus) #23

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.


(Vincent Regaud) #24

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?


(Marcus) #25

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.


(Vincent Regaud) #26

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


(Marcus) #27

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


(Vincent Regaud) #28

Where? In HABpanel?


(Marcus) #29

Yes in HABPanel


(Vincent Regaud) #30

You need to use a MAP transformation:


(Marcus) #31

The .item:

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

and in sitemaps/heating.map

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

?


(Vincent Regaud) #32

Your still not using code fences
This is important

Yes that should work


(Marcus) #33

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


(Vincent Regaud) #34

Change widget and use a button widget


(Marcus) #35

The result is still ON or OFF


(Vincent Regaud) #36

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