Omnilink Ceiling Fan State

I’ve used the Omnilink binding for some time now and want to try grabbing the state of my ceiling fans to change how my rules work. Not many use omnilink but any help would great.

When I turn a ceiling fan on, I see this in the logs:
Item ‘FF_MasterBedroom_Fan’ received command ON
FF_MasterBedroom_Fan predicted to become ON
FF_MasterBedroom_Fan changed from OFF to ON
omnilink_upb_4ead50de_147_level changed from 0 to 100

Now if I try to use an IF statement to check the state, VS Code gives me an error on both lines. I’m missing the correct syntax for query omnilink item states.

if(omnilink_upb_4ead50de_147_level.state = OFF) {}

if(FF_MasterBedroom_Fan.state = OFF) {}

if(item FF_MasterBedroom_Fan.state = OFF)

In the PaperUI the fan looks like this:
### Light Level

omnilink:upb:4ead50de:147:level

Dimmer

Thanks!
Oakguy

Your clue - a Dimmer type Item has numeric state. You can send it command ON, and it’s state will go to 100.
So you’d want to test the numeric value == 0 for off, > 0 for on.

Appreciate that. Thank you! No errors

var inside_Temp = omnilink_temp_sensor_4ead50de_14_temperature.state as Number
var master_Fan = omnilink_upb_4ead50de_148_level
var lr_Fan = omnilink_upb_4ead50de_147_level
var den_Fan = omnilink_upb_4ead50de_146_level

            if(inside_Temp < 74){
                if(master_Fan == 0) {
                    omnilink_upb_4ead50de_148_level.sendCommand(ON)
                }
                else
                { omnilink_upb_4ead50de_148_level.sendCommand(OFF)}
                
                if(lr_Fan == 0) {
                    omnilink_upb_4ead50de_147_level.sendCommand(ON)
                }
                else
                { omnilink_upb_4ead50de_147_level.sendCommand(OFF)}
               
                if(den_Fan == 0) {
                    omnilink_upb_4ead50de_146_level.sendCommand(ON)
                }
                else
                { omnilink_upb_4ead50de_146_level.sendCommand(OFF)}
               
                logInfo("Ceiling Fan Off Rule", "Ceiling Fans turned OFF")
                logInfo("Ceiling Fan Off Rule", "Upstair Temperature: " + omnilink_thermostat_4ead50de_1_temperature.state.toString)
                 } 
         }

end

Bear in mind that we have no idea what, for example, den_Fan is.
If it is some Item like we were talking about before, it’s den_Fan.state that you would be interested in.

What are you using for a UPB fan control?

If you are using the Simply Automated UPB fan controller, I think you may need to do a rule in your Omni to set flags for each speed (button). I don’t believe the omnilink binding would be pulling UPB link information for you to use in a rule. Each fan controller button sends a different link number to change the speed of the fan.

Hi Steve,

Just an HAI dimmer configured as a switch. So only one and off. Or level 0 or 100.

Thanks
Guy