I am trying to write my first custom component for home assistant. I am trying to write a simulated sensor, similar to the simulated platform that exists. However with my simulated sensor, I am looking to have it change state based on the time of day. So as an example. Id like to write a simulated occupancy sensor where it triggers around a particular time of day. Part of the configuration may be the target trigger time and a random variance of say +/- 1 hour. The challenge I have in looking at the code for the existing simulated platform is how to get an update to trigger at a particular time of day as per the configuration of this platform.
I realize there is a sync and async method of updating these sensors and it seems it is encouraged to use the async method for efficiency and performance.
Does anyone have any ideas on how I might accomplish this? I am very new to HA development.
I also thought of just using the custom component to create the simulated sensors and use a python script to actually update the state of the sensors based on the system time.
Im sorry if what im asking for help with is not clear. I can certainly clarify further. I am basically trying to create a series of sensors that simulate real data ongoing with some sort of controlled randomness.