How to access input_value helper value from custom component?


I am trying to feedback a setting to a custom component using an input number helper (with ID=input_number.ftx_borvarde_tilluft)

But I cannot figure out how to listen to it in my custom component. Among other things I tried to listen to it in my setup

async def async_setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up the sensor platform."""

    # Listener to handle fired events
    def handle_event(event):

        # Just to get some feedback of it works

    # Listen for helper event is fired
    hass.bus.listen("input_value.ftx_borvarde_tilluft", handle_event)

But with the above example the Home Assistant does not even start (but I get no error printout in the log).

How should this be done?

What I want to achieve in general is the be able to trigger to set a new setpoint to my FTX Cooling system from Lovelace. So I want to be able to trigger the “set value” part of my own code to execute with the new setpoint value from Lovelace (the idea was to use the input_number helper with a slider in an Entity Card)

Any ideas how to solve this? I am using the example_sensor as base for my custom component.

@jorgenh I have a similar problem. Did you solve this problem? I need a input float for my integration but I can not get it to work.

Can an entity listen for HASS events? ?