Hello,
Im using a Somoff TH10 to monitor the humidity in my bathroom, and then turn on/off a fan based on the humidity reported.
This is working fine, and, if I wish I can turn on/off the fan manually in Homeassistant, or via the switch on the sonoff.
However, I don’t want to actually publish the switch on HA, as I don’t want the option to turn off the fan - want to ensure it stays on and cannot be turned off until the humidity returns to the correct levels, but I do want to know the status of the fan in HA - i.e. whether it is on or off.
I’ve tried creating a binary sensor to report the status, but that stopped the switch working, and I also tried adding a template switch to the config - this I could not get to work either. What is the most applicable method to accomplish this?
Secondly, if, for example esphome has switched on the fan because the humidity has risen to the trigger level, but I manually switch it off with the toggle button, on the next scheduled status push (every 10 seconds in my case), the fan does not turn back on automatically. To reset this behaviour I need to restart the sonoff again. This is a small niggle, but I’m curious as to why this might be happening.
Thank you fir any input in advance. Please find attached relevant code below pertaining to the switch and fan.
switch:
- platform: gpio
name: "Bathroom Fan"
pin: GPIO12
id: relay
sensor:
- platform: dht
pin: GPIO14
model: SI7021
temperature:
name: "Bathroom Temperature"
humidity:
name: "Bathroom Humidity"
on_value_range:
- above: 75.0
then:
- switch.turn_on: relay
- below: 72.0
then:
- switch.turn_off: relay
update_interval: 10s