i have two Bluetooth Temperature Humidity 2, I want to create an automation that starts the fan when the outdoor humidity is 20% lower than the indoor humidity, and the outdoor humidity is below 60%, and the time is between 8:00 and 18:00.
Outdoor meter information
type: is_humidity
condition: device
device_id: 187c277635856fd59832d6ab61baab2d
entity_id: d76460cb16f6c78acf762b4fb71e138c
domain: sensor
Indoor meter information
Hello matt19891231,
Welcome to the home assistant forums!
I’m sure that can be done. Also having someone or something writing it for you means the second it misbehaves, you will be struggling back to find someone to fix it for you.
The best way to learn is to just try. Run thru the docs on getting started with the automation editor. If you get stuck, come back with what you have done.
outdoor:室外,indoor:室内,fan switch:排气扇。
I saw this link yesterday, but I’m still not sure how to get specific values. I hope everyone can provide an example so that I can take a lessons from it. It’s better to write it in YAML, I know nothing about it.Thank you again for your help.
It’s not “better” to write in YAML in general, but it is far easier to share code in this forum in YAML.
Here’s an example. I think that 室外 is the “friendly name” for your outdoor sensor, and it must have an ASCII entity id. I’ve used sensor.outdoor (and similar for the others) below — you will have to find out the real entity IDs.
I have assumed that you meant "when the outdoor humidity is 20% (or more) lower than the indoor humidity.
The 08:00 trigger is to ensure that the fan starts promptly if all the other conditions are already met at that time, rather than waiting for the next sensor reading.
I roughly understand now. Let’s wait until tomorrow to see if it will trigger automatically. I need to lower the humidity value a bit to trigger it.thank you!
Excellent. You have not included the 08:00 trigger, but that doesn’t really matter if your humidity sensors are sending frequent updates.
It will also send multiple “turn-on” requests to the switch, but that shouldn’t matter. If you wanted to stop that, you could add an additional condition to check the switch is off before trying to turn it on:
- condition: state
entity_id: switch.chuangmi_212a01_3789_switch
state: 'off'