I want to create a conditional visibility rule for an item on my sitemap. I want the “Set Temp” to be hidden when the airco is just set to “Fan” and visible when the other modes are selected.
Based on the guidance here Sitemap visibility rules with “AND” I need to accomplish this with a rule and an additional item.
I created an additional visibility switch and updated the sitemap which works fine when I turn it on manually as a test. The issue is that I can not get the rule to fire when the BMode has been changed to ‘FAN’ so that the visibility switch changes to true.
I suspect it might be because i am using mappings…
Any help is appreciated
Items
//Daikin Bureau
Switch BPower "Power" { channel="opendaikin:ac_unit:192_168_0_238:power" }
Number BSetTemp "Set Temp" <temperature> { channel="opendaikin:ac_unit:192_168_0_238:settemp" }
Number BInTemp "B Indoor Temp[%s °C]" <temperature> [ "CurrentTemperature" ] { channel="opendaikin:ac_unit:192_168_0_238:indoortemp" }
Number BOutTemp "Outdoor Temp[%s °C]" <temperature> { channel="opendaikin:ac_unit:192_168_0_238:outdoortemp" }
Number BHumidity "Humidity" { channel="opendaikin:ac_unit:192_168_0_238:humidity" }
String BMode "Mode" <heating> { channel="opendaikin:ac_unit:192_168_0_238:mode" }
String BFanS "Fan Speed" <qualityofservice> { channel="opendaikin:ac_unit:192_168_0_238:fanspeed" }
String BFanD "Fan Direction" { channel="opendaikin:ac_unit:192_168_0_238:fandir" }
Switch DaikinVisibility1
Rule
// ....
rule "Set Daikin Visibility Flag 1"
when
Item BMode changed
then
if (Bmode.state.toString.contains ("FAN"))
sendCommand(DaikinVisibility1,OFF)
else sendCommand(DaikinVisibility1,ON)
end
Sitemap
{
Frame label="Bureau" icon="climate"
{
Switch item= BPower label="On/Off"
Setpoint item= BSetTemp minValue=20 maxValue=25 step=1 visibility=[DaikinVisibility1==ON]
Selection item= BMode mappings=["AUTO"="Auto", "DEHUMIDIFIER"="Dehumidifier", "COLD"="Cold", "HEAT"="Heat", "FAN"="Fan"] visibility=[BPower==ON]
Selection item= BFanS label="Fan" mappings=["AUTO"="Auto", "SILENCE"="Silence", "LEVEL_1"="Level 1", "LEVEL_2"="Level 2", "LEVEL_3"="Level 3", "LEVEL_4"="Level 4", "LEVEL_5"="Level 5"] visibility=[BPower==ON]
Text item= BInTemp
Text item= BOutTemp
Switch item= DaikinVisibility1
}