MQTT payload as input number

Which code are you talking about?

You included code from your automation in your first post that was:

service: input_number.set_value
target:
  entity_id: input_number.niveau_eau_cuves_verger
data: "{{ states('sensor.node_1_payload') | int(0) }}"

You said this was giving an error. Change it to this:

service: input_number.set_value
target:
  entity_id: input_number.niveau_eau_cuves_verger
data:
  value: "{{ states('sensor.node_1_payload') | int(0) }}"

and see if that fixes it.

Hallelujah! It is working as expected. I didn’t see the value line. I had to read several times. Thanks you all for your help. I learned a lot.
This topic can be close.

1 Like