Problem with discord action

Hi people yesterday I first time tried hassio and I made automation to send me my room temperature on discord every 20 minutes while the temperature in the room is more than 25 and below 40. But it’s not working. Could somebody help me?

automation:
  trigger:
   -  platform: numeric_state
      entity_id: sensor.moja_izba
      above: 25
      below: 40
   -  platform: time
      minutes: '/20'
      seconds: 00
  action:      
      service: notify.notify
      data:
        message: "In the Mark's room is {{ states.sensor.moja_izba.state }} degrees of C"
        target" "343399434945822720"

Here are my entities, config and error

I would leave platform time as the trigger and move the numeric state trigger into a condition.

1 Like

I found one error and that was in target" “343399434945822720” i forgot made mistake here i replaced it with target: “343399434945822720” but it is not working either

So i’ve replaced code for this

automation:
  trigger:
      platform: time
      minutes: '/5'
      seconds: 00     
  condition:
      platform: numeric_state
      entity_id: sensor.moja_izba
      above: 25
      below: 40
  action:      
      service: notify.notify
      data:
        message: "In the Mark's room is {{ sensor.moja_izba.state }} degrees of C"
        target: "343399434945822720"

and it still don’t work

Try replacing platform: numeric_state with condition: numeric_state

See…

Tried. Still don’t work

Can you put what you now have?

- alias: Discord
  hide_entity: False
  initial_state: 'on'
  trigger:
    platform: time
    minutes: '/5'
    seconds: 00
  condition:
    condition: numeric_state
    entity_id: sensor.moja_izba
    above: 25
    below: 40
  action:
    service: notify.notify
    data:
      message: "In the Mark's is {{ sensor.moja_izba.state }} degrees C"
      target: "343399434945822720"

If you trigger the automation manually does it send the notification?

Ok so the problem was with this statement message: “In the Mark’s is {{ sensor.moja_izba.state }} degrees C” I’ve tried manually send this text to discord nothing happend When I removed this {{ sensor.moja_izba.state }} the message did send sucessfully. So I’ve replaced it with {{states.sensor.moja_izba.state}} and now it is working. My current automation is this:

- alias: Discord
  hide_entity: False
  initial_state: 'on'
  trigger:
    platform: time
    minutes: '/5'
    seconds: 00
  condition:
    condition: numeric_state
    entity_id: sensor.moja_izba
    above: 25
    below: 40
  action:
    service: notify.notify
    data:
      message: ":sunglasses: V Marekovej izbe je {{states.sensor.moja_izba.state}}°C"
      target: "343399434945822720"

Glad you got it working :slight_smile:

1 Like