Helper input_number - how to hide or remove slider

To show the temperature in the lovelace UI I have made a helper “input_number”. Now when adding this “input_number” to the Lovelace UI, there is automatically a slider available to adjust the value of this “input_number”. I do not want that slider, how can I remove that?

I have tried other helpers, but the input number is the only one where the UI shows the value AND when clicking on the value I also see a nice history graph plot.

Background info:

I read out an ADC voltage (0 to 5 volts) and convert this using Node-Red to a temperature (0…60 deg C) and post it to a helper.

The values should come only from Node-Red. The user shouldn’t be able to change the value using the slider.

Set this option in your input number configuration:

mode: box

https://www.home-assistant.io/integrations/input_number/#mode

Oh.

Then you don’t want an input number at all. You want a template sensor.

1 Like

I found the option about “mode: box” before. But I do not see any place where I could alter this mode. When I am at the UI → Helpers. There I can only add a new helper, but not change the option of the helper. Where should I adjust the option?

Can anyone tell me what I have to restart after adding a template sensor? I tried restart core, then restart supervisor, then restart host. All no luck to see the template sensor.

I tried adding the template sensor to my /config/configuration.yaml , see the full file below.

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

template:
  - sensor:
      - name: "Boiler T Water"
        unit_of_measurement: "°C"

You have not included a state template. This is not optional, you must provide one.

1 Like

I ended up using Node-Red to post the value to Home Assistant because using mqtt auto discovery, there is no need to restart Home Assistant when adding or removing variables / sensors.

Templating requires to restart Home Assistant, at least, for what I have tried, I see the added templates in the configuration.yaml only gets available after a reboot.

It would be great if templating works just like the variable helpers does, as it is easy to maintain and configure.

in case anyone ends up also to use node-red with autodiscovery of sensors / variables to Home assistant, have a look to the code below:

[{"id":"984ee91a278bf7b8","type":"link out","z":"2e1e9df744ebc531","name":"mqtt out","mode":"link","links":["3d1827435b36e5f5"],"x":635,"y":1760,"wires":[]},{"id":"3da4e6da03462ad6","type":"function","z":"2e1e9df744ebc531","name":"ID","func":"stateTopic = \"nodered_solar_current_watts\";\ntopicTarget = \"homeassistant/sensor/\" +stateTopic + \"/state\";\nunique_id = \"nodered_\" + stateTopic;\nname = \"Solar current W\"\nT = msg.payload;\nwaarde = parseFloat(T).toFixed(0);\n\n\nif(msg.target === '2'){\n    var sensor_config2 = {\n    \"state_topic\": topicTarget,\n    \"value_template\": \"{{ value_json.value | default('') }}\",\n    \"json_attributes_topic\": topicTarget,\n    \"device\": {\n        \"identifiers\": [\n            unique_id\n        ],\n        \"manufacturer\": \"Node-Red\",\n        \"model\": \"Virtual Tag\",\n        \"name\": name\n    },\n    \"name\": name,\n    \"unique_id\": unique_id,\n    \"state_class\": \"measurement\",\n    \"unit_of_measurement\": \"W\",\n     \"device_class\": \"energy\"\n};\n\nmsg.payload = sensor_config2;\n\n    msg.topic=\"homeassistant/sensor/\"+ stateTopic+ \"/config\";\n    return [msg, null];\n}\n\n\nvar sensor_config = {\n    \"value\": waarde\n};\n\nmsg.payload = sensor_config;\nmsg.topic=\"homeassistant/sensor/\"+ stateTopic+ \"/state\";\nreturn [msg, null];","outputs":3,"noerr":0,"initialize":"","finalize":"","libs":[],"x":490,"y":1760,"wires":[["984ee91a278bf7b8"],[],[]]},{"id":"dfd34ed815130ec0","type":"server-state-changed","z":"2e1e9df744ebc531","name":"","server":"2e51afe.c76fa5","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.solaredge_current_power","entityidfiltertype":"exact","outputinitially":false,"state_type":"num","haltifstate":"-1","halt_if_type":"num","halt_if_compare":"is_not","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":200,"y":1760,"wires":[["3da4e6da03462ad6"],[]]},{"id":"dbba3b5111b8076b","type":"inject","z":"2e1e9df744ebc531","name":"postConfig","props":[{"p":"target","v":"2","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":320,"y":1800,"wires":[["3da4e6da03462ad6"]]},{"id":"5b370fe18eea9eb8","type":"function","z":"2e1e9df744ebc531","name":"Random number generator","func":"const MIN = 1000;\nconst MAX = 2000;\n\nmsg.payload =function getRandomInt(min = MIN, max = MAX) {\n  min = Math.ceil(min);\n  max = Math.floor(max);\n  return 0.23456 + Math.floor(Math.random() * (max - min)) + min;\n}();\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":1840,"wires":[["3da4e6da03462ad6"]]},{"id":"a92a4949a2a26a1d","type":"inject","z":"2e1e9df744ebc531","name":"postValue","props":[{"p":"target","v":"1","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":120,"y":1840,"wires":[["5b370fe18eea9eb8"]]},{"id":"e138a2bed73cf1fb","type":"mqtt out","z":"2e1e9df744ebc531","name":"Post to MQTT","topic":"","qos":"","retain":"true","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"9fedca0d.c87928","x":1080,"y":1600,"wires":[]},{"id":"3d1827435b36e5f5","type":"link in","z":"2e1e9df744ebc531","name":"mqtt in","links":["6c73d20fdaa78a2f","48e1aca3a1dd65e1","984ee91a278bf7b8"],"x":955,"y":1600,"wires":[["e138a2bed73cf1fb"]]},{"id":"2e51afe.c76fa5","type":"server","name":"Home Assistant","addon":true},{"id":"9fedca0d.c87928","type":"mqtt-broker","name":"homeassistant","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

There’s no need in Home Assistant either.

Configuration / Server Controls / YAML configuration reloading / Template Entities

1 Like