PowerStationMonitor/openhab2/rules/dc_supply_history.rules

22 lines
672 B
Plaintext

rule "Send datavalues from DC Supply to history if output is powered on"
when
Time cron "*/10 * * ? * * *"
then
if (DC_Supply_PowerOnOff.state == ON) {
DC_Supply_Voltage.persist("influxdb")
DC_Supply_Current.persist("influxdb")
DC_Supply_Power.persist("influxdb")
DC_Supply_Amperehours.persist("influxdb")
DC_Supply_Watthours.persist("influxdb")
DC_Supply_Temp_Internal.persist("influxdb")
}
end
rule "Send external temperature if connected to history"
when
Time cron "*/10 * * ? * * *"
then
if (DC_Supply_Temp_External_Active.state == ON) {
DC_Supply_Temp_External.persist("influxdb")
}
end