Accessing temperature from thermostats

I have two thermostats and I’m trying to understand how to get and react to the data from them.

One example is the device Bedroom thermostat, a physical thermostat (quirk: zhaquirks.bitron.thermostat.Av201032). It has the following entity IDs: sensor.thermostat1_hvac_action
sensor.bedroom_thermostat_power
climate.bedroom_thermostat_temp_and_heat

If I wanted to create an automation based on the current temperature measured versus target, how would I go about this? There is no sensor for temperature. Is the idea to rely on sensor.thermostat1_hvac_action to let the thermostat manage this though manual input on the physical thermostat, and then use sensor.thermostat1_hvac_action to turn the heating in the room on and off?

When I check the “Bedroom thermostat temp and heat current temperature” and “Bedroom thermostat temp and heat target temperature” in HASS History, I can see the values there. But how do I get to those values for automations?

Check the attributes of climate.bedroom_thermostat_temp_and_heat, there should be current_temperature and temperature.

Look at the second example here:

And the fourth example here:

This did the trick indeed! Thanks a lot!