Heating widget

Nice job, but I’ve small wish: can You display .displayState (if defined) instead .state, so that proper formatting will be possible, for setPointItem and currentPointItem ? I know I can do this myself, but for each of Your great new versions, again and again … :wink: :innocent:

/Sas

The error message comes when the page containing the widget is opened in the browser and the Heating / Example Mode item is not linked to an item.

Hi @Tallman

thanks for the details.
I’ve found the little bug into the code. The error is by the defintion of the F7-Icon if no heatingModeItm is defined.
sorry for this.
I change the post above with version v1.8.1

I also included the array string for the icon selection.

Please give me a feedback if it works. :wink:

Change the line 510

from:

                                        f7: "=(items[props.heatingModeItem].state == 'Manuell' ? 'hand_raised' : items[props.heatingModeItem].state == 'Auto' ? 'arrow_2_squarepath' : items[props.heatingModeItem].state == 'Vacation' ? 'airplane' : 'thermometer')"

to:

                                         f7: "=props.heatingModeItem ? (items[props.heatingModeItem].state ==  props.heatingModeArray.split(',')[0] ? 'hand_raised' : items[props.heatingModeItem].state == props.heatingModeArray.split(',')[1] ? 'arrow_2_squarepath' : items[props.heatingModeItem].state == props.heatingModeArray.split(',')[2] ? 'airplane' : 'thermometer') : ''"

It works great now! Thank you very much! The only thing I noticed was the location prop needs to be one single phrase, with a broken phrase (like a space in between two words) the pop-up won’t show. For me that is no big deal but just wanted to let you know.

It works, good work keep it up :clap:

Hi Nico,
fantastic :+1: The additions work all well. Now there are nearly all design-options possible.

The “pulsing Corona” is also a very nice feature, which I tested with a toggling switch of my office-lamp.
grafik .

The wish of @Sas_Bibic (Translation) could be another interesting feature to make it more comfortable for users of different languages. But I don’t think that this is only done by changing the “state” to “displayState”.

For the moment I’m lucky with your solution and nosy for what is coming next.

cheers,
Peter

1 Like

Dear all

Based on this wonderful widget (Thanks Nico)
I try to create widget for personal weather station

Here

Any suggestion are welcome

1 Like

Hi @Nico_R

Thank you again for your work.Popup menu looks really cool, and heating animation beautiful.
Unfortunately, I observe strange behavior of heating mode icon. On page open it displays default value (thermometer), when I switch to different mode icon switched to assigned to mode (airplane, hand, etc) but then i switch to another page and back to page with widget icon become again basic thermometer.
Widget version is 1.8.1

I am glad. In which German forum did you post it? Just out of interest because I’m from Germany too. :wink:

I tried to reproduce the error but didn’t succeed. When I switch between pages the icons stay as defined.
The icons are firmly defined in the code. The states of the string item are defined in the heatingMode array.
The first array key gets the hand_raised icon, the second key gets arrow_2_squarepath icon and the third key gets airplane. If you use more than 3 keys, the key> 3 always gets the thermometer.

Nico

1 Like

I just thought, as your examples mostly shows “Klima Wohnzimmer” :wink:

Here’s the link for German-Forum, or here (may be you have to sign in to see the screen-shots)

@doctor64 I don’t know what kind of Thermostats you have, but my AVM-Fritz-Thermostats are “read-only” in the heating-mode. So if you make a change in the widget it will be set back after some seconds.

Changes are only possible inside the Fritz-Box-Web-UI.

2 Likes

Hi @Nico_R!
Sorry for false alarm, it was my fault. I just by old habit use spaces in heatingMode array, enter this:

AUTOMATIC, MANUAL, BOOST, VACATION

But spaces not ignored here, and of course strings “MANUAL” and " MANUAL" not matched, so default icon drawn.
Then I change array to:

AUTOMATIC,MANUAL,BOOST,VACATION

it start working as intended.
I think it will be common problem for people like me, with background in C or similar languages. I put space after comma by reflex! :slight_smile: So i think it will be good to note somewhere what spaces not ignored.
Again, thank you very much for your excellent work!

Just a minor issue, and I not sure it related to Heating widget - i got lots of messages in openhab log like this:

[WARN ] [se.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: undefined

Not sure of root source, but get it when I switch to test page with just one widget - heating. Try to define exampleModeItem, (normally i not use it) and seems like warning message stop appearing.

@fibu-freak I use EQ-3 MAX! Basic thermostats - they modes are controllable from OH binding. Anyway, problem is resolved, thank you for hint. You are right, mode item change state after few seconds - from " MANUAL" to “MANUAL”! :slight_smile:

Hi Alex,
as I understand the Array (heatingModeArray) and the corresponding Icons should be used in a certain order to interact with the “heatingModeIcon”. So my order is now MANUAL,AUTOMATIC,VACATION,…whateveryouwant:

MANUAL = handraised - Icon [0]
AUOMATIC = arrow_2_squarepath - Icon [1]
VACATION = airplane - Icon [2]
whateveryouwant = thermometer

Code-Line - 508 : f7: "=props.heatingModeItem ? (items[props.heatingModeItem].state ==  props.heatingModeArray.split(',')[0] ? 'hand_raised' : items[props.heatingModeItem].state == props.heatingModeArray.split(',')[1] ? 'arrow_2_squarepath' : items[props.heatingModeItem].state == props.heatingModeArray.split(',')[2] ? 'airplane' : 'thermometer') : ''"

As for me the “exampleModeArray” is more comfortable, I made a little change in Line 589:

f7: "=props.exampleModeItem ? (items[props.exampleModeItem].state ==  props.exampleModeArray.split(',')[0] ? 'thermometer' : items[props.exampleModeItem].state == props.exampleModeArray.split(',')[1] ? 'thermometer_sun' : items[props.exampleModeItem].state == props.exampleModeArray.split(',')[2] ? 'rocket'  : items[props.exampleModeItem].state == props.exampleModeArray.split(',')[3] ? 'gauge'  : items[props.exampleModeItem].state == props.exampleModeArray.split(',')[4] ? 'gauge_badge_minus' : 'wrench') : ''"

to get some fancy icons (not only “wrench”) for the “modes” I’m using there:

The Modes are:
grafik
…but the “WINDOW_OPEN” is no Option for me (it’s very special in the Binding)

Cheers - Peter

BTW: For the Boost-Mode I used that Icon:
grafik :wink: :joy: :joy:

2 Likes

I will improve this area with the next release :wink:

The same problem was already present here:

Unfortunately, I was not thoroughly enough in bug fixing :frowning: sorry!

But now it should work and the error should no longer appear. :slight_smile:

Look here in the adapted v1.8.1

@fibu-freak Thank you for helping others here with my mistakes before I can fix these :wink:

all the best,

Nico

Hi Nico,
I think there are no errors in your widget, I love it as it is.
It’s only the way to handle it the way you meant.

The warning message:

2021-02-28 13:42:36.771 [WARN ] [e.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: undefined

is from my point of view no error in the widget. I think this message comes up, when your in testing mode (Widgets) and an item which has to be named/assigned in the interaction, isn’t initialized/named/assigned.

I’m still very impressed of your work.

Cheers,
Peter

Hi @fibu-freak,
I’ll spend some time trying to figure root of problems. Looks like i found something, but, unfortunately, I don’t know how to fix it.
For example, we have in code for example item

display: "=props.exampleModeItem ? '' : 'none'"

So if exampleModeItemnot defined it will be not shown on interface. But code still have

action: command
active: "=(items[props.exampleModeItem].state === loop.buttonlabel ? true : false)"
actionCommand: =loop.buttonlabel
actionItem: =props.exampleModeItem

I think what OH engine still trying to access item with name in exampleModeItem variable, and because it is undefined generate a warning.

1 Like

Hi @doctor64 and @fibu-freak ,

That is not completely right. :wink: The error occurs because I refer to an item in expressions which is not defined.
The error is definitely in my code. I’ve tried to ensure it everywhere but quickly forgot in this new lines.

Your guess is completely correct.
I forgot to include the boolean operator in the expressions here.

I have figure the error out and adapt the correct expression in the code.

It must look like:

active: "=props.heatingModeItem ? (items[props.heatingModeItem].state === loop.buttonlabel ? true : false) : ''"

and

actionItem: "=props.heatingModeItem ? props.heatingModeItem : ''"

this for exampleModeItem and heatingModeItem.

The corrected code can be found here without a new tag version.

I hope this solves the bugs and you have fun agian with the widget. :wink:

2 Likes

Hi @Nico_R
Thank you very much, last update fixes problem with warnings.

Hello together,

I am facing some issue in the widget with rounding the value of temperature:

The item is defined as shown below:

Number:Temperature    SollTemp_Bad                   "Soll Bad [%.1f °C]"                       <temperature>      (gBadOGThermostat, gTemperature)           ["Setpoint", "Temperature"]       {channel="knx:device:MDT_IP:MDT_HS4:SollTemp_Bad", stateDescription=""[pattern="%.1f °C"]}

Any idea how to fix this issue.

Thanks in advance!

Hi @snowy

Please share your yaml and the two items set and current temperature.
Maybe then i can help.