rule1
    ON SerialReceived#Status DO var1 %value% ENDON
    ON SerialReceived#TankLevel DO var2 %value% ENDON
    ON SerialReceived#TankPump DO var3 %value% ENDON
    ON SerialReceived#RefillPump DO var4 %value% ENDON
    ON SerialReceived#RefillEmpty DO var5 %value% ENDON
    ON SerialReceived#RefillCooldown DO var6 %value% ENDON
    ON SerialReceived#HourlyHist DO var7 %value% ENDON
    ON SerialReceived#DailyHist DO var8 %value% ENDON
    ON SerialReceived#Status DO publish /floatpump-stats {"Status": "%var1%", "TankLevel": "%var2%", "TankPump": "%var3%", "RefillPump": "%var4%", "RefillEmpty": "%var5%", "RefillCooldown": "%var6%", "HourlyHist": "%var7%", "DailyHist": "%var8%"} ENDON
rule1 1

rule2
    ON System#Boot DO SerialBuffer 520 ENDON
rule2 1

//This Rule wont work -> ist too long
//Either paste single pulish lines once or configure device via yaml

rule3
    ON System#Boot DO publish homeassistant/binary_sensor/floatpump1/config {"name": "FloatPump Controller Status", "unique_id": "floatpump-status", "state_topic": "/floatpump-stats", "payload_on": "TRUE", "payload_off": "FALSE", "value_template": "{{ value_json.Status }}", "device": { "name": "FloatPUMP Controller", "mf": "Robin Dietzel (robtor.de)", "cns": [["mac", "BC:DD:C2:26:39:36"]] }} ENDON
    ON System#Boot DO publish homeassistant/binary_sensor/floatpump2/config {"name": "Tank Pump", "unique_id": "floatpump-tankpump-status", "icon": "mdi:water-pump", "state_topic": "/floatpump-stats", "payload_on": "TRUE", "payload_off": "FALSE", "value_template": "{{ value_json.TankPump }}", "device": { "name": "FloatPUMP Controller", "mf": "Robin Dietzel (robtor.de)", "cns": [["mac", "BC:DD:C2:26:39:36"]] }} ENDON
    ON System#Boot DO publish homeassistant/binary_sensor/floatpump3/config {"name": "Refill Pump", "unique_id": "floatpump-refillpump-status", "icon": "mdi:water-sync", "state_topic": "/floatpump-stats", "payload_on": "TRUE", "payload_off": "FALSE", "value_template": "{{ value_json.RefillPump }}", "device": { "name": "FloatPUMP Controller", "mf": "Robin Dietzel (robtor.de)", "cns":[["mac", "BC:DD:C2:26:39:36"]] }} ENDON
    ON System#Boot DO publish homeassistant/binary_sensor/floatpump4/config {"name": "Refill Source Empty", "unique_id": "floatpump-refillempty-status", "icon": "mdi:water-alert-outline", "state_topic": "/floatpump-stats", "payload_on": "TRUE", "payload_off": "FALSE", "value_template": "{{ value_json.RefillEmpty }}", "device": { "name": "FloatPUMP Controller", "mf": "Robin  Dietzel (robtor.de)", "cns": [["mac", "BC:DD:C2:26:39:36"]] }} ENDON
    ON System#Boot DO publish homeassistant/sensor/floatpump5/config {"name": "Tank Water Level", "unique_id": "floatpump-tanklevel", "icon": "mdi:car-coolant-level", "unit_of_measurement": "%", "state_topic": "/floatpump-stats", "value_template": "{{ value_json.TankLevel }}", "device": { "name": "FloatPUMP Controller", "mf": "Robin Dietzel (robtor.de)", "cns": [["mac", "BC:DD:C2:26:39:36"]] }} ENDON
    ON System#Boot DO publish homeassistant/sensor/floatpump6/config {"name": "Refill Cooldown", "unique_id": "floatpump-refillcooldown", "icon": "mdi:clock-alert-outline", "unit_of_measurement": "min", "state_topic": "/floatpump-stats", "value_template": "{{ value_json.RefillCooldown }}", "device": { "name": "FloatPUMP Controller", "mf": "Robin Dietzel (robtor.de)", "cns": [["mac", "BC:DD:C2:26:39:36"]] }} ENDON
    ON System#Boot DO publish homeassistant/sensor/floatpump7/config {"name": "Hourly Stats", "unique_id": "floatpump-hourly-stats", "icon": "mdi:chart-line", "unit_of_measurement": "%", "state_topic": "/floatpump-stats", "value_template": "{{ value_json.HourlyHist }}", "device": { "name": "FloatPUMP Controller", "mf": "Robin Dietzel (robtor.de)", "cns": [["mac", "BC:DD:C2:26:39:36"]] }} ENDON
    ON System#Boot DO publish homeassistant/sensor/floatpump8/config {"name": "Daily Stats", "unique_id": "floatpump-daily-stats", "icon": "mdi:chart-line", "unit_of_measurement": "%", "state_topic": "/floatpump-stats", "value_template": "{{ value_json.DailyHist }}", "device": { "name": "FloatPUMP Controller", "mf": "Robin Dietzel (robtor.de)", "cns": [["mac", "BC:DD:C2:26:39:36"]] }} ENDON
rule3 1