Wall Mounted Dashboard (now known as HADashboard)

Could add in a ‘clear’ widget and a ‘code’ widget to display maybe ***** for the number of digits entered.

Not exactly local to the dashboard, its local to the dashing server but that’s the idea yes.

Yes I meant in the server itself. Can I just hack the server python and restart it to test changes, or do I have to rebuild it somehow?

You need to be careful here - the python piece is for pushing status changes back to the dashboard, you need to be making changes to the Ruby piece in jobs/homeassistant.rb for the numeric pad, it probably won’t need anything from the python piece unless there is a way to reflect status changes back to the widget. In either it is just a case of making the changes, no recompilation is needed.

Yeah sorry I meant the Ruby - I’d seen the diff in jobs/homeassistant.rb for the halock changes.

I think something like this will work to arm/disarm/trigger

post '/homeassistant/alarm_control_panel_command' do
	# command will be one of
	#   disarm
	#   arm_home
	#   arm_away
	#   trigger
	if $alarm_control_panel_code = ""
		ha_api("services/alarm_control_panel/alarm_" + params["command"], "post")
	else
		ha_api("services/alarm_control_panel/alarm_" + params["command"], "post", {"code" => $alarm_control_panel_code})
	end
	return respondWithSuccess()
end

While this may not be the correct way to fix this, I changed ‘/hadashboard/widgets/hasensor/hasensor.coffee’ to the following:

class Dashing.Hasensor extends Dashing.Widget
  constructor: ->
    super
    @queryState()

  @accessor 'value',
    get: -> @_value ? "Unknown"
    set: (key, value) -> @_value = value

  queryState: ->
    $.get '/homeassistant/states',
      widgetId: @get('id'),
      (data) =>
        json = JSON.parse data
        @set 'value', json.value

  ready: ->
    if @get('bgcolor')
      $(@node).css("background-color", @get('bgcolor'))
    else
      $(@node).css("background-color", "#444")

  onData: (data) ->

My text is back in dashing.

Well I’ve got a widget that shows my alarm state. Now to try the one to set it etc. :slight_smile:

1 Like

Nice work, @Soul!

Getting there :slight_smile: Having more fun getting the action widget to work but hopefully figure that out soon!

1 Like

Action button widgets are now working to arm/disarm/trigger the alarm (configured without needed a code). Next thing is to create keypad widgets and use those to build and pass code to the arm/disarm process.

Not pretty yet, but you get the idea :smiley:

1 Like

About what I was thinking :slight_smile:

:smiley:

Currently all works with 3 new widgets:
haalarmstatus
haalarmaction
haalarmdigit

Think I might need another one just to show the code as it’s being entered or something.

@aimc was there a reason why hadashboard uses hapush to update the dashboard, rather than using the Dashing scheduler?

I can understand that it makes the update more instant, but if the scheduler was running on a short poll time that wouldn’t matter much, and people are unlikely to be using both HASS and Dashing at the same time to notice the latency?

Was it to reduce the load on the HASS API?

Polling that many devices often enough to be responsive would be clunky and a huge load on HASS if you did it individually, although you can grab all state with a single call which would be more efficient. The original implementation used a similar mechanism, but I have seen implementations that polled and I just didn’t like them, they were very slow to respond to changes.

Thought it might be that. I was trying to figure out how to make my status widget refresh every few seconds, as I wanted to use that widget to show the code as it’s entered but go back to the alarm status after a period of inactivity. But not figured out a nice way to do it yet as you need the widget id to call the API and you don’t have the widget id except when the widget itself makes its GET request.

I’ll figure something out :smiley:

Pretty much there as something that’s useable now. The text AND icons light up on the buttons. As you enter a code the widget at the top displays the code rather than the alarm status. When you clear, or perform an action, the top widget displays current state again. It’s also hooked up in hapush so changes in HASS are reflected on the dashboard.

2 Likes

Just discovered that Trigger doesn’t require a code to fire, so might have to move that button somewhere harder to hit by mistake…

1 Like

Looking good!