Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95324

Sensor value as parameter

$
0
0

@jussbba wrote:

Hello,

I am trying to setup a script that adds an alarm to my squeezebox/lms player.

Here is the current script:

alarm:
  alias: alarm
  sequence:
    - service: media_player.squeezebox_call_method
      data:
        entity_id: media_player.picoreplayer
        command: alarm
        parameters: ["add", "enabled:1", "url:http://digitacdn.master.m3u8", "time:9000"]

The script is working but I would like to add the time with two slider (hours and minutes) instead of it being hardcoded. (Time is the last parameter) I have created the sliders (and sensors) for hours and minutes. The time needs to be formatted as seconds from midnight.

So the sensor values needs to be formatted to seconds. Maybe something like this:

Sensor.hours x 60 x 60 + Sensor.minutes x 60

Could somebody help me how to create template or something that would do the trick. And provide an example on how to add it correctly to the parameters.

Thank you very much!

Posts: 5

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 95324

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>