Der nachfolgende Code hat mal funktioniert.
Dann kamen einige Updates und nun geht er nicht mehr. Ich habe keine Ahnung warum. Selbst bei ganz einfachen Bedingungen, wie z.B. Zeitfenster oder Temperaturschwellwert kommen die Ausgänge nicht. Werden auch im Log nicht angezeigt, dass sie ON sind.
Jemand eine Idee ?
captive_portal:
time:
- platform: sntp
timezone: "Europe/Berlin"
id: sntp_time
servers:
- 0.pool.ntp.org
- 1.pool.ntp.org
- 2.pool.ntp.org
on_time:
- seconds: /10 # needs to be set, otherwise every second this is triggered!
minutes: '*' # Trigger every minute
then:
lambda: !lambda |-
auto time = id(sntp_time).now();
int t_now = parse_number<int>(id(sntp_time).now().strftime("%H%M")).value();
float temp_water = static_cast<int>(id(Wassertemperatur).state);
float temp_outside = static_cast<int>(id(oat).state);
if ((id(allesaus).state) == true)
{
id(fp).turn_off();
id(wp).turn_off();
}
if ((id(allesaus).state) == false)
{
if (((t_now >= 800) && (t_now <= 1100)) || ((t_now >= 1300) && (t_now <= 1600)))
{
id(fp).turn_on();
}
else if (((t_now >= 900) && (t_now <= 1600)) && (temp_water >=28))
{
id(fp).turn_on();
}
else if ((id(multitab).state == "active") || (id(filterpumpe).state == true))
{
id(fp).turn_on();
}
else
{
id(fp).turn_off();
}
}
if ((id(durchfluss).state == true) && ((temp_outside >=27) || (id(waermepumpe).state == true)))
{
id(wp).turn_on();
}
else
{
id(wp).turn_off();
}
# analoge Eingänge
i2c:
sda: 4
scl: 5
scan: true
id: bus_a
ads1115:
- address: 0x48
sensor:
- platform: ads1115
multiplexer: 'A0_GND'
gain: 1.024
name: "ADS1115 Channel A0-GND"
id: Wassertemperatur
filters:
- calibrate_linear:
- 0.001 -> 0
- 0.667 -> 40
unit_of_measurement: "°C"
accuracy_decimals: 0
- platform: homeassistant
name: "OAT"
id: oat
entity_id: sensor.aquarea_ads1115_channel_a0_gnd
filters:
heartbeat: 10s
# digitale Eingänge
binary_sensor:
- platform: gpio
pin: D0
name: "Durchfluss"
id: durchfluss
- platform: gpio
pin: D5
name: "RM Wärmepumpe"
id: rmwp
- platform: homeassistant
name: "Alles Aus"
id: allesaus
entity_id: input_boolean.pool_alles_aus
- platform: homeassistant
name: "FP Ein"
id: filterpumpe
entity_id: input_boolean.pool_filterpumpe
- platform: homeassistant
name: "WP Ein"
id: waermepumpe
entity_id: input_boolean.pool_waermepumpe
text_sensor:
- platform: homeassistant
name: "Multitab"
id: multitab
entity_id: timer.pool_multitab
# digitale Ausgänge
switch:
- platform: gpio
pin: D6
name: "Filterpumpe Ein"
id: fp
- platform: gpio
pin: D7
name: "Wärmepumpe Ein"
id: wp
EDIT: ich habe herausgefunden, wenn ich als Zeitplatform homeassistant nehme, dann funktioniert es. Aber wieso geht SNTP nicht mehr ?