Am using awesome script created by thehookup for control pc remotely. I have 4 computers all close to each another. I don’t really know how to code using arduino so am trying to rework code to esp home.
the part am struggling with is
void powerSenseCheckIn()
{
if (pulseIn(powerSensePin, HIGH, 300000) > 100)
{
client.publish("state/PC","ON", true);
}
else if(digitalRead(powerSensePin) == HIGH)
{
client.publish("state/PC","ON", true);
}
else
{
client.publish("state/PC","OFF", true);
}
}
am tried using but didn’t work
binary_sensor:
- platform: gpio
pin:
number: D2
mode: INPUT_PULLDOWN_16
name: "Computer Power sense"
any input would help a lot. Thanks in advance !