Button show "on" state

How do you make a button show a different state when “on”?
I’ve tried creating a button, mapping it to some inputs, creating an actions that toggle, hold values, etc when the button is “pressed” and then setting some different colors for “critical” state that represent “on”, or 1.
I’m just not getting it.
Any pointers?
And yes, I’m a total noob to realdash. Bought the premium version, in case that was the issue. No change.
Coming from Torque, where I’ve got some buttons that turn on relays in my Arduino.
Trying out some proof-of-concept stuff before I re-design my entire system to work with realdash to see if what I envision is doable.
Thanks!

First check these tutorial videos if they help:
http://realdash.net/manuals.php

If you don’t find what you are looking for there, then please describe what you are trying to achieve in detail.

Nothing in the docs shows how to work with buttons.
I would like the button to toggle a value between 1 and 0 (turn a relay on and off) and show the current state of that input.
I can get it to change states by hooking up it’s input to the CEL so that part is working right. The part that’s not must be something in the action or input. Currently hooked up to one of the dummy input values that are available.
Pretending that dummy register is hooked to a relay, would like to show the current state that I’m setting it to. On/Off.
Running in simulation mode if that matters.

If you want the text on button to change, its little bit more involved, but I try to go thru the steps. Here I use ‘Dummy 1’ as example input, replace with your actual input.

  • Create new dashboard and add Button gauge
  • Select button and go to ‘Input & Values’
  • Select data source: Select Other: Dummy 01
  • Set range max to 1.0
  • Set warning above 0.5
  • Set critical above 0.8
  • Tap ‘Done’ to go back to dashboard editing

Now your button is linked to Dummy 01 and you can adjust what happens to it visually.

  • Select button and go to ‘Look’n Feel’ → Font and Text
  • On Edit box, change button text to OFF
  • On bottom left, tap the gear icon and change editing level to ‘Warning’
  • On Edit box, change button text to ON
  • On bottom left, tap the gear icon and change editing level to ‘Critical’
  • On Edit box, change button text to ON
  • Exit Look’n Feel back to dashboard editing

Now the button text will change according the gauge level.

  • Select button and go to ‘Input & Values’
  • Tap Select Button Actions button and then ‘New Action’
  • Give action name, like ‘Toggle’
  • Select Action type: 'Toggle value On/Off
  • Select input to toggle, Other: Dummy 01
  • Tap ‘Done’ until you are back in dashboard editing

Now the button will trigger an action that toggles the Dummy 01 between 0 and 1.

As said this is much simper to do if you use a button and separate text gauge to show the value. Hope this helps.

EDIT: Attached an example .rd file
button_test.rd (8.08 KB)

Thanks for the quick response and sample file, I got it working.
FYI for others to learn from my mistakes:
-dummy01 variable was being used by the default dash for something else
-I was entering .8 instead of 0.8 in the values, for example, and realdash was converting that to an 8 after I saved, so the threshold would never be met. I discovered this by accident and needed to follow your instructions to the letter.
-I had some trouble with a background color obscuring my image in the critical state (I was using 2 images). Still not clear why that was happening, and I didn’t see an option to “bring image to front” or whatever.
-After fiddling with the color settings some more, I was able to partially see my critical state image. After removing all color settings I could fully see it.

Seems promising so far.
Some instructions on how the various color, blending, and other settings work in the buttons might be useful.

Yes, the dummy variables are used heavily on out dashboards to keep track dash state and animations.

I will check the text to float parsing if we can automate .8 to become 0.8.

Bring to front is on edit mode context menu (bottom menu, rightmost button). Or press numpad + to bring gauge forward.

All the color settings work exactly the same way as setting the text on button, they are based on gauges normal,warning and critical levels, edited separately in Look’n Feel. The 3 tutorial videos in manuals section show how to use these:

http://realdash.net/manuals/change_color_of_text_gauges.php
http://realdash.net/manuals/make_an_indicator.php
http://realdash.net/manuals/using_normal_warning_and_critical_levels.php