From a1c6aefe92b29775f629d288fe49de8314623322 Mon Sep 17 00:00:00 2001 From: Wobbe <62996429+huizebruin@users.noreply.github.com> Date: Tue, 25 Jun 2024 19:02:52 +0200 Subject: [PATCH 1/2] For the update v3.6.0 * For the update v3.6.0 - the update files of esphome --- esphome/components/DSZ12D.yml | 208 +++++++------- esphome/components/LEM022SJ.yml | 206 +++++++------- esphome/components/basis.yaml | 205 +++++++------- esphome/components/gasenwater-update.yml | 4 + esphome/components/gaspuls.yaml | 266 +++++++++--------- esphome/components/kwh-water-test.yml | 176 ++++++------ esphome/components/kwhpuls-resistor.yml | 226 +++++++-------- esphome/components/kwhpuls.yml | 214 +++++++------- esphome/components/s0-watermeter.yaml | 216 +++++++------- esphome/components/s0tool-dsz12d-update.yml | 4 + esphome/components/s0tool-kwh-puls-update.yml | 4 + .../s0tool-kwh-water-test-update.yml | 4 + esphome/components/s0tool-lem022sj-update.yml | 4 + .../s0tool-s0-watermeter-update.yml | 4 + esphome/components/s0tool-sdm72d-update.yml | 4 + .../s0tool-standard-internal-update.yml | 4 + esphome/components/s0tool-standard-update.yml | 4 + .../components/s0tool-watermeter-update.yml | 4 + .../components/s0tool-wsz15d32a-update.yml | 4 + esphome/components/sdm72d.yml | 216 +++++++------- esphome/components/tcrt5000.yaml | 168 +++++------ esphome/components/water-resistor.yaml | 234 +++++++-------- esphome/components/watermeter.yaml | 256 ++++++++--------- esphome/components/watermeter_flux.yaml | 242 ++++++++-------- esphome/components/wsz15d32a.yml | 218 +++++++------- 25 files changed, 1572 insertions(+), 1523 deletions(-) create mode 100644 esphome/components/gasenwater-update.yml create mode 100644 esphome/components/s0tool-dsz12d-update.yml create mode 100644 esphome/components/s0tool-kwh-puls-update.yml create mode 100644 esphome/components/s0tool-kwh-water-test-update.yml create mode 100644 esphome/components/s0tool-lem022sj-update.yml create mode 100644 esphome/components/s0tool-s0-watermeter-update.yml create mode 100644 esphome/components/s0tool-sdm72d-update.yml create mode 100644 esphome/components/s0tool-standard-internal-update.yml create mode 100644 esphome/components/s0tool-standard-update.yml create mode 100644 esphome/components/s0tool-watermeter-update.yml create mode 100644 esphome/components/s0tool-wsz15d32a-update.yml diff --git a/esphome/components/DSZ12D.yml b/esphome/components/DSZ12D.yml index 8be8e75..331f6bc 100644 --- a/esphome/components/DSZ12D.yml +++ b/esphome/components/DSZ12D.yml @@ -1,104 +1,104 @@ -substitutions: - impulslengte: "30ms" - -# # ⬇ Enable Home Assistant API ⬇ # -api: - services: - - service: meterstand_kwh - variables: - meter_value: float - then: - - globals.set: - id: initial_kwh_usage - value: !lambda "return ( meter_value ) ;" - - globals.set: - id: total_kwh_pulses - value: "0" - -globals: - - id: initial_kwh_usage - type: float - restore_value: yes - initial_value: '00010' - - id: total_kwh_pulses - type: int - restore_value: yes - -number: - - platform: template - id: Select_pulse_rate - name: "Pulsrate kWh" - optimistic: true - mode: box - min_value: '10' - max_value: '4000' - step: '10' - restore_value: yes - initial_value: '1000' - -binary_sensor: - #------------------------# kwh #------------------------# - - platform: gpio - id: kwh_sensor_status - name: "kWh sensor status" - internal: False - pin: - number: D5 - allow_other_uses: true - mode: - input: true - on_press: - - then: - lambda: id(total_kwh_pulses) += 1; -#------------------------# Kwh meter S0 poort 1 #------------------------# -sensor: -# ⬇ kwh meter s0 ⬇ # - - platform: pulse_meter - pin: - number: D5 - allow_other_uses: true - name: "Actuele energie" - id: actual_power - icon: "mdi:flash" - internal_filter: ${impulslengte} - accuracy_decimals: 0 #3 - unit_of_measurement: "W" #'kW' - state_class: measurement - device_class: power - filters: - lambda: return x * (60.0 / id(Select_pulse_rate).state)* 1000 ; - -# ⬇ Totaal opgebracht ⬇ # - total: - unit_of_measurement: 'kWh' - name: "Totaal opgebracht" - id: W_opbrengst_totaal - state_class: total_increasing - device_class: energy - icon: "mdi:flash" - accuracy_decimals: 3 - filters: - - lambda: return id (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); - # - lambda: return x * (1.0 / id(Select_pulse_rate).state); - - -# ⬇ Kwh meterstand ⬇ stand bij benadering # - - platform: template - id: kwh_total - name: "Actuele meterstand" - state_class: "total_increasing" - device_class: energy - icon: "mdi:flash" - update_interval: 1s - unit_of_measurement: 'kWh' - accuracy_decimals: 3 - lambda: return id(initial_kwh_usage) + (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); - -# ⬇ kwh pulses only web interface for debugging ⬇ # - - platform: template - id: kwh_pulses - name: "kwh pulses totaal" - state_class: "total_increasing" - lambda: return id(total_kwh_pulses); - accuracy_decimals: 0 - internal: True +substitutions: + impulslengte: "30ms" + +# # ⬇ Enable Home Assistant API ⬇ # +api: + services: + - service: meterstand_kwh + variables: + meter_value: float + then: + - globals.set: + id: initial_kwh_usage + value: !lambda "return ( meter_value ) ;" + - globals.set: + id: total_kwh_pulses + value: "0" + +globals: + - id: initial_kwh_usage + type: float + restore_value: yes + initial_value: '00010' + - id: total_kwh_pulses + type: int + restore_value: yes + +number: + - platform: template + id: Select_pulse_rate + name: "Pulsrate kWh" + optimistic: true + mode: box + min_value: '10' + max_value: '4000' + step: '10' + restore_value: yes + initial_value: '1000' + +binary_sensor: + #------------------------# kwh #------------------------# + - platform: gpio + id: kwh_sensor_status + name: "kWh sensor status" + internal: False + pin: + number: D5 + allow_other_uses: true + mode: + input: true + on_press: + - then: + lambda: id(total_kwh_pulses) += 1; +#------------------------# Kwh meter S0 poort 1 #------------------------# +sensor: +# ⬇ kwh meter s0 ⬇ # + - platform: pulse_meter + pin: + number: D5 + allow_other_uses: true + name: "Actuele energie" + id: actual_power + icon: "mdi:flash" + internal_filter: ${impulslengte} + accuracy_decimals: 0 #3 + unit_of_measurement: "W" #'kW' + state_class: measurement + device_class: power + filters: + lambda: return x * (60.0 / id(Select_pulse_rate).state)* 1000 ; + +# ⬇ Totaal opgebracht ⬇ # + total: + unit_of_measurement: 'kWh' + name: "Totaal opgebracht" + id: W_opbrengst_totaal + state_class: total_increasing + device_class: energy + icon: "mdi:flash" + accuracy_decimals: 3 + filters: + - lambda: return id (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); + # - lambda: return x * (1.0 / id(Select_pulse_rate).state); + + +# ⬇ Kwh meterstand ⬇ stand bij benadering # + - platform: template + id: kwh_total + name: "Actuele meterstand" + state_class: "total_increasing" + device_class: energy + icon: "mdi:flash" + update_interval: 1s + unit_of_measurement: 'kWh' + accuracy_decimals: 3 + lambda: return id(initial_kwh_usage) + (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); + +# ⬇ kwh pulses only web interface for debugging ⬇ # + - platform: template + id: kwh_pulses + name: "kwh pulses totaal" + state_class: "total_increasing" + lambda: return id(total_kwh_pulses); + accuracy_decimals: 0 + internal: True diff --git a/esphome/components/LEM022SJ.yml b/esphome/components/LEM022SJ.yml index f1db943..6976e6c 100644 --- a/esphome/components/LEM022SJ.yml +++ b/esphome/components/LEM022SJ.yml @@ -1,104 +1,104 @@ -# substitutions: -# impulslengte: "50ms" - -# # ⬇ Enable Home Assistant API ⬇ # -api: - services: - - service: meterstand_kwh - variables: - meter_value: float - then: - - globals.set: - id: initial_kwh_usage - value: !lambda "return ( meter_value ) ;" - - globals.set: - id: total_kwh_pulses - value: "0" - -globals: - - id: initial_kwh_usage - type: float - restore_value: yes - initial_value: '00010' - - id: total_kwh_pulses - type: int - restore_value: yes - -number: - - platform: template - id: Select_pulse_rate - name: "Pulsrate kWh" - optimistic: true - mode: box - min_value: '10' - max_value: '4000' - step: '10' - restore_value: yes - initial_value: '400' - -binary_sensor: - #------------------------# kwh #------------------------# - - platform: gpio - id: kwh_sensor_status - name: "kWh sensor status" - internal: False - pin: - number: D5 - allow_other_uses: true - mode: - input: true - on_press: - - then: - lambda: id(total_kwh_pulses) += 1; -#------------------------# Kwh meter S0 poort 1 #------------------------# -sensor: -# ⬇ kwh meter s0 ⬇ # - - platform: pulse_meter - pin: - number: D5 - allow_other_uses: true - name: "Actuele energie" - id: actual_power - icon: "mdi:flash" - # internal_filter: ${impulslengte} - accuracy_decimals: 0 #3 - unit_of_measurement: "W" #'kW' - state_class: measurement - device_class: power - filters: - lambda: return x * (60.0 / id(Select_pulse_rate).state)* 1000 ; - -# ⬇ Totaal opgebracht ⬇ # - total: - unit_of_measurement: 'kWh' - name: "Totaal opgebracht" - id: W_opbrengst_totaal - state_class: total_increasing - device_class: energy - icon: "mdi:flash" - accuracy_decimals: 3 - filters: - - lambda: return id (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); - # - lambda: return x * (1.0 / id(Select_pulse_rate).state); - - -# ⬇ Kwh meterstand ⬇ stand bij benadering # - - platform: template - id: kwh_total - name: "Actuele meterstand" - state_class: "total_increasing" - device_class: energy - icon: "mdi:flash" - update_interval: 1s - unit_of_measurement: 'kWh' - accuracy_decimals: 3 - lambda: return id(initial_kwh_usage) + (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); - -# ⬇ kwh pulses only web interface for debugging ⬇ # - - platform: template - id: kwh_pulses - name: "kwh pulses totaal" - state_class: "total_increasing" - lambda: return id(total_kwh_pulses); - accuracy_decimals: 0 +# substitutions: +# impulslengte: "50ms" + +# # ⬇ Enable Home Assistant API ⬇ # +api: + services: + - service: meterstand_kwh + variables: + meter_value: float + then: + - globals.set: + id: initial_kwh_usage + value: !lambda "return ( meter_value ) ;" + - globals.set: + id: total_kwh_pulses + value: "0" + +globals: + - id: initial_kwh_usage + type: float + restore_value: yes + initial_value: '00010' + - id: total_kwh_pulses + type: int + restore_value: yes + +number: + - platform: template + id: Select_pulse_rate + name: "Pulsrate kWh" + optimistic: true + mode: box + min_value: '10' + max_value: '4000' + step: '10' + restore_value: yes + initial_value: '400' + +binary_sensor: + #------------------------# kwh #------------------------# + - platform: gpio + id: kwh_sensor_status + name: "kWh sensor status" + internal: False + pin: + number: D5 + allow_other_uses: true + mode: + input: true + on_press: + - then: + lambda: id(total_kwh_pulses) += 1; +#------------------------# Kwh meter S0 poort 1 #------------------------# +sensor: +# ⬇ kwh meter s0 ⬇ # + - platform: pulse_meter + pin: + number: D5 + allow_other_uses: true + name: "Actuele energie" + id: actual_power + icon: "mdi:flash" + # internal_filter: ${impulslengte} + accuracy_decimals: 0 #3 + unit_of_measurement: "W" #'kW' + state_class: measurement + device_class: power + filters: + lambda: return x * (60.0 / id(Select_pulse_rate).state)* 1000 ; + +# ⬇ Totaal opgebracht ⬇ # + total: + unit_of_measurement: 'kWh' + name: "Totaal opgebracht" + id: W_opbrengst_totaal + state_class: total_increasing + device_class: energy + icon: "mdi:flash" + accuracy_decimals: 3 + filters: + - lambda: return id (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); + # - lambda: return x * (1.0 / id(Select_pulse_rate).state); + + +# ⬇ Kwh meterstand ⬇ stand bij benadering # + - platform: template + id: kwh_total + name: "Actuele meterstand" + state_class: "total_increasing" + device_class: energy + icon: "mdi:flash" + update_interval: 1s + unit_of_measurement: 'kWh' + accuracy_decimals: 3 + lambda: return id(initial_kwh_usage) + (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); + +# ⬇ kwh pulses only web interface for debugging ⬇ # + - platform: template + id: kwh_pulses + name: "kwh pulses totaal" + state_class: "total_increasing" + lambda: return id(total_kwh_pulses); + accuracy_decimals: 0 internal: True \ No newline at end of file diff --git a/esphome/components/basis.yaml b/esphome/components/basis.yaml index 86406d7..9af78f9 100644 --- a/esphome/components/basis.yaml +++ b/esphome/components/basis.yaml @@ -1,100 +1,105 @@ -# Delen en bewerken mag maar laat deze eerste regels staan. -# Bron : https://s0tool.nl -# Bron File : https://github.com/huizebruin/s0tool/tree/main/esphome -# © Huizebruin.nl & S0tool.nl -substitutions: - device_description: ${name} gemaakt door s0tool.nl versie ${vdate}. - vdate: "v24.02.23.36" - date: "20-06-2024" - -preferences: - flash_write_interval: 120min - -improv_serial: - -wifi: - ap: - -web_server: - port: 80 - -captive_portal: - -# ⬇ Enable logging ⬇ # -logger: - level: INFO - esp8266_store_log_strings_in_flash: false - -ota: - - platform: esphome -time: - - platform: homeassistant - id: time_homeassistant - on_time_sync: - - component.update: S0tool_uptime_timestamp -# https://esphome.io/components/safe_mode need for ESPHome v2024.6.x -safe_mode: - -sensor: -#------------------------# sensoren #------------------------# - - platform: uptime - id: S0tool_uptime - - - platform: template - id: S0tool_uptime_timestamp - name: "${name} online sinds" - device_class: "timestamp" - accuracy_decimals: 0 - update_interval: never - icon: 'mdi:clock-start' - entity_category: diagnostic - lambda: |- - static float timestamp = ( - id(time_homeassistant).utcnow().timestamp - id(S0tool_uptime).state - ); - return timestamp; - -# ⬇ versie verbinding informatie sensoren voor in ha ⬇ # - # WiFi signal - - platform: wifi_signal - name: "${name} - WiFi Signal" - update_interval: 120s - -text_sensor: - - platform: template - name: "s0tool_versie" - id: s0tool_versie - icon: 'mdi:alpha-v-circle-outline' - update_interval: 6h - entity_category: diagnostic - lambda: |- - return {"${vdate}"}; - - - platform: wifi_info - ip_address: - name: "${name} IP-adres" - id: s0tool_ip_adres - icon: mdi:ip-network - - mac_address: - name: "${name} Mac-adres" - id: s0tool_mac_adres - icon: mdi:folder-key-network-outline - -# restart button # -button: - - platform: restart - name: "${name} Restart device" - entity_category: diagnostic - -# Factory Reset Switch from ESPHome v2022.09 - - platform: factory_reset - name: "Restart with Factory Default Settings" - entity_category: diagnostic - disabled_by_default: True - - # safe mode button - - platform: safe_mode - name: "Safe Mode" - entity_category: diagnostic - disabled_by_default: True +# Delen en bewerken mag maar laat deze eerste regels staan. +# Bron : https://s0tool.nl +# Bron File : https://github.com/huizebruin/s0tool/tree/main/esphome +# © Huizebruin.nl & S0tool.nl +substitutions: + device_description: ${name} gemaakt door s0tool.nl versie ${vdate}. + vdate: "v3.6.0" # From 23-06-2024 new version + date: "24-06-2024" + +preferences: + flash_write_interval: 120min + +improv_serial: + +wifi: + ap: + +web_server: + port: 80 + +captive_portal: + +# ⬇ Enable logging ⬇ # +logger: + level: INFO + tx_buffer_size: 100 + esp8266_store_log_strings_in_flash: false + +ota: + - platform: esphome + - platform: http_request +http_request: + +time: + - platform: homeassistant + id: time_homeassistant + on_time_sync: + - component.update: S0tool_uptime_timestamp + +# https://esphome.io/components/safe_mode need for ESPHome v2024.6.x +safe_mode: + +sensor: +#------------------------# sensoren #------------------------# + - platform: uptime + id: S0tool_uptime + + - platform: template + id: S0tool_uptime_timestamp + name: "${name} online sinds" + device_class: "timestamp" + accuracy_decimals: 0 + update_interval: never + icon: 'mdi:clock-start' + entity_category: diagnostic + lambda: |- + static float timestamp = ( + id(time_homeassistant).utcnow().timestamp - id(S0tool_uptime).state + ); + return timestamp; + +# ⬇ versie verbinding informatie sensoren voor in ha ⬇ # + # WiFi signal + - platform: wifi_signal + name: "${name} - WiFi Signal" + update_interval: 120s + +text_sensor: + - platform: template + name: "s0tool_versie" + id: s0tool_versie + icon: 'mdi:alpha-v-circle-outline' + update_interval: 6h + entity_category: diagnostic + lambda: |- + return {"${vdate}"}; + + - platform: wifi_info + ip_address: + name: "${name} IP-adres" + id: s0tool_ip_adres + icon: mdi:ip-network + + mac_address: + name: "${name} Mac-adres" + id: s0tool_mac_adres + icon: mdi:folder-key-network-outline + +# restart button # +button: + - platform: restart + name: "${name} Restart device" + entity_category: diagnostic + +# Factory Reset Switch from ESPHome v2022.09 + - platform: factory_reset + name: "Restart with Factory Default Settings" + entity_category: diagnostic + disabled_by_default: True + + # safe mode button + - platform: safe_mode + name: "Safe Mode" + entity_category: diagnostic + disabled_by_default: True diff --git a/esphome/components/gasenwater-update.yml b/esphome/components/gasenwater-update.yml new file mode 100644 index 0000000..b0f5dfc --- /dev/null +++ b/esphome/components/gasenwater-update.yml @@ -0,0 +1,4 @@ +update: + - platform: http_request + name: Firmware Update + source: https://s0tool.nl/econet-hpwh.json \ No newline at end of file diff --git a/esphome/components/gaspuls.yaml b/esphome/components/gaspuls.yaml index 0e85298..a925d31 100644 --- a/esphome/components/gaspuls.yaml +++ b/esphome/components/gaspuls.yaml @@ -1,133 +1,133 @@ -# Delen en bewerken mag maar laat deze eerste regels staan. -# Bron : https://www.huizebruin.nl -# Bron File : https://github.com/huizebruin/s0tool/tree/main/esphome -# © Huizebruin.nl -# # ⬇ Enable Home Assistant API ⬇ # -api: - services: - - service: meterstand_gas - variables: - meter_value: float - then: - - globals.set: - id: initial_gas_usage - value: !lambda "return ( meter_value - (id(total_gas_pulses)) * atof(id(Select_pulse_gas).state.c_str()) ) ;" - - globals.set: - id: total_gas_pulses - value: "0" - - -globals: - - id: initial_gas_usage - type: float - restore_value: yes - initial_value: '010' - - id: total_gas_pulses - type: int - restore_value: yes - -select: - # ⬇ gas per m3 rate ⬇ # - - platform: template - name: "Pulsrate gas per m3" - id: Select_pulse_gas - optimistic: true - options: - - "0.0001" - - "0.008" - - "0.007" - - "0.006" - - "0.005" - - "0.001" - - "0.09" - - "0.08" - - "0.07" - - "0.06" - - "0.05" - - "0.01" - - "0.1" - initial_option: "0.001" - restore_value: yes - on_value: - then: - - logger.log: - format: "Chosen option: %s " - args: ["x.c_str()"] - -number: - - platform: template - id: Select_pulse_gas - name: 'Pulsrate gas per m3' - optimistic: true - mode: box - min_value: '0.0001' - max_value: '0.1' - step: '1' - restore_value: yes - initial_value: '0.001' - - -#------------------------# gasmeter #------------------------# -binary_sensor: - - platform: gpio - id: internal_pulse_counter - name: "Pulse Sensor gas" - pin: - number: D5 - allow_other_uses: true - inverted: true - mode: - input: true - on_press: - - then: - lambda: id(total_gas_pulses) += 1; - -sensor: -#------------------------# gasmeter #------------------------# -# ⬇ gasmeter pulsen ⬇ # - - platform: pulse_meter #pulse_counter - internal_filter_mode: "PULSE" - internal_filter: 50ms - pin: - number: D5 - allow_other_uses: true - id: gasmeter_pulse - name: "gasmeter pulse" - state_class: measurement - unit_of_measurement: "l/min" - accuracy_decimals: 1 - icon: "mdi:gas-burner" - filters: - lambda: return x * atof(id(Select_pulse_gas).state.c_str()) * 1000; - -# ⬇ Totaal gasmeter ⬇ # - total: - id: sensor_pulse_meter_total - name: "gasmeter Totaal" - unit_of_measurement: "m³" - state_class: total_increasing - device_class: gas - accuracy_decimals: 3 - filters: - lambda: return x * atof(id(Select_pulse_gas).state.c_str()); - - -# ⬇ gasmeter stand bij benadering ⬇ # - - platform: template - id: gasmeter_total - name: "gasmeter stand" - state_class: "total_increasing" - icon: mdi:meter-gas - unit_of_measurement: "m³" - accuracy_decimals: 3 - lambda: return id(initial_gas_usage) + (id(total_gas_pulses) * atof(id(Select_pulse_gas).state.c_str())); - -# ⬇ gaspulses only web interface for debugging ⬇ # - - platform: template - id: gasmeter_pulses - name: "gasmeter pulses totaal" - state_class: "total_increasing" - accuracy_decimals: 0 - lambda: return id(total_gas_pulses); - internal: True - +# Delen en bewerken mag maar laat deze eerste regels staan. +# Bron : https://www.huizebruin.nl +# Bron File : https://github.com/huizebruin/s0tool/tree/main/esphome +# © Huizebruin.nl +# # ⬇ Enable Home Assistant API ⬇ # +api: + services: + - service: meterstand_gas + variables: + meter_value: float + then: + - globals.set: + id: initial_gas_usage + value: !lambda "return ( meter_value - (id(total_gas_pulses)) * atof(id(Select_pulse_gas).state.c_str()) ) ;" + - globals.set: + id: total_gas_pulses + value: "0" + + +globals: + - id: initial_gas_usage + type: float + restore_value: yes + initial_value: '010' + - id: total_gas_pulses + type: int + restore_value: yes + +select: + # ⬇ gas per m3 rate ⬇ # + - platform: template + name: "Pulsrate gas per m3" + id: Select_pulse_gas + optimistic: true + options: + - "0.0001" + - "0.008" + - "0.007" + - "0.006" + - "0.005" + - "0.001" + - "0.09" + - "0.08" + - "0.07" + - "0.06" + - "0.05" + - "0.01" + - "0.1" + initial_option: "0.001" + restore_value: yes + on_value: + then: + - logger.log: + format: "Chosen option: %s " + args: ["x.c_str()"] + +number: + - platform: template + id: Select_pulse_gas + name: 'Pulsrate gas per m3' + optimistic: true + mode: box + min_value: '0.0001' + max_value: '0.1' + step: '1' + restore_value: yes + initial_value: '0.001' + + +#------------------------# gasmeter #------------------------# +binary_sensor: + - platform: gpio + id: internal_pulse_counter + name: "Pulse Sensor gas" + pin: + number: D5 + allow_other_uses: true + inverted: true + mode: + input: true + on_press: + - then: + lambda: id(total_gas_pulses) += 1; + +sensor: +#------------------------# gasmeter #------------------------# +# ⬇ gasmeter pulsen ⬇ # + - platform: pulse_meter #pulse_counter + internal_filter_mode: "PULSE" + internal_filter: 50ms + pin: + number: D5 + allow_other_uses: true + id: gasmeter_pulse + name: "gasmeter pulse" + state_class: measurement + unit_of_measurement: "l/min" + accuracy_decimals: 1 + icon: "mdi:gas-burner" + filters: + lambda: return x * atof(id(Select_pulse_gas).state.c_str()) * 1000; + +# ⬇ Totaal gasmeter ⬇ # + total: + id: sensor_pulse_meter_total + name: "gasmeter Totaal" + unit_of_measurement: "m³" + state_class: total_increasing + device_class: gas + accuracy_decimals: 3 + filters: + lambda: return x * atof(id(Select_pulse_gas).state.c_str()); + + +# ⬇ gasmeter stand bij benadering ⬇ # + - platform: template + id: gasmeter_total + name: "gasmeter stand" + state_class: "total_increasing" + icon: mdi:meter-gas + unit_of_measurement: "m³" + accuracy_decimals: 3 + lambda: return id(initial_gas_usage) + (id(total_gas_pulses) * atof(id(Select_pulse_gas).state.c_str())); + +# ⬇ gaspulses only web interface for debugging ⬇ # + - platform: template + id: gasmeter_pulses + name: "gasmeter pulses totaal" + state_class: "total_increasing" + accuracy_decimals: 0 + lambda: return id(total_gas_pulses); + internal: True + diff --git a/esphome/components/kwh-water-test.yml b/esphome/components/kwh-water-test.yml index 5c5d5fb..7243c94 100644 --- a/esphome/components/kwh-water-test.yml +++ b/esphome/components/kwh-water-test.yml @@ -1,88 +1,88 @@ -logger: - level: debug -debug: - update_interval: 5s - -api: - -text_sensor: - - platform: debug - device: - name: "Device Info" - reset_reason: - name: "Reset Reason" - - -binary_sensor: -#------------------------# kwh #------------------------# - - platform: gpio - id: kwh_test - name: "kWh sensor test" - internal: False - pin: - number: D5 - allow_other_uses: true - mode: - input: true - pullup: true - -#------------------------# Watermeter #------------------------# -# binary_sensor: - - platform: gpio - id: water_sensor_test - name: "Water sensor test" - internal: False - pin: - number: D2 - allow_other_uses: true - inverted: true - mode: - input: true - -#------------------------# Kwh meter S0 poort 1 #------------------------# -sensor: -# ⬇ kwh meter s0 ⬇ # - - platform: pulse_meter - pin: - number: D5 - allow_other_uses: true - mode: - input: true - name: "Actuele test" - id: actual_power_test - icon: "mdi:flash" - accuracy_decimals: 0 #3 - unit_of_measurement: "W" #'kW' - state_class: measurement - device_class: power - - -#sensor: -#------------------------# Watermeter #------------------------# -# ⬇ watermeter pulsen ⬇ # - - platform: pulse_meter - internal_filter_mode: "PULSE" - internal_filter: 50ms - pin: - number: D2 - allow_other_uses: true - mode: - input: true - pullup: true - id: watermeter_flow_test - name: "watermeter flow test" - state_class: measurement - unit_of_measurement: "l/min" - accuracy_decimals: 1 - icon: "mdi:water-pump" - - - - platform: debug - free: - name: "Heap Free" - fragmentation: - name: "Heap Fragmentation" - block: - name: "Heap Max Block" - loop_time: - name: "Loop Time" +logger: + level: debug +debug: + update_interval: 5s + +api: + +text_sensor: + - platform: debug + device: + name: "Device Info" + reset_reason: + name: "Reset Reason" + + +binary_sensor: +#------------------------# kwh #------------------------# + - platform: gpio + id: kwh_test + name: "kWh sensor test" + internal: False + pin: + number: D5 + allow_other_uses: true + mode: + input: true + pullup: true + +#------------------------# Watermeter #------------------------# +# binary_sensor: + - platform: gpio + id: water_sensor_test + name: "Water sensor test" + internal: False + pin: + number: D2 + allow_other_uses: true + inverted: true + mode: + input: true + +#------------------------# Kwh meter S0 poort 1 #------------------------# +sensor: +# ⬇ kwh meter s0 ⬇ # + - platform: pulse_meter + pin: + number: D5 + allow_other_uses: true + mode: + input: true + name: "Actuele test" + id: actual_power_test + icon: "mdi:flash" + accuracy_decimals: 0 #3 + unit_of_measurement: "W" #'kW' + state_class: measurement + device_class: power + + +#sensor: +#------------------------# Watermeter #------------------------# +# ⬇ watermeter pulsen ⬇ # + - platform: pulse_meter + internal_filter_mode: "PULSE" + internal_filter: 50ms + pin: + number: D2 + allow_other_uses: true + mode: + input: true + pullup: true + id: watermeter_flow_test + name: "watermeter flow test" + state_class: measurement + unit_of_measurement: "l/min" + accuracy_decimals: 1 + icon: "mdi:water-pump" + + + - platform: debug + free: + name: "Heap Free" + fragmentation: + name: "Heap Fragmentation" + block: + name: "Heap Max Block" + loop_time: + name: "Loop Time" diff --git a/esphome/components/kwhpuls-resistor.yml b/esphome/components/kwhpuls-resistor.yml index 7f5f0ca..0c78446 100644 --- a/esphome/components/kwhpuls-resistor.yml +++ b/esphome/components/kwhpuls-resistor.yml @@ -1,113 +1,113 @@ -# substitutions: -# impulslengte: "50ms" - -# # ⬇ Enable Home Assistant API ⬇ # -api: - services: - - service: meterstand_kwh - variables: - meter_value: float - then: - - globals.set: - id: initial_kwh_usage - value: !lambda "return ( meter_value ) ;" - - globals.set: - id: total_kwh_pulses - value: "0" - -globals: - - id: initial_kwh_usage - type: float - restore_value: yes - initial_value: '00010' - - id: total_kwh_pulses - type: int - restore_value: yes - -number: - - platform: template - id: Select_pulse_rate - name: "Pulsrate kWh" - optimistic: true - mode: box - min_value: '10' - max_value: '4000' - step: '10' - restore_value: yes - initial_value: '2000' - on_value: - then: - - logger.log: - format: "Chosen option: %s " - args: ["x.c_str()"] - -binary_sensor: -#------------------------# kwh #------------------------# - - platform: gpio - id: kwh_sensor_status - name: "kWh sensor status" - internal: False - pin: - number: D5 - allow_other_uses: true - mode: - input: true - pullup: true - on_press: - - then: - lambda: id(total_kwh_pulses) += 1; -#------------------------# Kwh meter S0 poort 1 #------------------------# -sensor: -# ⬇ kwh meter s0 ⬇ # - - platform: pulse_meter - pin: - number: D5 - allow_other_uses: true - mode: - input: true - pullup: true - name: "Actuele energie" - id: actual_power - icon: "mdi:flash" - # internal_filter: ${impulslengte} - accuracy_decimals: 0 #3 - unit_of_measurement: "W" #'kW' - state_class: measurement - device_class: power - filters: - lambda: return x * (60.0 / id(Select_pulse_rate).state)* 1000 ; - -# ⬇ Totaal opgebracht ⬇ # - total: - unit_of_measurement: 'kWh' - name: "Totaal opgebracht" - id: W_opbrengst_totaal - state_class: total_increasing - device_class: energy - icon: "mdi:flash" - accuracy_decimals: 3 - filters: - - lambda: return id (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); - # - lambda: return x * (1.0 / id(Select_pulse_rate).state); - - -# ⬇ Kwh meterstand ⬇ stand bij benadering # - - platform: template - id: kwh_total - name: "Actuele meterstand" - state_class: "total_increasing" - device_class: energy - icon: "mdi:flash" - update_interval: 1s - unit_of_measurement: 'kWh' - accuracy_decimals: 3 - lambda: return id(initial_kwh_usage) + (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); - -# ⬇ kwh pulses only web interface for debugging ⬇ # - - platform: template - id: kwh_pulses - name: "kwh pulses totaal" - state_class: "total_increasing" - lambda: return id(total_kwh_pulses); - accuracy_decimals: 0 - internal: True +# substitutions: +# impulslengte: "50ms" + +# # ⬇ Enable Home Assistant API ⬇ # +api: + services: + - service: meterstand_kwh + variables: + meter_value: float + then: + - globals.set: + id: initial_kwh_usage + value: !lambda "return ( meter_value ) ;" + - globals.set: + id: total_kwh_pulses + value: "0" + +globals: + - id: initial_kwh_usage + type: float + restore_value: yes + initial_value: '00010' + - id: total_kwh_pulses + type: int + restore_value: yes + +number: + - platform: template + id: Select_pulse_rate + name: "Pulsrate kWh" + optimistic: true + mode: box + min_value: '10' + max_value: '4000' + step: '10' + restore_value: yes + initial_value: '2000' + on_value: + then: + - logger.log: + format: "Chosen option: %s " + args: ["x.c_str()"] + +binary_sensor: +#------------------------# kwh #------------------------# + - platform: gpio + id: kwh_sensor_status + name: "kWh sensor status" + internal: False + pin: + number: D5 + allow_other_uses: true + mode: + input: true + pullup: true + on_press: + - then: + lambda: id(total_kwh_pulses) += 1; +#------------------------# Kwh meter S0 poort 1 #------------------------# +sensor: +# ⬇ kwh meter s0 ⬇ # + - platform: pulse_meter + pin: + number: D5 + allow_other_uses: true + mode: + input: true + pullup: true + name: "Actuele energie" + id: actual_power + icon: "mdi:flash" + # internal_filter: ${impulslengte} + accuracy_decimals: 0 #3 + unit_of_measurement: "W" #'kW' + state_class: measurement + device_class: power + filters: + lambda: return x * (60.0 / id(Select_pulse_rate).state)* 1000 ; + +# ⬇ Totaal opgebracht ⬇ # + total: + unit_of_measurement: 'kWh' + name: "Totaal opgebracht" + id: W_opbrengst_totaal + state_class: total_increasing + device_class: energy + icon: "mdi:flash" + accuracy_decimals: 3 + filters: + - lambda: return id (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); + # - lambda: return x * (1.0 / id(Select_pulse_rate).state); + + +# ⬇ Kwh meterstand ⬇ stand bij benadering # + - platform: template + id: kwh_total + name: "Actuele meterstand" + state_class: "total_increasing" + device_class: energy + icon: "mdi:flash" + update_interval: 1s + unit_of_measurement: 'kWh' + accuracy_decimals: 3 + lambda: return id(initial_kwh_usage) + (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); + +# ⬇ kwh pulses only web interface for debugging ⬇ # + - platform: template + id: kwh_pulses + name: "kwh pulses totaal" + state_class: "total_increasing" + lambda: return id(total_kwh_pulses); + accuracy_decimals: 0 + internal: True diff --git a/esphome/components/kwhpuls.yml b/esphome/components/kwhpuls.yml index 60eae48..2191b5e 100644 --- a/esphome/components/kwhpuls.yml +++ b/esphome/components/kwhpuls.yml @@ -1,108 +1,108 @@ -# substitutions: -# impulslengte: "50ms" - -# # ⬇ Enable Home Assistant API ⬇ # -api: - services: - - service: meterstand_kwh - variables: - meter_value: float - then: - - globals.set: - id: initial_kwh_usage - value: !lambda "return ( meter_value ) ;" - - globals.set: - id: total_kwh_pulses - value: "0" - -globals: - - id: initial_kwh_usage - type: float - restore_value: yes - initial_value: '00010' - - id: total_kwh_pulses - type: int - restore_value: yes - -number: - - platform: template - id: Select_pulse_rate - name: "Pulsrate kWh" - optimistic: true - mode: box - min_value: '10' - max_value: '4000' - step: '10' - restore_value: yes - initial_value: '2000' - on_value: - then: - - logger.log: - format: "Chosen option: %s " - args: ["x.c_str()"] - -binary_sensor: -#------------------------# kwh #------------------------# - - platform: gpio - id: kwh_sensor_status - name: "kWh sensor status" - internal: False - pin: - number: D5 - allow_other_uses: true - mode: - input: true - on_press: - - then: - lambda: id(total_kwh_pulses) += 1; -#------------------------# Kwh meter S0 poort 1 #------------------------# -sensor: -# ⬇ kwh meter s0 ⬇ # - - platform: pulse_meter - pin: - number: D5 - allow_other_uses: true - name: "Actuele energie" - id: actual_power - icon: "mdi:flash" - # internal_filter: ${impulslengte} - accuracy_decimals: 0 #3 - unit_of_measurement: "W" #'kW' - state_class: measurement - device_class: power - filters: - lambda: return x * (60.0 / id(Select_pulse_rate).state)* 1000 ; - -# ⬇ Totaal opgebracht ⬇ # - total: - unit_of_measurement: 'kWh' - name: "Totaal opgebracht" - id: W_opbrengst_totaal - state_class: total_increasing - device_class: energy - icon: "mdi:flash" - accuracy_decimals: 3 - filters: - - lambda: return id (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); - - -# ⬇ Kwh meterstand ⬇ stand bij benadering # - - platform: template - id: kwh_total - name: "Actuele meterstand" - state_class: "total_increasing" - device_class: energy - icon: "mdi:flash" - update_interval: 1s - unit_of_measurement: 'kWh' - accuracy_decimals: 3 - lambda: return id(initial_kwh_usage) + (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); - -# ⬇ kwh pulses only web interface for debugging ⬇ # - - platform: template - id: kwh_pulses - name: "kwh pulses totaal" - state_class: "total_increasing" - lambda: return id(total_kwh_pulses); - accuracy_decimals: 0 +# substitutions: +# impulslengte: "50ms" + +# # ⬇ Enable Home Assistant API ⬇ # +api: + services: + - service: meterstand_kwh + variables: + meter_value: float + then: + - globals.set: + id: initial_kwh_usage + value: !lambda "return ( meter_value ) ;" + - globals.set: + id: total_kwh_pulses + value: "0" + +globals: + - id: initial_kwh_usage + type: float + restore_value: yes + initial_value: '00010' + - id: total_kwh_pulses + type: int + restore_value: yes + +number: + - platform: template + id: Select_pulse_rate + name: "Pulsrate kWh" + optimistic: true + mode: box + min_value: '10' + max_value: '4000' + step: '10' + restore_value: yes + initial_value: '2000' + on_value: + then: + - logger.log: + format: "Chosen option: %s " + args: ["x.c_str()"] + +binary_sensor: +#------------------------# kwh #------------------------# + - platform: gpio + id: kwh_sensor_status + name: "kWh sensor status" + internal: False + pin: + number: D5 + allow_other_uses: true + mode: + input: true + on_press: + - then: + lambda: id(total_kwh_pulses) += 1; +#------------------------# Kwh meter S0 poort 1 #------------------------# +sensor: +# ⬇ kwh meter s0 ⬇ # + - platform: pulse_meter + pin: + number: D5 + allow_other_uses: true + name: "Actuele energie" + id: actual_power + icon: "mdi:flash" + # internal_filter: ${impulslengte} + accuracy_decimals: 0 #3 + unit_of_measurement: "W" #'kW' + state_class: measurement + device_class: power + filters: + lambda: return x * (60.0 / id(Select_pulse_rate).state)* 1000 ; + +# ⬇ Totaal opgebracht ⬇ # + total: + unit_of_measurement: 'kWh' + name: "Totaal opgebracht" + id: W_opbrengst_totaal + state_class: total_increasing + device_class: energy + icon: "mdi:flash" + accuracy_decimals: 3 + filters: + - lambda: return id (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); + + +# ⬇ Kwh meterstand ⬇ stand bij benadering # + - platform: template + id: kwh_total + name: "Actuele meterstand" + state_class: "total_increasing" + device_class: energy + icon: "mdi:flash" + update_interval: 1s + unit_of_measurement: 'kWh' + accuracy_decimals: 3 + lambda: return id(initial_kwh_usage) + (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); + +# ⬇ kwh pulses only web interface for debugging ⬇ # + - platform: template + id: kwh_pulses + name: "kwh pulses totaal" + state_class: "total_increasing" + lambda: return id(total_kwh_pulses); + accuracy_decimals: 0 internal: True \ No newline at end of file diff --git a/esphome/components/s0-watermeter.yaml b/esphome/components/s0-watermeter.yaml index 8d7de23..13d68d6 100644 --- a/esphome/components/s0-watermeter.yaml +++ b/esphome/components/s0-watermeter.yaml @@ -1,109 +1,109 @@ -# Delen en bewerken mag maar laat deze eerste regels staan. -# Bron : https://www.huizebruin.nl -# Bron File : https://github.com/huizebruin/s0tool/tree/main/esphome -# © Huizebruin.nl -# # ⬇ Enable Home Assistant API ⬇ # -api: - services: - - service: meterstand_water - variables: - meter_value: float - then: - - globals.set: - id: initial_water_usage - value: !lambda "return ( meter_value - (id(total_water_pulses)) * atof(id(Select_pulse_water).state.c_str()) ) ;" - - globals.set: - id: total_water_pulses - value: "0" - - -globals: - - id: initial_water_usage - type: float - restore_value: yes - initial_value: '010' - - id: total_water_pulses - type: int - restore_value: yes - -select: - # ⬇ water per m3 rate ⬇ # - - platform: template - name: "Pulsrate water per m3" - id: Select_pulse_water - optimistic: true - options: - - "0.0001" - - "0.0005" - - "0.001" - - "0.01" - - "0.1" - initial_option: "0.001" - restore_value: yes - on_value: - then: - - logger.log: - format: "Chosen option: %s " - args: ["x.c_str()"] - -#------------------------# Watermeter #------------------------# -binary_sensor: - - platform: gpio - id: water_sensor_status - name: "Water sensor status" - internal: False - pin: - number: D2 - allow_other_uses: true - inverted: true - mode: - input: true - on_press: - - then: - lambda: id(total_water_pulses) += 1; -sensor: -#------------------------# Watermeter #------------------------# -# ⬇ watermeter pulsen ⬇ # - - platform: pulse_counter - pin: - number: D2 - allow_other_uses: true - id: watermeter_pulse - name: "watermeter pulse" - state_class: measurement - unit_of_measurement: "l/min" - accuracy_decimals: 1 - icon: "mdi:water-pump" - filters: - lambda: return x * atof(id(Select_pulse_water).state.c_str()) * 1000; - -# ⬇ Totaal watermeter ⬇ # - total: - id: sensor_pulse_meter_total - name: "watermeter Totaal" - unit_of_measurement: "m³" - state_class: total_increasing - device_class: water - accuracy_decimals: 3 - filters: - lambda: return x * atof(id(Select_pulse_water).state.c_str()); - - -# ⬇ Watermeter stand bij benadering ⬇ # - - platform: template - id: watermeter_total - name: "watermeter stand" - state_class: "total_increasing" - icon: mdi:water - unit_of_measurement: "m³" - accuracy_decimals: 3 - lambda: return id(initial_water_usage) + (id(total_water_pulses) * atof(id(Select_pulse_water).state.c_str())); - -# ⬇ Waterpulses only web interface for debugging ⬇ # - - platform: template - id: watermeter_pulses - name: "watermeter pulses totaal" - state_class: "total_increasing" - accuracy_decimals: 0 - lambda: return id(total_water_pulses); +# Delen en bewerken mag maar laat deze eerste regels staan. +# Bron : https://www.huizebruin.nl +# Bron File : https://github.com/huizebruin/s0tool/tree/main/esphome +# © Huizebruin.nl +# # ⬇ Enable Home Assistant API ⬇ # +api: + services: + - service: meterstand_water + variables: + meter_value: float + then: + - globals.set: + id: initial_water_usage + value: !lambda "return ( meter_value - (id(total_water_pulses)) * atof(id(Select_pulse_water).state.c_str()) ) ;" + - globals.set: + id: total_water_pulses + value: "0" + + +globals: + - id: initial_water_usage + type: float + restore_value: yes + initial_value: '010' + - id: total_water_pulses + type: int + restore_value: yes + +select: + # ⬇ water per m3 rate ⬇ # + - platform: template + name: "Pulsrate water per m3" + id: Select_pulse_water + optimistic: true + options: + - "0.0001" + - "0.0005" + - "0.001" + - "0.01" + - "0.1" + initial_option: "0.001" + restore_value: yes + on_value: + then: + - logger.log: + format: "Chosen option: %s " + args: ["x.c_str()"] + +#------------------------# Watermeter #------------------------# +binary_sensor: + - platform: gpio + id: water_sensor_status + name: "Water sensor status" + internal: False + pin: + number: D2 + allow_other_uses: true + inverted: true + mode: + input: true + on_press: + - then: + lambda: id(total_water_pulses) += 1; +sensor: +#------------------------# Watermeter #------------------------# +# ⬇ watermeter pulsen ⬇ # + - platform: pulse_counter + pin: + number: D2 + allow_other_uses: true + id: watermeter_pulse + name: "watermeter pulse" + state_class: measurement + unit_of_measurement: "l/min" + accuracy_decimals: 1 + icon: "mdi:water-pump" + filters: + lambda: return x * atof(id(Select_pulse_water).state.c_str()) * 1000; + +# ⬇ Totaal watermeter ⬇ # + total: + id: sensor_pulse_meter_total + name: "watermeter Totaal" + unit_of_measurement: "m³" + state_class: total_increasing + device_class: water + accuracy_decimals: 3 + filters: + lambda: return x * atof(id(Select_pulse_water).state.c_str()); + + +# ⬇ Watermeter stand bij benadering ⬇ # + - platform: template + id: watermeter_total + name: "watermeter stand" + state_class: "total_increasing" + icon: mdi:water + unit_of_measurement: "m³" + accuracy_decimals: 3 + lambda: return id(initial_water_usage) + (id(total_water_pulses) * atof(id(Select_pulse_water).state.c_str())); + +# ⬇ Waterpulses only web interface for debugging ⬇ # + - platform: template + id: watermeter_pulses + name: "watermeter pulses totaal" + state_class: "total_increasing" + accuracy_decimals: 0 + lambda: return id(total_water_pulses); internal: True \ No newline at end of file diff --git a/esphome/components/s0tool-dsz12d-update.yml b/esphome/components/s0tool-dsz12d-update.yml new file mode 100644 index 0000000..a7430a8 --- /dev/null +++ b/esphome/components/s0tool-dsz12d-update.yml @@ -0,0 +1,4 @@ +update: + - platform: http_request + name: Firmware Update + source: https://s0tool.nl/s0tool-dsz12d-manifest.json \ No newline at end of file diff --git a/esphome/components/s0tool-kwh-puls-update.yml b/esphome/components/s0tool-kwh-puls-update.yml new file mode 100644 index 0000000..40bde20 --- /dev/null +++ b/esphome/components/s0tool-kwh-puls-update.yml @@ -0,0 +1,4 @@ +update: + - platform: http_request + name: Firmware Update + source: https://s0tool.nl/s0tool-kwh-puls-manifest.json \ No newline at end of file diff --git a/esphome/components/s0tool-kwh-water-test-update.yml b/esphome/components/s0tool-kwh-water-test-update.yml new file mode 100644 index 0000000..6b51452 --- /dev/null +++ b/esphome/components/s0tool-kwh-water-test-update.yml @@ -0,0 +1,4 @@ +update: + - platform: http_request + name: Firmware Update + source: https://s0tool.nl/s0tool-kwh-water-test-manifest.json \ No newline at end of file diff --git a/esphome/components/s0tool-lem022sj-update.yml b/esphome/components/s0tool-lem022sj-update.yml new file mode 100644 index 0000000..9f59cae --- /dev/null +++ b/esphome/components/s0tool-lem022sj-update.yml @@ -0,0 +1,4 @@ +update: + - platform: http_request + name: Firmware Update + source: https://s0tool.nl/s0tool-lem022sj-manifest.json \ No newline at end of file diff --git a/esphome/components/s0tool-s0-watermeter-update.yml b/esphome/components/s0tool-s0-watermeter-update.yml new file mode 100644 index 0000000..d534c6c --- /dev/null +++ b/esphome/components/s0tool-s0-watermeter-update.yml @@ -0,0 +1,4 @@ +update: + - platform: http_request + name: Firmware Update + source: https://s0tool.nl/s0tool-s0-watermeter-manifest.json \ No newline at end of file diff --git a/esphome/components/s0tool-sdm72d-update.yml b/esphome/components/s0tool-sdm72d-update.yml new file mode 100644 index 0000000..e6c782d --- /dev/null +++ b/esphome/components/s0tool-sdm72d-update.yml @@ -0,0 +1,4 @@ +update: + - platform: http_request + name: Firmware Update + source: https://s0tool.nl/s0tool-sdm72d-manifest.json \ No newline at end of file diff --git a/esphome/components/s0tool-standard-internal-update.yml b/esphome/components/s0tool-standard-internal-update.yml new file mode 100644 index 0000000..f972139 --- /dev/null +++ b/esphome/components/s0tool-standard-internal-update.yml @@ -0,0 +1,4 @@ +update: + - platform: http_request + name: Firmware Update + source: https://s0tool.nl/s0tool-standard-internal-manifest.json \ No newline at end of file diff --git a/esphome/components/s0tool-standard-update.yml b/esphome/components/s0tool-standard-update.yml new file mode 100644 index 0000000..1baf27f --- /dev/null +++ b/esphome/components/s0tool-standard-update.yml @@ -0,0 +1,4 @@ +update: + - platform: http_request + name: Firmware Update + source: https://s0tool.nl/s0tool-standard-manifest.json \ No newline at end of file diff --git a/esphome/components/s0tool-watermeter-update.yml b/esphome/components/s0tool-watermeter-update.yml new file mode 100644 index 0000000..e5f2c45 --- /dev/null +++ b/esphome/components/s0tool-watermeter-update.yml @@ -0,0 +1,4 @@ +update: + - platform: http_request + name: Firmware Update + source: https://s0tool.nl/s0tool-watermeter-manifest.json \ No newline at end of file diff --git a/esphome/components/s0tool-wsz15d32a-update.yml b/esphome/components/s0tool-wsz15d32a-update.yml new file mode 100644 index 0000000..85d8519 --- /dev/null +++ b/esphome/components/s0tool-wsz15d32a-update.yml @@ -0,0 +1,4 @@ +update: + - platform: http_request + name: Firmware Update + source: https://s0tool.nl/s0tool-wsz15d32a-manifest.json \ No newline at end of file diff --git a/esphome/components/sdm72d.yml b/esphome/components/sdm72d.yml index 5fcf247..9f6112a 100644 --- a/esphome/components/sdm72d.yml +++ b/esphome/components/sdm72d.yml @@ -1,108 +1,108 @@ -substitutions: - impulslengte: "35ms" - -# # ⬇ Enable Home Assistant API ⬇ # -api: - services: - - service: meterstand_kwh - variables: - meter_value: float - then: - - globals.set: - id: initial_kwh_usage - value: !lambda "return ( meter_value ) ;" - - globals.set: - id: total_kwh_pulses - value: "0" - -globals: - - id: initial_kwh_usage - type: float - restore_value: yes - initial_value: '00010' - - id: total_kwh_pulses - type: int - restore_value: yes - -number: - - platform: template - id: Select_pulse_rate - name: "Pulsrate kWh" - optimistic: true - mode: box - min_value: '10' - max_value: '4000' - step: '10' - restore_value: yes - initial_value: '2000' - on_value: - then: - - logger.log: - format: "Chosen option: %s " - args: ["x.c_str()"] - -binary_sensor: -#------------------------# kwh #------------------------# - - platform: gpio - id: kwh_sensor_status - name: "kWh sensor status" - internal: False - pin: - number: D5 - allow_other_uses: true - mode: - input: true - on_press: - - then: - lambda: id(total_kwh_pulses) += 1; -#------------------------# Kwh meter S0 poort 1 #------------------------# -sensor: -# ⬇ kwh meter s0 ⬇ # - - platform: pulse_meter - pin: - number: D5 - allow_other_uses: true - name: "Actuele energie" - id: actual_power - icon: "mdi:flash" - internal_filter: ${impulslengte} - accuracy_decimals: 0 #3 - unit_of_measurement: "W" #'kW' - state_class: measurement - device_class: power - filters: - lambda: return x * (60.0 / id(Select_pulse_rate).state)* 1000 ; - -# ⬇ Totaal opgebracht ⬇ # - total: - unit_of_measurement: 'kWh' - name: "Totaal opgebracht" - id: W_opbrengst_totaal - state_class: total_increasing - device_class: energy - icon: "mdi:flash" - accuracy_decimals: 3 - filters: - - lambda: return id (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); - - -# ⬇ Kwh meterstand ⬇ stand bij benadering # - - platform: template - id: kwh_total - name: "Actuele meterstand" - state_class: "total_increasing" - device_class: energy - icon: "mdi:flash" - update_interval: 1s - unit_of_measurement: 'kWh' - accuracy_decimals: 3 - lambda: return id(initial_kwh_usage) + (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); - -# ⬇ kwh pulses only web interface for debugging ⬇ # - - platform: template - id: kwh_pulses - name: "kwh pulses totaal" - state_class: "total_increasing" - lambda: return id(total_kwh_pulses); - accuracy_decimals: 0 - internal: True +substitutions: + impulslengte: "35ms" + +# # ⬇ Enable Home Assistant API ⬇ # +api: + services: + - service: meterstand_kwh + variables: + meter_value: float + then: + - globals.set: + id: initial_kwh_usage + value: !lambda "return ( meter_value ) ;" + - globals.set: + id: total_kwh_pulses + value: "0" + +globals: + - id: initial_kwh_usage + type: float + restore_value: yes + initial_value: '00010' + - id: total_kwh_pulses + type: int + restore_value: yes + +number: + - platform: template + id: Select_pulse_rate + name: "Pulsrate kWh" + optimistic: true + mode: box + min_value: '10' + max_value: '4000' + step: '10' + restore_value: yes + initial_value: '2000' + on_value: + then: + - logger.log: + format: "Chosen option: %s " + args: ["x.c_str()"] + +binary_sensor: +#------------------------# kwh #------------------------# + - platform: gpio + id: kwh_sensor_status + name: "kWh sensor status" + internal: False + pin: + number: D5 + allow_other_uses: true + mode: + input: true + on_press: + - then: + lambda: id(total_kwh_pulses) += 1; +#------------------------# Kwh meter S0 poort 1 #------------------------# +sensor: +# ⬇ kwh meter s0 ⬇ # + - platform: pulse_meter + pin: + number: D5 + allow_other_uses: true + name: "Actuele energie" + id: actual_power + icon: "mdi:flash" + internal_filter: ${impulslengte} + accuracy_decimals: 0 #3 + unit_of_measurement: "W" #'kW' + state_class: measurement + device_class: power + filters: + lambda: return x * (60.0 / id(Select_pulse_rate).state)* 1000 ; + +# ⬇ Totaal opgebracht ⬇ # + total: + unit_of_measurement: 'kWh' + name: "Totaal opgebracht" + id: W_opbrengst_totaal + state_class: total_increasing + device_class: energy + icon: "mdi:flash" + accuracy_decimals: 3 + filters: + - lambda: return id (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); + + +# ⬇ Kwh meterstand ⬇ stand bij benadering # + - platform: template + id: kwh_total + name: "Actuele meterstand" + state_class: "total_increasing" + device_class: energy + icon: "mdi:flash" + update_interval: 1s + unit_of_measurement: 'kWh' + accuracy_decimals: 3 + lambda: return id(initial_kwh_usage) + (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); + +# ⬇ kwh pulses only web interface for debugging ⬇ # + - platform: template + id: kwh_pulses + name: "kwh pulses totaal" + state_class: "total_increasing" + lambda: return id(total_kwh_pulses); + accuracy_decimals: 0 + internal: True diff --git a/esphome/components/tcrt5000.yaml b/esphome/components/tcrt5000.yaml index 3c1989a..f3cb0a3 100644 --- a/esphome/components/tcrt5000.yaml +++ b/esphome/components/tcrt5000.yaml @@ -1,84 +1,84 @@ -# Delen en bewerken mag maar laat deze eerste regels staan. -# Bron : https://www.huizebruin.nl -# Bron File : https://github.com/huizebruin/s0tool/tree/main/esphome -# © Huizebruin.nl -# # ⬇ Enable Home Assistant API ⬇ # -api: - services: - - service: meterstand_water - variables: - meter_value: float - then: - - globals.set: - id: initial_water_usage - value: !lambda "return ( meter_value - (id(total_water_pulses)) * atof(id(Select_pulse_water).state.c_str()) ) ;" - - globals.set: - id: total_water_pulses - value: "0" - - -globals: - - id: initial_water_usage - type: float - restore_value: yes - initial_value: '010' - - id: total_water_pulses - type: int - restore_value: yes - -#------------------------# Watermeter #------------------------# -binary_sensor: - - platform: gpio - id: water_sensor_status - name: "Water sensor status" - internal: False - pin: - number: D2 - allow_other_uses: true - inverted: true - mode: - input: true - on_press: - - then: - lambda: id(total_water_pulses) += 1; - -sensor: -#------------------------# Watermeter #------------------------# -# ⬇ watermeter pulsen ⬇ # - - platform: pulse_counter - pin: - number: D2 - allow_other_uses: true - id: watermeter_pulse - name: "watermeter pulse" - state_class: measurement - unit_of_measurement: "L/min" - update_interval: 2sec - internal_filter: 10us - accuracy_decimals: 1 - icon: "mdi:water-pump" - filters: - - multiply: 0.0167 - -# ⬇ Totaal watermeter ⬇ # - total: - id: sensor_pulse_meter_total - name: "watermeter Totaal" - unit_of_measurement: "m³" - state_class: total_increasing - device_class: water - accuracy_decimals: 3 - filters: - lambda: return x * atof(id(Select_pulse_water).state.c_str()); - - -# ⬇ Watermeter stand bij benadering ⬇ # - - platform: template - id: watermeter_total - name: "watermeter stand" - state_class: "total_increasing" - icon: mdi:water - unit_of_measurement: "m³" - accuracy_decimals: 3 - lambda: return id(initial_water_usage) + (id(total_water_pulses) * atof(id(Select_pulse_water).state.c_str())); - +# Delen en bewerken mag maar laat deze eerste regels staan. +# Bron : https://www.huizebruin.nl +# Bron File : https://github.com/huizebruin/s0tool/tree/main/esphome +# © Huizebruin.nl +# # ⬇ Enable Home Assistant API ⬇ # +api: + services: + - service: meterstand_water + variables: + meter_value: float + then: + - globals.set: + id: initial_water_usage + value: !lambda "return ( meter_value - (id(total_water_pulses)) * atof(id(Select_pulse_water).state.c_str()) ) ;" + - globals.set: + id: total_water_pulses + value: "0" + + +globals: + - id: initial_water_usage + type: float + restore_value: yes + initial_value: '010' + - id: total_water_pulses + type: int + restore_value: yes + +#------------------------# Watermeter #------------------------# +binary_sensor: + - platform: gpio + id: water_sensor_status + name: "Water sensor status" + internal: False + pin: + number: D2 + allow_other_uses: true + inverted: true + mode: + input: true + on_press: + - then: + lambda: id(total_water_pulses) += 1; + +sensor: +#------------------------# Watermeter #------------------------# +# ⬇ watermeter pulsen ⬇ # + - platform: pulse_counter + pin: + number: D2 + allow_other_uses: true + id: watermeter_pulse + name: "watermeter pulse" + state_class: measurement + unit_of_measurement: "L/min" + update_interval: 2sec + internal_filter: 10us + accuracy_decimals: 1 + icon: "mdi:water-pump" + filters: + - multiply: 0.0167 + +# ⬇ Totaal watermeter ⬇ # + total: + id: sensor_pulse_meter_total + name: "watermeter Totaal" + unit_of_measurement: "m³" + state_class: total_increasing + device_class: water + accuracy_decimals: 3 + filters: + lambda: return x * atof(id(Select_pulse_water).state.c_str()); + + +# ⬇ Watermeter stand bij benadering ⬇ # + - platform: template + id: watermeter_total + name: "watermeter stand" + state_class: "total_increasing" + icon: mdi:water + unit_of_measurement: "m³" + accuracy_decimals: 3 + lambda: return id(initial_water_usage) + (id(total_water_pulses) * atof(id(Select_pulse_water).state.c_str())); + diff --git a/esphome/components/water-resistor.yaml b/esphome/components/water-resistor.yaml index e37c142..8002e47 100644 --- a/esphome/components/water-resistor.yaml +++ b/esphome/components/water-resistor.yaml @@ -1,118 +1,118 @@ -# Delen en bewerken mag maar laat deze eerste regels staan. -# Bron : https://www.huizebruin.nl -# Bron File : https://github.com/huizebruin/s0tool/tree/main/esphome -# © Huizebruin.nl -# # ⬇ Enable Home Assistant API ⬇ # -api: - services: - - service: meterstand_water - variables: - meter_value: float - then: - - globals.set: - id: initial_water_usage - value: !lambda "return ( meter_value - (id(total_water_pulses)) * atof(id(Select_pulse_water).state.c_str()) );" - - globals.set: - id: total_water_pulses - value: "0" - -globals: - - id: initial_water_usage - type: float - restore_value: yes - initial_value: '010' - - id: total_water_pulses - type: int - restore_value: yes - -select: - # ⬇ water per m3 rate ⬇ # - - platform: template - name: "Pulsrate water per m3" - id: Select_pulse_water - optimistic: true - options: - - "0.0001" - - "0.0005" - - "0.001" - - "0.01" - - "0.1" - initial_option: "0.001" - restore_value: yes - on_value: - then: - - logger.log: - format: "Chosen option: %s " - args: ["x.c_str()"] - -#------------------------# Watermeter #------------------------# -binary_sensor: - - platform: gpio - id: water_sensor_status - name: "Water sensor status" - internal: False - pin: - number: D2 - allow_other_uses: true - inverted: true - mode: - input: true - pullup: true - on_press: - - then: - lambda: id(total_water_pulses) += 1; - -sensor: -#------------------------# Watermeter #------------------------# -# ⬇ watermeter pulsen ⬇ # - - platform: pulse_meter #pulse_counter - internal_filter_mode: "PULSE" - internal_filter: 50ms - pin: - number: D2 - allow_other_uses: true - mode: - input: true - pullup: true - id: watermeter_flow - name: "watermeter flow" - state_class: measurement - unit_of_measurement: "l/min" - accuracy_decimals: 1 - icon: "mdi:water-pump" - filters: - lambda: return x * atof(id(Select_pulse_water).state.c_str()) * 1000; - -# ⬇ Totaal watermeter ⬇ # - total: - id: sensor_pulse_meter_total - name: "watermeter Totaal" - state_class: "total_increasing" - device_class: water - icon: mdi:water - unit_of_measurement: "m³" - accuracy_decimals: 3 - filters: - - multiply: 0.001 - - -# ⬇ Watermeter stand bij benadering ⬇ # - - platform: template - id: watermeter_total - name: "watermeter stand" - state_class: "total_increasing" - device_class: water - icon: mdi:water - unit_of_measurement: "m³" - update_interval: 30s - accuracy_decimals: 3 - lambda: return id(initial_water_usage) + (id(total_water_pulses) * atof(id(Select_pulse_water).state.c_str())); - -# ⬇ Waterpulses only web interface for debugging ⬇ # - - platform: template - id: watermeter_flow_totaal - name: "watermeter flow totaal" - state_class: "total_increasing" - accuracy_decimals: 0 - lambda: return id(total_water_pulses); +# Delen en bewerken mag maar laat deze eerste regels staan. +# Bron : https://www.huizebruin.nl +# Bron File : https://github.com/huizebruin/s0tool/tree/main/esphome +# © Huizebruin.nl +# # ⬇ Enable Home Assistant API ⬇ # +api: + services: + - service: meterstand_water + variables: + meter_value: float + then: + - globals.set: + id: initial_water_usage + value: !lambda "return ( meter_value - (id(total_water_pulses)) * atof(id(Select_pulse_water).state.c_str()) );" + - globals.set: + id: total_water_pulses + value: "0" + +globals: + - id: initial_water_usage + type: float + restore_value: yes + initial_value: '010' + - id: total_water_pulses + type: int + restore_value: yes + +select: + # ⬇ water per m3 rate ⬇ # + - platform: template + name: "Pulsrate water per m3" + id: Select_pulse_water + optimistic: true + options: + - "0.0001" + - "0.0005" + - "0.001" + - "0.01" + - "0.1" + initial_option: "0.001" + restore_value: yes + on_value: + then: + - logger.log: + format: "Chosen option: %s " + args: ["x.c_str()"] + +#------------------------# Watermeter #------------------------# +binary_sensor: + - platform: gpio + id: water_sensor_status + name: "Water sensor status" + internal: False + pin: + number: D2 + allow_other_uses: true + inverted: true + mode: + input: true + pullup: true + on_press: + - then: + lambda: id(total_water_pulses) += 1; + +sensor: +#------------------------# Watermeter #------------------------# +# ⬇ watermeter pulsen ⬇ # + - platform: pulse_meter #pulse_counter + internal_filter_mode: "PULSE" + internal_filter: 50ms + pin: + number: D2 + allow_other_uses: true + mode: + input: true + pullup: true + id: watermeter_flow + name: "watermeter flow" + state_class: measurement + unit_of_measurement: "l/min" + accuracy_decimals: 1 + icon: "mdi:water-pump" + filters: + lambda: return x * atof(id(Select_pulse_water).state.c_str()) * 1000; + +# ⬇ Totaal watermeter ⬇ # + total: + id: sensor_pulse_meter_total + name: "watermeter Totaal" + state_class: "total_increasing" + device_class: water + icon: mdi:water + unit_of_measurement: "m³" + accuracy_decimals: 3 + filters: + - multiply: 0.001 + + +# ⬇ Watermeter stand bij benadering ⬇ # + - platform: template + id: watermeter_total + name: "watermeter stand" + state_class: "total_increasing" + device_class: water + icon: mdi:water + unit_of_measurement: "m³" + update_interval: 30s + accuracy_decimals: 3 + lambda: return id(initial_water_usage) + (id(total_water_pulses) * atof(id(Select_pulse_water).state.c_str())); + +# ⬇ Waterpulses only web interface for debugging ⬇ # + - platform: template + id: watermeter_flow_totaal + name: "watermeter flow totaal" + state_class: "total_increasing" + accuracy_decimals: 0 + lambda: return id(total_water_pulses); internal: True \ No newline at end of file diff --git a/esphome/components/watermeter.yaml b/esphome/components/watermeter.yaml index 18fb9d2..145a410 100644 --- a/esphome/components/watermeter.yaml +++ b/esphome/components/watermeter.yaml @@ -1,129 +1,129 @@ -# Delen en bewerken mag maar laat deze eerste regels staan. -# Bron : https://www.huizebruin.nl -# Bron File : https://github.com/huizebruin/s0tool/tree/main/esphome -# © Huizebruin.nl -# # ⬇ Enable Home Assistant API ⬇ # -api: - services: - - service: meterstand_water - variables: - meter_value: float - then: - - globals.set: - id: initial_water_usage - value: !lambda "return ( meter_value - (id(total_water_pulses)) * atof(id(Select_pulse_water).state.c_str()) );" - - globals.set: - id: total_water_pulses - value: "0" - -globals: - - id: initial_water_usage - type: float - restore_value: yes - initial_value: '010' - - id: total_water_pulses - type: int - restore_value: yes - -select: - # ⬇ water per m3 rate ⬇ # - - platform: template - name: "Pulsrate water per m3" - id: Select_pulse_water - optimistic: true - options: - - "0.0001" - - "0.0005" - - "0.001" - - "0.01" - - "0.1" - initial_option: "0.001" - restore_value: yes - on_value: - then: - - logger.log: - format: "Chosen option: %s " - args: ["x.c_str()"] - -#------------------------# Watermeter #------------------------# -binary_sensor: - - platform: gpio - id: water_sensor_status - name: "Water sensor status" - internal: False - pin: - number: D2 - allow_other_uses: true - inverted: true - mode: - input: true - on_press: - - then: - lambda: id(total_water_pulses) += 1; - -#https://github.com/huizebruin/s0tool/issues/156 -number: - - name: Initiële meterstand m3 - platform: template - id: initial_water_value - device_class: water - min_value: 0 - max_value: 100000 - step: 0.001 - entity_category: config - icon: mdi:water - unit_of_measurement: "m³" - disabled_by_default: True - set_action: - - lambda: id(total_water_pulses) = x * 1000; - -sensor: -#------------------------# Watermeter #------------------------# -# ⬇ watermeter pulsen ⬇ # - - platform: pulse_meter #pulse_counter - internal_filter_mode: "PULSE" - internal_filter: 50ms - pin: - number: D2 - allow_other_uses: true - id: watermeter_flow - name: "watermeter flow" - state_class: measurement - unit_of_measurement: "l/min" - accuracy_decimals: 1 - icon: "mdi:water-pump" - filters: - lambda: return x * atof(id(Select_pulse_water).state.c_str()) * 1000; - -# ⬇ Totaal watermeter ⬇ # - total: - id: sensor_pulse_meter_total - name: "watermeter Totaal" - state_class: "total_increasing" - device_class: water - icon: mdi:water - unit_of_measurement: "m³" - accuracy_decimals: 3 - filters: - - multiply: 0.001 - -# ⬇ Watermeter stand bij benadering ⬇ # - - platform: template - id: watermeter_total - name: "watermeter stand" - state_class: "total_increasing" - device_class: water - icon: mdi:water - unit_of_measurement: "m³" - update_interval: 30s - accuracy_decimals: 3 - lambda: return id(initial_water_usage) + (id(total_water_pulses) * atof(id(Select_pulse_water).state.c_str())); - -# ⬇ Waterpulses only web interface for debugging ⬇ # - - platform: template - id: watermeter_flow_totaal - name: "watermeter flow totaal" - state_class: "total_increasing" - accuracy_decimals: 0 - lambda: return id(total_water_pulses); +# Delen en bewerken mag maar laat deze eerste regels staan. +# Bron : https://www.huizebruin.nl +# Bron File : https://github.com/huizebruin/s0tool/tree/main/esphome +# © Huizebruin.nl +# # ⬇ Enable Home Assistant API ⬇ # +api: + services: + - service: meterstand_water + variables: + meter_value: float + then: + - globals.set: + id: initial_water_usage + value: !lambda "return ( meter_value - (id(total_water_pulses)) * atof(id(Select_pulse_water).state.c_str()) );" + - globals.set: + id: total_water_pulses + value: "0" + +globals: + - id: initial_water_usage + type: float + restore_value: yes + initial_value: '010' + - id: total_water_pulses + type: int + restore_value: yes + +select: + # ⬇ water per m3 rate ⬇ # + - platform: template + name: "Pulsrate water per m3" + id: Select_pulse_water + optimistic: true + options: + - "0.0001" + - "0.0005" + - "0.001" + - "0.01" + - "0.1" + initial_option: "0.001" + restore_value: yes + on_value: + then: + - logger.log: + format: "Chosen option: %s " + args: ["x.c_str()"] + +#------------------------# Watermeter #------------------------# +binary_sensor: + - platform: gpio + id: water_sensor_status + name: "Water sensor status" + internal: False + pin: + number: D2 + allow_other_uses: true + inverted: true + mode: + input: true + on_press: + - then: + lambda: id(total_water_pulses) += 1; + +#https://github.com/huizebruin/s0tool/issues/156 +number: + - name: Initiële meterstand m3 + platform: template + id: initial_water_value + device_class: water + min_value: 0 + max_value: 100000 + step: 0.001 + entity_category: config + icon: mdi:water + unit_of_measurement: "m³" + disabled_by_default: True + set_action: + - lambda: id(total_water_pulses) = x * 1000; + +sensor: +#------------------------# Watermeter #------------------------# +# ⬇ watermeter pulsen ⬇ # + - platform: pulse_meter #pulse_counter + internal_filter_mode: "PULSE" + internal_filter: 50ms + pin: + number: D2 + allow_other_uses: true + id: watermeter_flow + name: "watermeter flow" + state_class: measurement + unit_of_measurement: "l/min" + accuracy_decimals: 1 + icon: "mdi:water-pump" + filters: + lambda: return x * atof(id(Select_pulse_water).state.c_str()) * 1000; + +# ⬇ Totaal watermeter ⬇ # + total: + id: sensor_pulse_meter_total + name: "watermeter Totaal" + state_class: "total_increasing" + device_class: water + icon: mdi:water + unit_of_measurement: "m³" + accuracy_decimals: 3 + filters: + - multiply: 0.001 + +# ⬇ Watermeter stand bij benadering ⬇ # + - platform: template + id: watermeter_total + name: "watermeter stand" + state_class: "total_increasing" + device_class: water + icon: mdi:water + unit_of_measurement: "m³" + update_interval: 30s + accuracy_decimals: 3 + lambda: return id(initial_water_usage) + (id(total_water_pulses) * atof(id(Select_pulse_water).state.c_str())); + +# ⬇ Waterpulses only web interface for debugging ⬇ # + - platform: template + id: watermeter_flow_totaal + name: "watermeter flow totaal" + state_class: "total_increasing" + accuracy_decimals: 0 + lambda: return id(total_water_pulses); internal: True \ No newline at end of file diff --git a/esphome/components/watermeter_flux.yaml b/esphome/components/watermeter_flux.yaml index 311e113..9c2dce8 100644 --- a/esphome/components/watermeter_flux.yaml +++ b/esphome/components/watermeter_flux.yaml @@ -1,121 +1,121 @@ -# Delen en bewerken mag maar laat deze eerste regels staan. -# Bron : https://www.huizebruin.nl -# Bron File : https://github.com/huizebruin/s0tool/tree/main/esphome -# © Huizebruin.nl -# # ⬇ Enable Home Assistant API ⬇ # -api: - services: - - service: meterstand_water - variables: - meter_value: float - then: - - globals.set: - id: initial_water_usage - value: !lambda "return ( meter_value - ((id(total_water_pulses) / (id(select_flow_pulse).state * 60 )) / 1000) ) ;" - - globals.set: - id: total_water_pulses - value: "0" - -globals: - - id: initial_water_usage - type: float - restore_value: yes -# initial_value: '010' - - id: total_water_pulses - type: int - restore_value: yes - - -# # ⬇ Water per liter rate ⬇ # -number: - - platform: template - id: select_flow_pulse - name: "Value sensor, example 7.5xQ you should put 7.5" - optimistic: true - mode: box - min_value: '0.001' - max_value: '100' - step: '1' - restore_value: yes - initial_value: '7.5' - - - - -#------------------------# Watermeter #------------------------# -binary_sensor: - - platform: gpio - id: water_sensor_status - name: "Water sensor status" - internal: False - pin: - number: D2 - allow_other_uses: true - inverted: true - mode: - input: true - on_press: - - then: - lambda: id(total_water_pulses) += 1; -sensor: -#------------------------# Watermeter #------------------------# -# ⬇ watermeter pulsen ⬇ # - - platform: pulse_counter - pin: - number: D2 - allow_other_uses: true - id: watermeter_pulse - name: "l/min at the moment" -# state_class: measurement - unit_of_measurement: "l/min" - update_interval: 60s - accuracy_decimals: 1 - icon: "mdi:water-pump" - filters: - lambda: return (x / (id(select_flow_pulse).state * 60 )); - -# ⬇ Totaal watermeter ⬇ # - total: - id: sensor_pulse_meter_total - name: "Total Liters" - unit_of_measurement: "L" - state_class: total_increasing - device_class: water - accuracy_decimals: 3 - filters: - lambda: return (x / (id(select_flow_pulse).state * 60 )); - - -# ⬇ Total M3 ⬇ # - - platform: template - id: watermeter_total - name: "watermeter total m3" - state_class: "total_increasing" - icon: mdi:water - unit_of_measurement: "m³" - accuracy_decimals: 3 - lambda: return id(initial_water_usage) + ((id(total_water_pulses) / (id(select_flow_pulse).state * 60 )) / 1000); - -# ⬇ Test Initial Water Usage ⬇ # - - platform: template - id: watermeter_test - name: "watermeter test initial water usage" - state_class: "total_increasing" - accuracy_decimals: 0 - lambda: return id(initial_water_usage); - - - platform: template - id: watermeter_q_test - name: "watermeter Q test" - # state_class: "total_increasing" - accuracy_decimals: 1 - lambda: return id(select_flow_pulse).state * 60; - -# ⬇ Waterpulses only web interface for debugging ⬇ # - - platform: template - id: watermeter_pulses - name: "watermeter pulses totaal" - state_class: "total_increasing" - accuracy_decimals: 0 - lambda: return id(total_water_pulses); -# internal: True +# Delen en bewerken mag maar laat deze eerste regels staan. +# Bron : https://www.huizebruin.nl +# Bron File : https://github.com/huizebruin/s0tool/tree/main/esphome +# © Huizebruin.nl +# # ⬇ Enable Home Assistant API ⬇ # +api: + services: + - service: meterstand_water + variables: + meter_value: float + then: + - globals.set: + id: initial_water_usage + value: !lambda "return ( meter_value - ((id(total_water_pulses) / (id(select_flow_pulse).state * 60 )) / 1000) ) ;" + - globals.set: + id: total_water_pulses + value: "0" + +globals: + - id: initial_water_usage + type: float + restore_value: yes +# initial_value: '010' + - id: total_water_pulses + type: int + restore_value: yes + + +# # ⬇ Water per liter rate ⬇ # +number: + - platform: template + id: select_flow_pulse + name: "Value sensor, example 7.5xQ you should put 7.5" + optimistic: true + mode: box + min_value: '0.001' + max_value: '100' + step: '1' + restore_value: yes + initial_value: '7.5' + + + + +#------------------------# Watermeter #------------------------# +binary_sensor: + - platform: gpio + id: water_sensor_status + name: "Water sensor status" + internal: False + pin: + number: D2 + allow_other_uses: true + inverted: true + mode: + input: true + on_press: + - then: + lambda: id(total_water_pulses) += 1; +sensor: +#------------------------# Watermeter #------------------------# +# ⬇ watermeter pulsen ⬇ # + - platform: pulse_counter + pin: + number: D2 + allow_other_uses: true + id: watermeter_pulse + name: "l/min at the moment" +# state_class: measurement + unit_of_measurement: "l/min" + update_interval: 60s + accuracy_decimals: 1 + icon: "mdi:water-pump" + filters: + lambda: return (x / (id(select_flow_pulse).state * 60 )); + +# ⬇ Totaal watermeter ⬇ # + total: + id: sensor_pulse_meter_total + name: "Total Liters" + unit_of_measurement: "L" + state_class: total_increasing + device_class: water + accuracy_decimals: 3 + filters: + lambda: return (x / (id(select_flow_pulse).state * 60 )); + + +# ⬇ Total M3 ⬇ # + - platform: template + id: watermeter_total + name: "watermeter total m3" + state_class: "total_increasing" + icon: mdi:water + unit_of_measurement: "m³" + accuracy_decimals: 3 + lambda: return id(initial_water_usage) + ((id(total_water_pulses) / (id(select_flow_pulse).state * 60 )) / 1000); + +# ⬇ Test Initial Water Usage ⬇ # + - platform: template + id: watermeter_test + name: "watermeter test initial water usage" + state_class: "total_increasing" + accuracy_decimals: 0 + lambda: return id(initial_water_usage); + + - platform: template + id: watermeter_q_test + name: "watermeter Q test" + # state_class: "total_increasing" + accuracy_decimals: 1 + lambda: return id(select_flow_pulse).state * 60; + +# ⬇ Waterpulses only web interface for debugging ⬇ # + - platform: template + id: watermeter_pulses + name: "watermeter pulses totaal" + state_class: "total_increasing" + accuracy_decimals: 0 + lambda: return id(total_water_pulses); +# internal: True diff --git a/esphome/components/wsz15d32a.yml b/esphome/components/wsz15d32a.yml index 405d95c..ce455c0 100644 --- a/esphome/components/wsz15d32a.yml +++ b/esphome/components/wsz15d32a.yml @@ -1,109 +1,109 @@ -substitutions: - impulslengte: "30ms" - -# # ⬇ Enable Home Assistant API ⬇ # -api: - services: - - service: meterstand_kwh - variables: - meter_value: float - then: - - globals.set: - id: initial_kwh_usage - value: !lambda "return ( meter_value ) ;" - - globals.set: - id: total_kwh_pulses - value: "0" - -globals: - - id: initial_kwh_usage - type: float - restore_value: yes - initial_value: '00010' - - id: total_kwh_pulses - type: int - restore_value: yes - -number: - - platform: template - id: Select_pulse_rate - name: "Pulsrate kWh" - optimistic: true - mode: box - min_value: '10' - max_value: '4000' - step: '10' - restore_value: yes - initial_value: '2000' - on_value: - then: - - logger.log: - format: "Chosen option: %s " - args: ["x.c_str()"] - -binary_sensor: - #------------------------# kwh #------------------------# - - platform: gpio - id: kwh_sensor_status - name: "kWh sensor status" - internal: False - pin: - number: D5 - allow_other_uses: true - mode: - input: true - on_press: - - then: - lambda: id(total_kwh_pulses) += 1; -#------------------------# Kwh meter S0 poort 1 #------------------------# -sensor: -# ⬇ kwh meter s0 ⬇ # - - platform: pulse_meter - pin: - number: D5 - allow_other_uses: true - name: "Actuele energie" - id: actual_power - icon: "mdi:flash" - internal_filter: ${impulslengte} - accuracy_decimals: 0 #3 - unit_of_measurement: "W" #'kW' - state_class: measurement - device_class: power - filters: - lambda: return x * (60.0 / id(Select_pulse_rate).state)* 1000 ; - -# ⬇ Totaal opgebracht ⬇ # - total: - unit_of_measurement: 'kWh' - name: "Totaal opgebracht" - id: W_opbrengst_totaal - state_class: total_increasing - device_class: energy - icon: "mdi:flash" - accuracy_decimals: 3 - filters: - - lambda: return id (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); - # - lambda: return x * (1.0 / id(Select_pulse_rate).state); - - -# ⬇ Kwh meterstand ⬇ stand bij benadering # - - platform: template - id: kwh_total - name: "Actuele meterstand" - state_class: "total_increasing" - device_class: energy - icon: "mdi:flash" - update_interval: 1s - unit_of_measurement: 'kWh' - accuracy_decimals: 3 - lambda: return id(initial_kwh_usage) + (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); - -# ⬇ kwh pulses only web interface for debugging ⬇ # - - platform: template - id: kwh_pulses - name: "kwh pulses totaal" - state_class: "total_increasing" - lambda: return id(total_kwh_pulses); - accuracy_decimals: 0 - internal: True +substitutions: + impulslengte: "30ms" + +# # ⬇ Enable Home Assistant API ⬇ # +api: + services: + - service: meterstand_kwh + variables: + meter_value: float + then: + - globals.set: + id: initial_kwh_usage + value: !lambda "return ( meter_value ) ;" + - globals.set: + id: total_kwh_pulses + value: "0" + +globals: + - id: initial_kwh_usage + type: float + restore_value: yes + initial_value: '00010' + - id: total_kwh_pulses + type: int + restore_value: yes + +number: + - platform: template + id: Select_pulse_rate + name: "Pulsrate kWh" + optimistic: true + mode: box + min_value: '10' + max_value: '4000' + step: '10' + restore_value: yes + initial_value: '2000' + on_value: + then: + - logger.log: + format: "Chosen option: %s " + args: ["x.c_str()"] + +binary_sensor: + #------------------------# kwh #------------------------# + - platform: gpio + id: kwh_sensor_status + name: "kWh sensor status" + internal: False + pin: + number: D5 + allow_other_uses: true + mode: + input: true + on_press: + - then: + lambda: id(total_kwh_pulses) += 1; +#------------------------# Kwh meter S0 poort 1 #------------------------# +sensor: +# ⬇ kwh meter s0 ⬇ # + - platform: pulse_meter + pin: + number: D5 + allow_other_uses: true + name: "Actuele energie" + id: actual_power + icon: "mdi:flash" + internal_filter: ${impulslengte} + accuracy_decimals: 0 #3 + unit_of_measurement: "W" #'kW' + state_class: measurement + device_class: power + filters: + lambda: return x * (60.0 / id(Select_pulse_rate).state)* 1000 ; + +# ⬇ Totaal opgebracht ⬇ # + total: + unit_of_measurement: 'kWh' + name: "Totaal opgebracht" + id: W_opbrengst_totaal + state_class: total_increasing + device_class: energy + icon: "mdi:flash" + accuracy_decimals: 3 + filters: + - lambda: return id (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); + # - lambda: return x * (1.0 / id(Select_pulse_rate).state); + + +# ⬇ Kwh meterstand ⬇ stand bij benadering # + - platform: template + id: kwh_total + name: "Actuele meterstand" + state_class: "total_increasing" + device_class: energy + icon: "mdi:flash" + update_interval: 1s + unit_of_measurement: 'kWh' + accuracy_decimals: 3 + lambda: return id(initial_kwh_usage) + (id(total_kwh_pulses) * (1.0 / id(Select_pulse_rate).state) ); + +# ⬇ kwh pulses only web interface for debugging ⬇ # + - platform: template + id: kwh_pulses + name: "kwh pulses totaal" + state_class: "total_increasing" + lambda: return id(total_kwh_pulses); + accuracy_decimals: 0 + internal: True From 8ddd21ab2b5a3ac95cf39d9f96c620af8640a775 Mon Sep 17 00:00:00 2001 From: Wobbe <62996429+huizebruin@users.noreply.github.com> Date: Tue, 25 Jun 2024 19:07:37 +0200 Subject: [PATCH 2/2] added verify_ssl: false for the esp8266 needed for https://esphome.io/components/http_request.html --- esphome/components/basis.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/esphome/components/basis.yaml b/esphome/components/basis.yaml index 9af78f9..bfba941 100644 --- a/esphome/components/basis.yaml +++ b/esphome/components/basis.yaml @@ -29,8 +29,10 @@ logger: ota: - platform: esphome - platform: http_request -http_request: +http_request: + verify_ssl: false + time: - platform: homeassistant id: time_homeassistant