Skip to content

Commit

Permalink
Update with new sensor for descalings performed!
Browse files Browse the repository at this point in the history
  • Loading branch information
alco28 committed Dec 21, 2024
1 parent 9cf3384 commit 845254f
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 283 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ __pycache__/
*.user
*.userosscache
*.sln.docstates
*.code-workspace


# Python
*.pyc
Expand Down
95 changes: 51 additions & 44 deletions jura-01.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# https://community.home-assistant.io/t/control-your-jura-coffee-machine/26604

substitutions:
devicename: jura
Expand All @@ -9,11 +8,10 @@ substitutions:
dallas_sampling_period: 30s
samples: '4'
decimals: '2'
uart_tx_pin: D1 # UART TX-pin als variabele toegevoegd voor betere onderhoudbaarheid
uart_rx_pin: D2 # UART RX-pin als variabele toegevoegd voor betere onderhoudbaarheid
uart_baud_rate: "9600" # Baudrate verplaatst naar substituties
poll_interval: "30s" # Custom component polling interval als variabele toegevoegd

uart_tx_pin: D1
uart_rx_pin: D2
uart_baud_rate: "9600"
poll_interval: "30s"

esphome:
name: $devicename
Expand All @@ -27,16 +25,27 @@ esphome:
esp8266_restore_from_flash: True
name_add_mac_suffix: false

globals:
- id: single_coffee_made_counter
type: int
restore_value: yes
initial_value: '0'
- id: custom_log_level
type: int
restore_value: yes
initial_value: '0'


wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# domain: .lan

# Optional manual IP
# manual_ip:
# static_ip: 192.168.1.1
# gateway: 192.168.1.1
# subnet: 255.255.255.0
# static_ip: *.*.*.*
# gateway: *.*.*.*
# subnet: *.*.*.*

# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
Expand All @@ -47,11 +56,11 @@ captive_portal:

# Enable status LED; very low resolution logging :)

logger:
#level: WARN
level: DEBUG
logger: # set to wan to reduce SRAM logging errors
level: WARN
#level: DEBUG

# debug:
# debug: # uses a lot of SRAM
# update_interval: 50s

# ⬇ Enable Home Assistant API ⬇
Expand Down Expand Up @@ -92,37 +101,23 @@ web_server:
# sorting_weight: 20

status_led:
# Wemos uses GPIO2 for the built in LED

pin:
number: D4
number: D4 # Wemos uses GPIO2 for the built in LED
inverted: True

uart:
tx_pin: ${uart_tx_pin} # Substitutie gebruikt voor UART TX-pin
rx_pin: ${uart_rx_pin} # Substitutie gebruikt voor UART RX-pin
baud_rate: ${uart_baud_rate} # Substitutie gebruikt voor baudrate
tx_pin: ${uart_tx_pin}
rx_pin: ${uart_rx_pin}
baud_rate: ${uart_baud_rate}
id: uart_bus


##############################################################################
# Dallas temperature sensor (not default, but added for room temperature)
one_wire:
- platform: gpio
pin: D5

# Enable time component to reset at midnight
#time:
# - platform: sntp
# id: my_time


globals:
- id: single_coffee_made_counter
type: int
restore_value: yes
initial_value: '0'
- id: custom_log_level
type: int
restore_value: yes
initial_value: '0'
##############################################################################

script:
- id: reset_coffee_made_counter
Expand All @@ -137,14 +132,15 @@ script:
id(num_coffee).publish_state(id(single_coffee_made_counter));
interval:
- interval: 24h # Elke 24 uur
- interval: 24h
then:
- script.execute: reset_coffee_made_counter


################# CONTROL JURA FROM ESPHOME #################################################################
# UART bytes below have been generated with generate_esphome_jura_yaml.py
# Tested with a Jura Impressa F7 2016
####################################################################################
#############################################################################################################

#an01 = ON switch
#fa01 = OFF.
Expand All @@ -159,9 +155,6 @@ interval:
#fa0B = Steam
#fa0C = Hot water




switch:
- platform: template
name: 'Coffee Machine'
Expand Down Expand Up @@ -214,7 +207,9 @@ switch:
- lambda: |-
id(custom_log_level) = 1;
ESP_LOGI("custom", "Log level set to INFO");
########################### CONTROL ###############################
################# BUTTONS ###############################
button:
- platform: restart
name: "${devicename} Jura ESP restart"
Expand Down Expand Up @@ -620,6 +615,16 @@ sensor:
# web_server:
# sorting_group_id: sorting_group_counters

- platform: template
id: num_descaling
name: "Brewunit motor movements"
accuracy_decimals: 0
lambda: "return {};"
filters:
- filter_out: nan
- skip_initial: 1
# web_server:
# sorting_group_id: sorting_group_counters
- platform: template
id: num_coffee_Grounds
update_interval: 2min
Expand All @@ -633,7 +638,7 @@ sensor:
- skip_initial: 1
- lambda: |-
if (x > 20) {
return NAN; // Blokkeer waarden groter dan 20
return NAN; // filter out the values greater than 20, Jura F7 gives warning at 16
}
return x;
# web_server:
Expand All @@ -652,6 +657,7 @@ sensor:
# web_server:
# sorting_group_id: sorting_group_counters


# - platform: debug
# free:
# name: "Heap Free"
Expand Down Expand Up @@ -718,7 +724,7 @@ binary_sensor:
name: "${friendly_name} Status"
entity_category: diagnostic

# Custom component voor Jura Coffee en logging
# Custom component for Jura Coffee en logging
custom_component:
- id: jura_coffee
lambda: !lambda |-
Expand All @@ -733,8 +739,9 @@ custom_component:
id(num_double_ristretto),
id(num_brewunit_movements),
id(num_clean),
id(num_descaling),
id(num_coffee_Grounds),
id(tray_status),
id(tray_status),
id(tank_status)
);
return {my_jura};
Expand Down
Loading

0 comments on commit 845254f

Please sign in to comment.