Input Number Need Help

Good Morning Guys
Thats my first Post…:wink:

I was trying the last days to get my Project a Little bit Forward but i still hang at the same Point like befor…:frowning:

I Need help with an Input Number Component.
Until now i had working a Input_number Config for Switch the Volume from my Denon AVR .

Last week i was adding a IR Mqtt Sensor over openmqttgateway this also working with a Switch in my Config.
My Plan is when i push “VOL_UP” Button at the Ir Controller Raise up the Input_number for my Denon ARV.
The same with “VOL_DOWN” Button Change the Input_Number down.

Anyone can help me??

Thanks for your help.

You basically need to trigger on MQTT message, and increment the input_slider if message is VOL_UP an decrease when VOL_DOWN is received.
Can you share some info on how you’ve set this all up?

Here some info about my config

Automation:

  • alias: Denon Volume Select
    trigger:
    platform: state
    entity_id: input_number.denon_volume
    action:
    service: media_player.volume_set
    data_template:
    entity_id: media_player.Denon
    volume_level: ‘{{ trigger.to_state.state }}’
    #####################################################################
  • alias: Denon Volume
    trigger:
    platform: state
    entity_id: media_player.Denon
    action:
    • service: input_number.select_value
      data_template:
      entity_id: input_number.denon_volume
      value: ‘{{ states.media_player.Denon.attributes.volume_level }}’

Switch for mqtt:

  • platform: mqtt
    name: “volume_up”
    state_topic: “home/IRtoMQTT”
    command_topic: “home/commands/IR_Raw”
    payload_on: “2152071184”
    payload_off: “2152103952”
    optimistic: false
    retain: true

  • platform: mqtt
    name: “volume_down”
    state_topic: “home/IRtoMQTT”
    command_topic: “home/commands/IR_Raw”
    payload_on: “2152071185”
    payload_off: “2152103953”
    optimistic: false
    retain: true

Can you show me an example for how I can use the sensor and how I can use it in my input number ??

Thanks

Can you try and use the mark up langage to format your code? (see the blue bar on top of the page).
I’m not sure about the retain: true bit, you’re not tracking a status but an action… There’s a chance that with that setting you’ll only be able to track “up” once (no state change when you press again) until you press down.
Here is an example of an automation triggered from an MQTT sensor:

- alias: Play Weather Greeting
  trigger:
    - platform: state
      entity_id: sensor.Kello_MQTT
      to: 'play_greeting'
  action:
  - service: shell_command.weather_on_kello_play

Note that this sensor has 2 states, so again not sure it would fire if you have the same status being repeated (e.g. Vol Up pressed twice).
You may have to change the trigger to be event driven:

- alias: Play Weather Greeting
  trigger:
    - platform: event
      event_type: signal_received
      event_data:
        entity_id: sensor.Kello_MQTT
  action:
  - service: shell_command.weather_on_kello_play

You’ll probably have to add a condition to track whether the message was Vol up or Vol down else it;ll trigger on both message types.

And how i can use it for my Input number config??

action:
  service: input_number.increase
  entity_id: input_number.denon_volume

If the increase doesn’t work, try something like this:

action:
  service: input_number.select_value
  data_template
    entity_id: input_number.denon_volume
    value: '{{ states.input_number.denon_volume.state + 1}}'

Thanks i will try when I’m home :wink:

So i was trying both actions but noting happends the input number Denon stays at the same

hum that doesn’t look right. the action should have an impact on your input_number… How did you try the action? Via an automation or via the services command in the Dev tools?

i did try this with a automation like this

  - alias: adsadasdasdasd
    trigger:
      - platform: state
        entity_id: input_boolean.testswitch_1
        to: 'on'
    action:
      - service: input_number.select_value
        data_template:
          entity_id: input_number.denon_volume
          value: '{{ states.input_number.denon_volume.state + 1}}'

I’ve double checked and the increment function does exist, making is simpler, so I’d use this instead.

  - alias: adsadasdasdasd
    trigger:
      - platform: state
        entity_id: input_boolean.testswitch_1
        to: 'on'
    action:
      - service: input_number.increase
        entity_id:input_number.denon_volume

When you turn your input_boolean to on, it should increase the value of your input_number.denon_volume

1 Like

Thu Apr 05 2018 18:52:09 GMT+0200 (Mitteleuropäische Sommerzeit)

Unable to find service input_number/increase

input_number.increment

Think @lolouk44 was going off the top of his head.

It’s not covered in the doc’s, but you can search the service list and choose accordingly:

so i was Checking the status at the service page.

When i hit call service input_number Increment i see a changing in my frontend.

but how i get this running in an automation?

Sorry it was increment not increase. I was helping while on break at work.
For the automation now you need to try and catch the mqtt message. Check the examples I sent earlier on today

one more question how is the call for move down the input_number??

Sorry guys…

I find it by my self Thanks a lot;)
So i´ll post my config later .

Greetz

If you want to set the input number you need to do it with integers. You can see that error in the log.

value: ‘{{ (states.input_number.denon_volume.state | int + 1) | int }}’

1 Like