HAdashboard - sound on state change?

I’ve just started playing with HADashboard and starting to get my head around the configuration.

However I’d like to know if its possible to have the dashboard play a sound on the state change of a certain entity?

We have our dash in the living room, and I’d like it to play a noise if any external doors open.

Not currently supported but it is technically possible - I’ll add it to my feature list to take a look at.

Great thanks, coming from domoticz and dashticz we found it a really useful feature, especially with kids that like to play with doors :slight_smile:

i have it implemented in 1 of my custom sensors.
it works so its possible.

this is what i added to the set_value function:

            if (self.parameters.use_speach == "true")
            {
              pretext = self.parameters.pre_text
              aftertext = self.parameters.after_text
              if (self.parameters.use_value != "false")
              {
                 mymsg = pretext + value + aftertext
              }
              else
              {
              mymsg = pretext + aftertext
              }
              key = self.parameters.api_key
              language = self.parameters.language
              var audio = new Audio();
              audio.src ='http://api.voicerss.org/?key=' + key + '&hl=' + language + '&src=' + mymsg;
              audio.play();
            }

this in the yaml from the widget:

  use_speach: ""
  api_key: ""
  language: ""
  pre_text: ""
  after_text: ""
  use_value: ""

and this in the dashboard:

    use_speach: "true"
    api_key: "093e97027a554801bdd2b9a52f90a5c8"
    language: "nl-NL"
    pre_text: "nieuw gewicht voor farah is "
    use_value: "false"
    after_text: "ingevoerd"

it needs gettin a free key at voicerss.org

Thank you, good to know its possible.

Can you elaborate where the set_value function comes into things? - I’ve searched and can’t find much on it, so struggling to piece together how it all works… (Sorry if its obvious, i’m still getting to grips with ha / hadashboard)

the information i posted was actually for @aimc so he knows how to implement :wink:
the set_value function is in the js files from the base widget.

if you want to recreate this, you need to find the widgets dir in the site-packages from python and copy the desired widget to the dir /conf/custom_widgets
you need the yaml file and the basedir.
then you can edit the js file in the base dir. and the yaml file to add this function.

Thanks for clarifying, I’ll hope its added at some point. But maybe i’ll try the mods when I have some more experience with ha dashboard :wink:

1 Like