Skip to content

Commit

Permalink
Merge pull request #7 from Neuroquila-n8fall/development
Browse files Browse the repository at this point in the history
Merge Feature and Optimization Overhaul
  • Loading branch information
Neuroquila-n8fall authored Sep 28, 2022
2 parents 8ed9dcb + e4db647 commit 2085434
Show file tree
Hide file tree
Showing 46 changed files with 3,881 additions and 1,702 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
*/arduino_secrets.cpp
*scratchpad.md
*/scratchpad.md
data/configuration.json
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
18 changes: 18 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"files.associations": {
"string": "cpp",
"array": "cpp",
"deque": "cpp",
"vector": "cpp",
"string_view": "cpp",
"unordered_map": "cpp",
"new": "cpp",
"istream": "cpp",
"ostream": "cpp",
"functional": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"cstring": "cpp"
}
}
32 changes: 11 additions & 21 deletions Home Assistant/input_values.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,26 @@
input_boolean:
heizung_betrieb:
name: Heizungsbetrieb
initial: true
heizung_boost:
name: Boost
initial: false
heizung_fastheatup:
name: Schnellaufheizung
initial: false
heizung_dynamicadaption:
name: Dynamische Adaption
initial: false
heizung_ventilskalierung:
name: Ventilskalierung
initial: false

input_number:
heizung_fusspunkt:
name: "Fußpunkt Heizung"
min: -30
max: 30
step: 0.5
mode: slider
mode: box
unit_of_measurement: "°C"
icon: mdi:ray-start
heizung_endpunkt:
name: "Endpunkt Heizung"
min: 0
max: 75
step: 0.5
mode: slider
mode: box
unit_of_measurement: "°C"
icon: mdi:ray-end
heizung_minimum:
name: "Minimale Vorlauftemperatur Heizung"
min: 0
max: 75
step: 0.5
mode: slider
mode: box
unit_of_measurement: "°C"
icon: mdi:thermometer-low
heizung_boostdauer:
Expand Down Expand Up @@ -69,4 +52,11 @@ input_number:
max: 100
mode: box
unit_of_measurement: "%"
icon: mdi:arrow-collapse-right
icon: mdi:arrow-collapse-right
heizung_gewichtung_ventile:
name: "Gewichtung Ventilöffnung EG-OG"
min: 0
max: 100
mode: slider
unit_of_measurement: "%"
icon: mdi:scale
124 changes: 124 additions & 0 deletions Home Assistant/mqtt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
mqtt:
broker: 1.2.3.4
port: 1883
username: mqtt
password: mqttpass
sensor:
- name: "Cerasmarter Errorlog Message"
unique_id: "CerasmarterErrorLog"
state_topic: "cerasmarter/log"
value_template: >-
{% set value = value_json.lvl | int %}
{% if value == 0 %}
{% set errLvl = "Error" %}
{% elif value == 1 %}
{% set errLvl = "Warning" %}
{% elif value == 2 %}
{% set errLvl = "Info" %}
{% elif value == 3 %}
{% set errLvl = "Debug" %}
{% elif value == 4 %}
{% set errLvl = "Verbose" %}
{% endif %}
[{{ errLvl }}][{{value_json.fnc}}]:{{value_json.msg}}
### Heating Temperatures 'cerasmarter/heating/parameters'
- name: "Aktuelle Vorlauftemperatur Heizung"
unique_id: "HeatingInformation_Temperatures_FeedCurrent"
state_topic: "cerasmarter/heating/values"
unit_of_measurement: "°C"
value_template: "{{ value_json.FeedCurrent }}"
- name: "Maximale Vorlauftemperatur Heizung"
unique_id: "HeatingInformation_Temperatures_FeedMaximum"
state_topic: "cerasmarter/heating/values"
unit_of_measurement: "°C"
value_template: "{{ value_json.FeedMaximum }}"
- name: "Soll-Vorlauftemperatur Heizung"
unique_id: "HeatingInformation_Temperatures_FeedSetpoint"
state_topic: "cerasmarter/heating/values"
unit_of_measurement: "°C"
value_template: "{{ value_json.FeedSetpoint }}"
- name: "Außentemperaturfühler Heizung"
unique_id: "HeatingInformation_Temperatures_Outside"
state_topic: "cerasmarter/heating/values"
unit_of_measurement: "°C"
value_template: "{{ value_json.Outside }}"
- name: "Heizung Boost"
unique_id: "HeatingInformation_Status_Boost"
state_topic: "cerasmarter/heating/values"
value_template: "{{ value_json.Boost }}"
force_update: true
- name: "Heizung Boost Restdauer"
unique_id: "HeatingInformation_Status_BoostRemaining"
state_topic: "cerasmarter/heating/values"
value_template: "{{ value_json.BoostTimeLeft }}"
unit_of_measurement: "Sekunden"
force_update: true
- name: "Heizung Heizbetrieb"
unique_id: "HeatingInformation_Status_Working"
state_topic: "cerasmarter/heating/values"
value_template: "{{ value_json.Working }}"
force_update: true
- name: "Heizung Schnellaufheizung"
unique_id: "HeatingInformation_Status_FastHeatup"
state_topic: "cerasmarter/heating/values"
value_template: "{{ value_json.FastHeatup }}"
force_update: true
- name: "Heizung Pumpe"
unique_id: HeatingInformation_Status_Pump
state_topic: "cerasmarter/heating/values"
value_template: "{{ value_json.Pump }}"
force_update: true
- name: "Heizung Saisonaler Betriebsmodus"
unique_id: "HeatingInformation_Status_Season"
state_topic: "cerasmarter/heating/values"
value_template: "{{ value_json.Season }}"
force_update: true
### Auxilary Sensors 'cerasmarter/auxilary/parameters'
- name: "Externe Vorlauftemperatur"
unique_id: "HeatingInformation_AuxilaryTemperatures_Feed"
state_topic: "cerasmarter/auxilary/values"
unit_of_measurement: "°C"
value_template: "{{ value_json.Feed.Temperature }}"
- name: "Externe Rücklauftemperatur"
unique_id: "HeatingInformation_AuxilaryTemperatures_Return"
state_topic: "cerasmarter/auxilary/values"
unit_of_measurement: "°C"
value_template: "{{ value_json.Return.Temperature }}"
- name: "Externe Abgastemperatur"
unique_id: "HeatingInformation_AuxilaryTemperatures_Exhaust"
state_topic: "cerasmarter/auxilary/values"
unit_of_measurement: "°C"
value_template: "{{ value_json.Exhaust.Temperature }}"
- name: "Externe Umgebungstemperatur"
unique_id: "HeatingInformation_AuxilaryTemperatures_Ambient"
state_topic: "cerasmarter/auxilary/values"
unit_of_measurement: "°C"
value_template: "{{ value_json.Ambient.Temperature }}"
### Auxilary Sensors 'cerasmarter/auxilary/parameters'
- name: "Externe Vorlauftemperatur Status"
unique_id: "HeatingInformation_AuxilaryTemperatures_FeedReachable"
state_topic: "cerasmarter/auxilary/values"
value_template: "{{ iif(value_json.Feed.Reachable == 'true', 'yes', 'no', 'unknown') }}"
- name: "Externe Rücklauftemperatur Status"
unique_id: "HeatingInformation_AuxilaryTemperatures_ReturnReachable"
state_topic: "cerasmarter/auxilary/values"
value_template: "{{ iif(value_json.Return.Reachable == 'true', 'yes', 'no', 'unknown') }}"
- name: "Externe Abgastemperatur Status"
unique_id: "HeatingInformation_AuxilaryTemperatures_ExhaustReachable"
state_topic: "cerasmarter/auxilary/values"
value_template: "{{ iif(value_json.Exhaust.Reachable == 'true', 'yes', 'no', 'unknown') }}"
- name: "Externe Umgebungstemperatur Status"
unique_id: "HeatingInformation_AuxilaryTemperatures_AmbientReachable"
state_topic: "cerasmarter/auxilary/values"
value_template: "{{ iif(value_json.Ambient.Reachable == 'true', 'yes', 'no', 'unknown') }}"
### Status 'cerasmarter/status'
- name: "Heizung Brenner"
unique_id: "HeatingInformation_Status_GasBurner"
state_topic: "cerasmarter/status"
value_template: "{{ value_json.GasBurner }}"
force_update: true
- name: "Heizung Fehler"
unique_id: "HeatingInformation_Status_Error"
state_topic: "cerasmarter/status"
value_template: "{{ value_json.Error }}"
force_update: true
97 changes: 31 additions & 66 deletions Home Assistant/scripts.yaml
Original file line number Diff line number Diff line change
@@ -1,80 +1,45 @@
# This script sets all parameters by sending a json formatted file to the broker
mqtt_set_heizungsparameter:
alias: Heizungsparameter setzen
icon: mdi:send
sequence:
- service: mqtt.publish
data:
topic: heizung/parameters/fusspunkt
payload_template: '{{ states(''input_number.heizung_fusspunkt'') | int }}'
- service: mqtt.publish
data:
topic: heizung/parameters/endpunkt
payload_template: '{{ states(''input_number.heizung_endpunkt'') | int }}'
- service: mqtt.publish
data:
topic: heizung/parameters/minimum
payload_template: '{{ states(''input_number.heizung_minimum'') | int }}'
- service: mqtt.publish
data:
topic: heizung/parameters/boostduration
payload_template: '{{ states(''input_number.heizung_boostdauer'') | int }}'
- service: mqtt.publish
data:
topic: heizung/control/operation
payload_template: '{% set betrieb = states(''input_boolean.heizung_betrieb'')
%} {% if betrieb == ''on'' %} 1 {% else %} 0 {% endif %}'
- service: mqtt.publish
data:
topic: heizung/parameters/ambient
payload_template: '{{ states(''sensor.wandthermostat_kueche_temperature'') |
float }}'
- service: mqtt.publish
data:
topic: heizung/parameters/targetambient
payload_template: '{{ states(''input_number.heizung_zieltemperatur'') | float }}'
- service: mqtt.publish
data:
topic: heizung/parameters/adaption
payload_template: '{{ states(''input_number.heizung_adaption'') | int }}'
- service: mqtt.publish
data:
payload_template: '{% set dynadapt = states(''input_boolean.heizung_dynamicadaption'')
%} {% if dynadapt == ''on'' %} 1 {% else %} 0 {% endif %}'
topic: heizung/parameters/dynadapt
- service: mqtt.publish
data:
payload_template: '{% set scaling = states(''input_boolean.heizung_ventilskalierung'')
%} {% if scaling == ''on'' %} 1 {% else %} 0 {% endif %}'
topic: heizung/parameters/valvescaling
- service: mqtt.publish
data:
payload_template: '{{ states(''input_number.heizung_ventilskalierung_max'')
| int }}'
topic: heizung/parameters/valvemax
- service: mqtt.publish
data:
payload_template: '{{ states(''sensor.ventiloffnung_minmax'') | int }}'
topic: heizung/parameters/valvecurrent
mode: single
mqtt_set_heizungboost:
alias: Boost
icon: mdi:fire
topic: cerasmarter/heating/parameters
payload_template: '{
"Enabled": {{ iif(is_state(''input_boolean.heizung_betrieb'', ''on''), 1, 0) }},
"FeedSetpoint": {{ states(''input_number.heizung_sollvorlauf_manuell'') | int(default=0) }},
"FeedBaseSetpoint": {{ states(''input_number.heizung_fusspunkt'') | int(default=0) }},
"FeedCutOff": {{ states(''input_number.heizung_endpunkt'') | int(default=0) }},
"FeedMinimum": {{ states(''input_number.heizung_minimum'') | int(default=0) }},
"AuxilaryTemperature": {{ states(''sensor.temperatur_und_luftfeuchte_aussen_actual_temperature'') | float(default=0) }},
"AmbientTemperature": {{ state_attr(''climate.thermostat_og_kochen_und_essen'',''current_temperature'') | float(default=0) }},
"TargetAmbientTemperature": {{ states(''input_number.heizung_zieltemperatur'') | float(default=0) }},
"OnDemandBoostDuration": {{ states(''input_number.heizung_boostdauer'') | int(default=0) }},
"Adaption": {{ states(''input_number.heizung_adaption'') | int(default=0) }},
"ValveScaling": {{ iif(is_state(''input_boolean.heizung_ventilskalierung'', ''on''), 1, 0) }},
"ValveScalingMaxOpening": {{ states(''input_number.heizung_ventilskalierung_max'') | int(default=0) }},
"ValveScalingOpening": {{ states(''sensor.average_weighted_valve'') | int(default=0) }},
"DynamicAdaption": {{ iif(is_state(''input_boolean.heizung_dynamicadaption'', ''on''), 1, 0) }},
"OverrideSetpoint": {{ iif(is_state(''input_boolean.heizung_override'', ''on''), 1, 0) }}
}'
# This Script will trigger the boost function.
boost_heizung:
alias: Boost Heizung
sequence:
- service: homeassistant.toggle
entity_id: input_boolean.heizung_boost
- service: mqtt.publish
data:
topic: heizung/control/boost
payload_template: '{% set boost = states(''input_boolean.heizung_boost'') %}
{% if boost == ''on'' %} 1 {% else %} 0 {% endif %}'
topic: cerasmarter/boost/set
payload: '1'
mode: single
mqtt_set_heizungfast:
icon: mdi:fire-circle
# This Script will trigger the fast heatup function.
fastheatup_heizung:
alias: Schnellaufheizung
icon: mdi:fast-forward
sequence:
- service: mqtt.publish
data:
topic: heizung/control/fastheatup
payload_template: '{% set fast = states(''input_boolean.heizung_fastheatup'')
%} {% if fast == ''on'' %} 1 {% else %} 0 {% endif %}'
mode: single
topic: cerasmarter/fastheatup/set
payload: '1'
mode: single
icon: mdi:fire-circle
Loading

0 comments on commit 2085434

Please sign in to comment.