Automatically update state and attributes of a custom component

@Tinkerer , @fabaff, @anon43302295, @gpbenton

I am trying to create a custom component. I need to have a continuous listener on the device and automatically update states and attributes of the device even when controlled from IR remote of the device. Can you please suggest me the HA functions to achieve this?

Is the device able to feedback its state? If not, you’re stuck.

@anon43302295

I have created a thread to create a socket connection with the device and read feedback from the device without sending any command. I was able to receive the feedback command when controlling the device from IR Remote. But due to this thread,I was not able to send any command using the same connection in the setup function.

Is there any way by which I can manage both the things?

There certainly will be a way I suspect, but it’s beyond my level of expertise by a few miles :wink:

You’re probably best to pop on Discord and speak directly to people ‘in the know’ :+1:

@anon43302295

Can you tell me the ids of the people to contact?

Not personally, but I’m led to believe that everyone on there is very helpful and it doesn’t sound like a complicated query for the devs to answer so I would just drop in and see who’s there :wink:

You mistake me for one of the developers in your tagging of so many people :wink: You should just post your question rather than tagging folks.

I’d point you at the developer documentation.

I took it as a compliment :smile:

Most platform set up the connection in setup_platform() and re-use the connection while creating the platform object.

It would help if you how us what you have so far.

Thanks. Got it.