-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Philips EP3243/EP3246 Support #7
Comments
Yes, it is possible to add support for the ep3200, but the codes providedin the linked repository only include actions. I would recommended forking this repository and playing around with the codes provided in the linked repository. (Replace the once included in this repo with the new onces) Adding support for different machines (and subsequent messages/protocols) would require restructuring this repository. |
I am not confident %100 but the linked repo was also a fork of ep2200 and the author stated that everything was working, so statws should be same. I have forked your repo and will give it a go. Thank you. |
@sendorm Any progress? I have a 3200 so I'm also interested. |
Tried to have a go but it was harder than I anticipated :) |
@TillFleisch I'm working on a local copy of the custom component based on your repo. As you suggested in your comment above, the status sensor is not working. It never changes state from off state which means I can't turn off the machine through the ESP as the switch moves back to off state as soon as you turn it on I'd like to try to see if I can see the messages on the bus to try to solve this. In your protocol.md document you said "The messages were obtained by listening to the bus." - Can you share how you did this? Was this using the ESP or some external debugger? It might be nice to have a text sensor that publishes the protocol messages to debug similar to the MQTT impletementation. Unfortunately, my C++ skills aren't capable of making it. |
@poldim I would recomment using the built in ESPHome uart debug functionality.
Publishing all messages via MQTT or a text sensor is not a feasible option, since the bus is always busy. |
Awesome, that worked. The semi-processed data is here that just regexed them into individual rows: https://pastebin.com/iuDnQb3S It appears when I sent the power on command it went through this sequence:
this is the rest of the data in a pivot table: I'll have to run it for longer and see if I can find any pattern, but let me know if you have any other suggestions.
|
That's interesting. Checksums don't change. That's why they're checksums. Also notable is that the 10 repeats once then the C8 is repeated from earlier. Seems like something odd is going on with those two bytes. Could they just be some kind of serialization? Also that the 1021 is repeated but with a different data packet is probably meaningful. Is it confirmed that the 'checksum' doesn't work if it's not correct for the data? (I guess these could also be errors introduced by the "man in the middle"? |
That 'checksum' problem is interesting.
I quickly checked the following on my EP2200: The messages seem to be very consistent. The checksums remains unchanged. I guess @poldim could be experiencing noise on the bus. It is wierd though, that only the last bytes are affected. This may be a phenomenon caused by filtering the messages starting with |
Noise would also help explain the apparent high number of what I would assume are retries. It's a shame the checksum is so opaque. I tried various permutations against a checksum calculator and had no luck either. |
Hm. On my 3200 (EP3243) series I did get logs saying On/Off and Cleaning when it started to clean. Without customizing any code I think (I've now tried replacing the codes for the 2200 with 3200 from https://github.com/mkorenko/esp-phillips-3200/ ). But my problem is that my ESP32-S2 Mini won't boot if power pin is plugged in. I can plug it in after boot and turning on the machine works from HA and from display button and I can use the action to make a coffee from HA. But the display doesn't work even though there are lights on it. Does this look correctly wired to you? |
I replaced the S2 Mini with a Wemos D1 Mini and I'm now using a MOSFET instead. I've used debug logging to find pre-power, power with cleaning and power without cleaning. But when I turn it on with cleaning (either from HA or from the display button) the lights on the display go on normally in a circle but right when the water is supposed to come out there's a beep and it stops. What could cause that? It won't finish the cleaning cycle. |
And when I hit 'Select Coffee' it selects coffee but starts by itself after 2 seconds but then stops immediately with a beep. I don't understand why it starts by itself and I don't understand why it stops. |
That sounds like the power off button is pressed (either hardware/stimulated).
The starting by it self could be a configuration problem. Based on the selected action, the play button is pressed automatically (actions stating with |
Maybe the Wemos D1 Mini I have is just weird. I have the USB-C variant. I went back to trying my ESP32 S2 Mini again and there it seems like everything works except for a consistent power on (which was reliable on the D1 Mini)... I think I need to use inverted = true but can't find a GPIO PIN working consistently. After the machine has been off for a while and I turn it on in HA the display lights up and works like it should. But if I turn it off and on after 10 seconds the display remains off. I've tried changing the default 1s to 0.3s, 0.5s and 1.5s and nothing seems to work reliably. Ideas? |
Sometimes, on my machine the display does not turn on (but the machine does), when turned on through HA. Is the waiting 10s to get it to not power the display on a consistent behaviour on your device? |
Current state: When power to the machine has been off I can't turn it on with the power button on the display. I have to use HA to turn it on. Then the display comes on normally. If I then turn off the machine (either from display or from HA), I can only turn on the machine (and display) from the display power button. Turning it on from HA makes the machine turn on but not the display. It doesn't matter if I wait 1 second or 10. But like you said, touching the power button makes the display come on immediately. Current settings on my ESP32 S2 Mini: |
The latest changes seem to have resolved this issue for me. The ESP will now perfrom multiple power trips, if the display does not turn on. |
Same behaviour unfortunately. Display will only turn on from HA if power to the machine and ESP32 has been removed completely. |
Actually, if I just remove the power from VBUS (red cable) or push the RST button so that the ESP32 reboots it IS able to turn on the display each time. Any ideas why? |
I am pretty clueless. Maybe there is some way for current to flow and the mosfet 'removing' the ground pins isn't enough for the display to restart. |
I got a good suggestion at ESPHome on Discord. I replaced:
With:
And removed 'invert_power_pin: true'. Then it seems to work every time. There's one weird issue though. If I cut the power to the machine and the ESP and turn it back on, it beeps after 11 seconds, then after 8 seconds and display comes on with lights on every drink and a blinking Aqua Clean. The display is not responding to touch and status in Home Assistant is that it's turned on and 'Cleaning'. Workaround seems to be to turn the machine on immediately after power plug is connected. |
This should also happen with the pin inversion method if you use The turning on after power-up is weird and may be a side effect from using a strapping pin. See this documentation for more information regarding strapping pins on the ESP32. Same goes for the 8266. |
No. Just tested again. When I use
And
It's not turning on the display. |
Hm.. it seems inverting the power pin isn't a valid move after all. I'll open up a pr to close this issue. Are you using the Arduino or IDF Framework? |
Arduino?
|
Btw, what will be the best way to update the status sensor with "Brewing" for instance after start button is pressed? I'd like to create some kinda logging of each coffee typed brewed. The 5400 series has that in the display but we could do it in HA. :) If we add 'Brewing' to status sensor I guess an automation in HA triggering on "to state 'Brewing'" and logging the from state could work. Maybe you have a better suggestion? And what's your reasoning behind having one size adjustment and one beans adjustment for each coffee type? Simplicity? Wouldn't it make more sense to have just one size adjustment and one beans adjustment and it will work for every coffee type? My 3200 series has Coffe, Espresso, Americano, Cappuccino and Latte Macchiato. I'm gonna fork this repo soon (when I can find time) for my EP3200 version. I added milk level settings and it seems like everything is working. I haven't figured out a good way of selecting ground coffee though. Not sure if a 4th level to size is the way too go. |
For a quick solution I would recommend using template sensors and global variables in ESPHome directly. This way you could remember the last selected coffee type and then update your template sensor accordinly, once it goes to brewing. Keep in mind that the state change to
Your suggestion would work just as well. I added them per-type, such that configuration is easier. I think building automations with these components is easier as the 'available/unavailable' status can be used as a trigger, which results in less nested/complex yaml configurations.
I would say a button component would be best suited for this application. I decided not to add this as a feature, as there is little/no point in automating this functionality. The assumption being: If someone needs to use the group coffee function, they have to interact with the machine anyways.
Happy coding! |
The POWER_MESSAGE_REPETITIONS set to 25 makes the display not turning on when started from HA on my EP3243. When I change it back to 5 it works again (#34). Could this perhaps be more related to variant of ESP and or mosfet/transistor rather than coffe machine model? |
I also have the same issue. But if I press the power switch again, the display turns on and it is not just a restart it just light up and the progress does not change. So I just double click the power button with a second interval. Can you repeat this behaviour? |
Yeah. It's the same behaviour we've experienced before. |
Maybe, probably, I'm not sure. I've exposed the repetition count for power on messages now via the yaml config (and reverted the default value). I should have done this in the first place to not break any working machines. |
I found the problem, my configuration was wrong. After changing it to "action: SELECT_LATTE" it works. Also the power without clean and with clean works. The screen powers up each time too. Thanks for the great work. |
@poldim based on the official product page, the |
How do I download the PR as a complete download? |
You can play around with these changes by using external_components:
- source: github://TillFleisch/ESPHome-Philips-Smart-Coffee@series-3200
refresh: 30min in your configuration. If you want a local copy you can (fork and) clone this repository and checkout the |
Just tried to build the bin from your example yaml in the 3200 branch Initial error when trying to compile:
I tried changing the id to
|
What is the ID of your main
If you are using a number (beverage settings) component a text status sensor is required. You may want to try the 32xx related configurations which are used in the CI pipeline. See here and here. Your issue may also be related to ESPHome version 2024.3.x.dev, which I did not take a look at yet. The CI passed for the last publicly available (via pip) version of ESPHome. |
So I needed to change the When I flashed using your config with the pins for my hardware setup, the display didn't turn on. Then I noticed you have The good news is most of the stuff works, the bad news is that the new stuff for this machine (beans/size) don't work. Selecting any value didn't do anything on the machine. It stayed at the original 2 dots on both beans and size. For reference, the hex code that I pasted in an earlier post for beans / size / milk amount does work in my version of your code as manual buttons. logger:
baud_rate: 0
external_components:
#### - source: github://TillFleisch/ESPHome-Philips-Smart-Coffee@main
- source: github://TillFleisch/ESPHome-Philips-Smart-Coffee@series-3200
refresh: 30min
uart:
# UART connected to the mainboard
# - tx_pin: GPIO1
# rx_pin: GPIO3
- tx_pin: TX
rx_pin: RX
baud_rate: 115200
id: uart_mainboard
# UART connected to the display
# - tx_pin: GPIO15
# rx_pin: GPIO13
- tx_pin: D1
rx_pin: D5
baud_rate: 115200
id: uart_display
philips_coffee_machine:
display_uart: uart_display
mainboard_uart: uart_mainboard
power_pin: D7
invert_power_pin: false
power_trip_delay: 750ms
id: philip
model: EP_3243
text_sensor:
- platform: philips_coffee_machine
controller_id: philip
id: philips_coffee_machine_status
name: "Status"
switch:
- platform: philips_coffee_machine
controller_id: philip
name: "Cleaning Power"
icon: mdi:coffee-maker
- platform: philips_coffee_machine
controller_id: philip
name: "Power"
clean: false
icon: mdi:coffee-maker
button:
- platform: philips_coffee_machine
controller_id: philip
action: MAKE_COFFEE
name: "Make Coffee"
icon: mdi:coffee
- platform: philips_coffee_machine
controller_id: philip
action: SELECT_HOT_WATER
name: "Select Hot Water"
long_press: true
icon: mdi:tea
- platform: philips_coffee_machine
controller_id: philip
action: MAKE_LATTE
name: "Make Latte"
icon: mdi:coffee
- platform: philips_coffee_machine
controller_id: philip
action: SELECT_AMERICANO
name: "Select Americano"
number:
- platform: philips_coffee_machine
type: bean
name: "Coffee beans"
controller_id: philip
status_sensor_id: philips_coffee_machine_status
source: COFFEE
- platform: philips_coffee_machine
type: size
name: "Coffee size"
controller_id: philip
status_sensor_id: philips_coffee_machine_status
source: COFFEE |
In any situation or only when selecting on of the new beverages? The codes from this comment seem to be identical with the ones of the current PR draft. Therefore, adding a button with action @quack3d can you replicate this issue on the |
Milk, bean and size all working fine here. Status works as well. I noticed @poldim uses source: COFFEE though. I haven't specified source so it's available for all the different beverages. |
@quack3d, can you do some testing (including beverage with specific source) on your It may be the case that the |
I tested now with @poldim's setup above but with different tx pins, rx pins, power pin and without power_trip_delay. After hitting Power the machine starts and status becomes 'Idle' after a bit like it should. @poldim But in your setup you don't have SELECT_COFFEE so the 'Coffee beans' and 'Coffee size' is not intended to work (if I understand @TillFleisch's intention here). You need to specify source to 'ANY' (or simply remove 'source: COFFEE') for them to work with all beverages. Otherwise you need one for each source like this one for Americano:
|
The @quack3d are there any other problems? Do all buttons, beverage settings (per type) and possible states of the status sensors work? |
Everything seems to work for me. But I haven't tested the buttons for AQUA_CLEAN and CALC_CLEAN - and I don't want to. 😊 |
Great, thank you!
That is totally fine and understandable. If you want, you can verify that the codes used in the PR draft match those retrieved via debugging when using them manually (IIRC a short press on those buttons does nothing). If they are matching, they should work like the others. |
I changed my yaml to I also confirmed that my code allows me to manually control each of the functions correctly. My code doesn't have any logic, but the machine receives and acts on each button press correctly. button:
# - platform: philips_action_button
# controller_id: philip
# action: MAKE_COFFEE
# name: "${friendly_name} Make Coffee"
# icon: mdi:coffee
# - platform: philips_action_button
# controller_id: philip
# action: MAKE_LATTE
# name: "${friendly_name} Make Latte"
# icon: mdi:coffee
- platform: philips_action_button
controller_id: philip
action: SELECT_COFFEE
name: "${friendly_name} Select COFFEE"
icon: mdi:coffee
- platform: philips_action_button
controller_id: philip
action: SELECT_ESPRESSO
name: "${friendly_name} Select ESPRESSO"
icon: mdi:coffee
- platform: philips_action_button
controller_id: philip
action: SELECT_AMERICANO
name: "${friendly_name} Select AMERICANO"
icon: mdi:coffee
- platform: philips_action_button
controller_id: philip
action: SELECT_CAPPUCCINO
name: "${friendly_name} Select CAPPUCCINO"
icon: mdi:coffee
- platform: philips_action_button
controller_id: philip
action: SELECT_LATTE
name: "${friendly_name} Select LATTE"
icon: mdi:coffee
- platform: philips_action_button
controller_id: philip
action: SELECT_HOT_WATER
name: "${friendly_name} Select HOT WATER"
icon: mdi:tea
- platform: philips_action_button
controller_id: philip
action: PLAY_PAUSE
name: "${friendly_name} Select PLAY / PAUSE"
icon: mdi:play-pause
- platform: philips_action_button
controller_id: philip
action: BEAN_AMOUNT
name: "${friendly_name} Select BEAN_AMOUNT"
icon: mdi:play-pause
- platform: philips_action_button
controller_id: philip
action: WATER_AMOUNT
name: "${friendly_name} Select WATER_AMOUNT"
icon: mdi:play-pause
- platform: philips_action_button
controller_id: philip
action: FROTHED_MILK_AMOUNT
name: "${friendly_name} Select FROTHED_MILK_AMOUNT"
icon: mdi:play-pause |
This sounds like intended behaviour. Within the CI test files the Hot Water option has long press enabled, which has this exact effect. I guess the status sensor is not updated properly. Does it show something like |
Not sure on the EP3243 / EP3246 variants, but my EP3241 hot water is not a long press type of input. Looking at googled images, the user interface appears identical between the three.
It just stays on |
Hot water is also a short press button on the other machines. The CI configuration has the Out of curiosity: Can you generate a log with messages form the mainbooard to the display (Mainboard UART, direction: RX)? |
Yea, I think only the clean buttons need the long press
Log: https://drive.google.com/file/d/16jwNCjNT1BRdtC6zLpgdCc6afMipGSlf/view?usp=sharing LMK if you need anything else |
The logs contain messages going from the display to the mainboard (based on the message length and
It's interesting to see that the commands from the I'm starting to think that bytes 5-7 (within messages from the display) are used as version indicators: Anyhow, now that we know the machines are different for certain, we should move the |
Hello,
Is there a way to add support for EP3200 series coffee machines. The codes can be found here:
https://github.com/micki88/Philips-ep3200-testing
Thanks
The text was updated successfully, but these errors were encountered: