diff -r 0e2c58f8eb78 -r 003c20125212 thermferm/thermferm.c --- a/thermferm/thermferm.c Wed May 11 14:47:27 2016 +0200 +++ b/thermferm/thermferm.c Thu May 12 21:43:07 2016 +0200 @@ -1282,7 +1282,6 @@ /* * Unit door state, default is closed. */ - unit->door_state = 1; if (unit->door_address) { rc = device_in(unit->door_address, &temp); if (rc == DEVPRESENT_YES) { @@ -1299,13 +1298,16 @@ mqtt_publish_str(unit->alias, (char *)"door", (char *)"open"); } } + } else { + unit->door_state = 1; } + } else { + unit->door_state = 1; } /* - * Unit PSU state, default power is ok + * Unit PSU state */ - unit->psu_state = 1; if (unit->psu_address) { rc = device_in(unit->psu_address, &temp); if (rc == DEVPRESENT_YES) { @@ -1322,7 +1324,14 @@ mqtt_publish_str(unit->alias, (char *)"12volt", (char *)"off"); } } + } else { + unit->psu_state = 1; } + } else { + /* + * No state available, assume Ok. + */ + unit->psu_state = 1; } /*