Switch OD_OAC_power "Office AC Power" { channel="opendaikin:ac_unit:192_168_2_61:power"}
Number OD_OAC_tempin "Office inside temp [%.1f °C]" <temperature> { channel="opendaikin:ac_unit:192_168_2_61:indoortemp"}
in sitemap
This shows me a section with a static icon (doesn’t change depending on state) and the room’s temperature:
Text item=OD_OAC_tempin label="Office AirCon" icon=climate {
This shows me a section with a dynamic icon (aircon on or off) but no temperature.
Text item=OD_OAC_power label="Office Aircon" icon=climate {
Each value comes from a different item. And the dynamic icon changes according to the ON/OFF state of OD_OAC_power, while OD_OAC_tempin is the item that holds the temperature. Is it possible to have both: section has dynamic icon depending if aircon is on or off and also shows the current temperature?
I’d normally want try to have the icon state controlled by the power switch, while augmenting the label with the addition of the tempin value. I checked around the forums and there were a couple of people that asked something similar but only got a couple or so replies and they involved rules and in the rules imports of modules and the such. I haven’t got around to rules yet - so far I’ve got several bindings, lots of things and items but they mostly show state and control via bindings works well enough (Opendaikin, SamsungTV, Enigma, etc). I wanted to get it to look right before venturing to rules.
In some cases you can create a new Item to combine the states into one Item using Rules. This usually works when you are dealing with wanting two pieces of information on the label.
For cases where you want to control the icon, you need to use the visibility option and custom icons.
When vGarageOpener1 is CLOSED, the line that uses the garagedoorclosed icon and the Open button (mappings) is shown. vGarageOpener1 is OPEN, then the line that uses the garagedooropen icon and the Close button is shown.
Sometimes you just have to go to Rules. This isn’t one of those cases though.
I’m not sure if you got my point (or perhaps I didn’t get yours ).
What you suggest works on simple states but in my example above the climate icon should show if the aircon is on or off and yet still show the temperature in the label. Thus needing 2 item states in one section display:
Text item label icon {
…
…
}
At a glance I can see both if aircon is on (icon state) and the inside temp. In one line and not two. With 2 lines it is trivial to do. How to combine the left icon to represent on/off state with the right hand side space to show temperature.
This is extremely useful for at a glance and space saving so I’m surprised more people aren’t asking for this.
Here I found 2 links that discuss something similar but it seems it’s not possible:
If the icon has to reflect item state then for on/off I have to use the switch item reference. Now, the label is text/string. Feels odd that this string can’t contain a reference to an external variable (state of a different item eg. temperature)
edit: you did answer ‘yes but not easily’. I would be very grateful if you have suggestions/examples specifically for the on/off and temperature case. I guess I’m not advanced enough yet to extrapolate from the garage door example.
edit 2: ok I get it now. I was missing that visibility can be applied to sections!
Yes, it is not
The icon displayed depends on the state displayed
For example for a switch there is a switch.svg icon and then two more icons switch-on.svg and switch-off.svg
yes, thanks, this is cool but I don’t think you can use this method for section labels right? The section then controls all the other appropriate controls and info (settemp, fan speed, fan mode, etc) and using the visibility tag there to hide or show what is appropriate based on switch state.
It’s the section I’m interested in getting this to work with. I don’t mind not being able to control the ac with it since I can do that when I enter the section.
I was on my phone before but now I’m able to post a screenshot:
You can see it shows inside temperatures at a glance, and for more controls one can enter the section. But at a glance I can’t see if any aircon is on.
you need to use two different icons! Maybe use custom icons.
I just tried it (without section) and it works. But i don´t see, why it should not work with them.
Btw. i am also using daikin ACs in my house.
Best regards,
Alex
EDIT: I just tried it - it works also with sections.
@Casshern so you mean create 2 sections? Duplicate them and then show the appropriate one based on off state? I wasn’t aware visibility was doable with sections? Having different icons is not a problem, I can sort that
Text item=OD_LRAC_tempin label="LR AirCon" icon=climate {
// this only changes climate icon based on on/off state but doesn't show temperature in the section
//Text item=OD_LRAC_power label="LR Aircon [%s ]" icon=climate {
Switch item=OD_LRAC_power
Setpoint item=OD_LRAC_settemp minValue=20 maxValue=28 step=1 visibility=[OD_LRAC_power==ON]
Text item=OD_LRAC_tempin
Text item=OD_LRAC_tempout
Switch item=OD_LRAC_mode mappings=["COLD"="Cold", "HEAT"="Heat", "FAN"="Fan"] visibility=[OD_LRAC_power==ON]
Switch item=OD_LRAC_fanspeed mappings=["AUTO"="Auto", "SILENCE"="Quiet", "LEVEL_1"="Lo", "LEVEL_3"="Med", "LEVEL_5"="Hi"] visibility=[OD_LRAC_power==ON]
}