#Switching between values with one button, how is this possible?
1 messages · Page 1 of 1 (latest)
i understand how make it if use with mobiflight variables, however I think there is an easier way
Hi, if you mean you have a switch with 2 positions I would assign one to the onpress, the other for the onrelease event.
I think what you mean is ‘ switch on air con if it is off otherwise switch it off’
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) }