That’s what I figured. If you look a little closer at the top, there are 2 people who shared their configs and uuid’s. They aren’t the same at all. I realize that you used one of those configs above and your able to toggle the light On/Off but, that’s no guarantee all the other ones will be identical too. Other than that and some minor differences, you’re config is basically the same as the others and how you send a command to make the bed do an action, they are identical.
Here is you’re “feet up” action. The command to send a BT service out of your esp32. They’re basically identical except uuid’s and value.
- platform: template
name: "Bed1 feet up"
icon: "mdi:bed"
on_press:
- ble_client.ble_write:
id: rc2bed1
service_uuid: ffe0
characteristic_uuid: ffe1
# List of bytes to write.
value: [0x40, 0x02, 0x70, 0x00, 0x01, 0x09, 0x04, 0x40]
Here is another person’s “feet up” action
- platform: template
name: "Feet up"
id: feet_up
icon: "mdi:bed"
on_press:
- ble_client.ble_write:
id: bed
service_uuid: aa5c
characteristic_uuid: 5a55
value: [0x68, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x30, 0x34, 0x31, 0x36, 0x16]
They’re all totally different except for your light.
Here is one person’s uuid’s and Hex values
All controls (head / feet / head/feet combined / lamp) all use:
[Service UUID: 0xffe0]
[UUID: 0xffe1]
Specific commands:
Head up : 40 02 70 00 01 0b 02 40
Head down : 40 02 71 00 01 0a 02 40
Both up : 40 02 70 00 01 07 06 40
Both down : 40 02 71 00 01 06 06 40
Foot up : 40 02 70 00 01 09 04 40
Foot down : 40 02 71 00 01 08 04 40
When logging I see repeating the commands above, for as long as the button
is pressed. After that I see the following command: 40 02 73 00 00 0b 40
(which does stop movement I guess, even in shorter than 300ms period?)
Lamp control
ON 40 20 72 00 08 de 00 01 02 01 01 01 01 01 40
OFF: 40 20 72 00 08 df 00 01 02 01 01 01 01 00 40
And here’s the other one that is very different.
service_uuid: aa5c
characteristic_uuid: 5a55
Head up: 0x68, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x30, 0x36, 0x31, 0x38, 0x16
Head down: 0x68, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x30, 0x39, 0x31, 0x3b, 0x16
Feet up: 0x68, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x30, 0x34, 0x31, 0x36, 0x16
Feet down: 0x68, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x30, 0x37, 0x31, 0x39, 0x16
Both up: 0x68, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x32, 0x37, 0x31, 0x3b, 0x16
Both down: 0x68, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x32, 0x38, 0x31, 0x3c, 0x16
It appears you just have the wrong uuid’s and/or the wrong hex values and they don’t match what your BLE receiver is programmed to accept and therefore can’t command the bed to move.
One of the posts above, they were talking about how they got the uuid’s and values, as well as what phone app they used… I’d try doing that or asking them directly what the process is. Maybe just as easy, you can get all that with the esp32 by just removing the comment '#'s at the very top… All of this stuff that’s commented out.
on_ble_advertise:
# - mac_address: xx:xx:xx:xx:xx:xx
# then:
# - lambda: |-
# ESP_LOGD("ble_adv", "New BLE device");
Then flash the board again. You may also need to increase your log level to VERBOSE or higher detail VERY_VERBOSE.
logger:
level: VERBOSE
You need to do all that or use one of those other guy’s methods from above. Whichever way you choose, you will need to record the correct data for your bed/remote and then go through the your whole code and replace each one that is incorrect. Once you do that, then flash and test it again. I suspect this is your only or at least the main problem.
Here are some esphome documentation that will help you understand what’s going on.