#Switching between values with one button, how is this possible?

1 messages · Page 1 of 1 (latest)

serene locust
#

i have
H:H145_SDK_OH_AIR_CONDITIONING_OFF
H:H145_SDK_OH_AIR_CONDITIONING_ON
and one button for switch
Thanks

#

i understand how make it if use with mobiflight variables, however I think there is an easier way

slender blaze
#

I think what you mean is ‘ switch on air con if it is off otherwise switch it off’

magic warren
#

You can make a toggle (single pushbutton event) from these, but you will first need to have a simvar that contains the current state of the air conditioning.

So basically

  • read the state of airconditioning
  • if it is OFF, send the ON event
  • else, send OFF event

Seems to be (L:H145_SDK_OH_AIR_CONDITIONING) according to hubhop

#

My RPN is a bit rusty, but maybe something like this?

(L:H145_SDK_OH_AIR_CONDITIONING) ! if{ (>H:H145_SDK_OH_AIR_CONDITIONING_ON) } els{ (>H:H145_SDK_OH_AIR_CONDITIONING_OFF) }