‘# out lines 120 to 125 in the yaml.
Yaml is the workaround!
‘# out lines 120 to 125 in the yaml.
Yaml is the workaround!
Anyone having the situation that sometime the presence sensor is not going back to “off”?
Only restarting the device then set it back.
For me the presence sensor worked flawless for months and then got stuck.
I assumed it was because he got power from the nuc running homeassistant and it happened right after restarting the device.
Unfortunately also another power source and installing the default config or resetting did not help so i removed it from power for a day or two and now it works ok-ish.
Only thing i noticed is, that it takes 1min + to reset detection after there is no more movement
This is my config at the moment: https://github.com/Nailik/EspHomeConfigs/blob/521d050800a0b2e3e72219b0fa807666461859de/athom-presence-sensor.yaml
Main difference is that i removed the led and set the lux sensor to update more frequently because in the beginning i had it to turn the lights only on when it is dark and the issue was that when someone left the room and reentered it sometimes the lux didn’t update and therefore didn’t turn on the light.
Hi guys,
i bricked my Athom Presence Sensor during an update via WIFI.
Now the device can’t be flashed via USB (CH430C) - (second device works flawless via USB).
So i think via TTL → USB Adapter it could work to flash the right firmware, but I don’t know how to connect the PINS correct.
Hope you can help me to make the sensor work again
Here are the Pins on the board - but I’dont know which i need to connect.
P1 = Boot
P1 = Ground
J1 = 3V3
J1 = RXD
J1 = TXD
J1 = Ground
Thank you
Hi sparkydave (and everyone else reading this!) I would also like to flash Blakadder’s ESPHome config on my two Athom PS01 Presence Sensors, but I’m new to Home Assistant and would appreciate guidance on how to do this. I’ve reviewed the ESPHome docs and Athom’s docs (Athom’s are very minimal, kind of a joke) but am not sure how to proceed.
I want to flash Blakadder’s version because whatever is running on my PS01s now makes them very slow to rejoin the wifi network and go online. If I power cycle a PS01 it won’t always join the network right away… I need to restart Home Assistant and sometimes even reboot the entire Home Assistant server (Raspberry Pi) in order for the devices to show up again. I need to get this fixed so I don’t have to restart Home Assistant every time there’s a power outage and my PS01s power cycle.
To summarize I’m running Home Assistant OS (v11.5) on a Raspberry Pi. I have installed ESPHome dashboard. When I got the Athom PS01 (two of them) from Athom two days ago, I followed their minimal directions to set up the PS01s: Plug in PS01, connect to wifi on my phone, find Athom’s SSID, connect, enter SSID/password for my network. PS01 joins network. Next go to Home Assistant, find discovered device and add it/config. That worked fine and my PS01s were in Home Assistant and I could config them with automations. I even moved them around a couple of times (unplug, reorient to hide cable, plug in again) and they were back online in less than 2 min each time.
After a day I noticed in the ESPHome web UI that the two devices were showing up with an “Adopt” option. I clicked “Adopt” for each one and followed the steps to have ESPHome “adopt” the devices. Code was compiled and installed and the devices rejoined the network OK. According to Device Info both are running Firmware 2023.12.9.
I think to install Blakadder’s config from Blakadder’s ESPHome Configurations | esphome-configs I need to go into ESPHome Web UI, click “EDIT” for the PS01 device I want to edit, and replace the yaml that shows up there with Blakadder’s. Do I also need to ensure my api encryption key and wifi SSID and password are in the config? I noticed those settings are in my current yaml cfg for these devices, but do not exist in Blakadder’s config.
I just want to make sure I follow the right process and don’t “brick” these devices. I really like the PS01… it works great. I just need it to be able to recover from a power outage. When I first added them to Home Assistant using Athom’s minimal process they were able to recover from a power outage fine. It seems after installing the firmware (adopting the PS01 into ESPHome UI) I am having this issue where the PS01 doesn’t want to rejoin the network/come online in Home Assistant, without a hard reboot of the system.
Thanks for the guidance - first time using ESPHome (been using Home Assistant for 5 months).
I have lots of automations set up using motion sensors, door sensors etc. and recently began adding presence sensors. I also bought a Tuya ZY-M100 but that thing is flaky. I had to add another Zigbee coordinator running Zigbee2MQTT in order to get that thing to be configurable, and it locks up every 2 days (so hooked it up to smart plug and power cycle every day to keep it functional). Also got a Linptech ES1 but set it up in ZHA before I got the Zigbee2MQTT set up so right now it’s just got basic presence sensing. I may try moving it to the other Zigbee network at some point.
I prefer the PS01 as it was easy to add to Home Assistant, is very responsive, has PIR and mmWave sensing as well as light/lux sensor. Hoping I can get this silly issue fixed with it not recovering gracefully from a power cycle… was thinking this would be the unit to go with but if I can’t get this working I don’t think I will be buying more of them!
Appreciate the help.
Yes, just add as needed.
Here is my version of the Blakadder one which includes wifi settings.
substitutions:
name: "alfresco-presence-sensor"
friendly_name: "Alfresco Presence Sensor"
# room: ""
device_description: "mmwave radar human presence sensor"
project_name: "Athom Technology.Presence Sensor"
project_version: "1.0-blak"
pir_delay_off: "1s" # set the PIR no occupancy delay here, it also influences delay for Occupancy sensor
esphome:
name: "${name}"
friendly_name: "${friendly_name}"
name_add_mac_suffix: true
project:
name: "${project_name}"
version: "${project_version}"
esp8266:
board: esp8285
restore_from_flash: True
logger:
api:
ota:
mdns:
disabled: false
web_server:
port: 80
wifi:
ssid: !secret wifi_ssid_not_1
password: !secret wifi_password_not_1
manual_ip:
static_ip: 192.168.30.181
gateway: 192.168.30.1
subnet: 255.255.255.0
captive_portal:
dashboard_import:
package_import_url: github://blakadder/esphome-configs/athom_ps01.yaml
light:
- platform: status_led
name: "Status LED"
id: led
pin: GPIO16
disabled_by_default: true
entity_category: config
i2c:
sda: GPIO4
scl: GPIO5
scan: true
uart:
tx_pin: GPIO15
rx_pin: GPIO13
baud_rate: 115200
# debug:
# direction: BOTH
# dummy_receiver: true
# after:
# delimiter: "\n"
# sequence:
# - lambda: UARTDebug::log_string(direction, bytes);
binary_sensor:
- platform: status
name: "Status"
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: true
name: "Button"
disabled_by_default: true
internal: true
on_multi_click:
- timing:
- ON for at least 10s
then:
- button.press: factory_reset_device
- platform: gpio
pin:
number: GPIO14
mode:
input: true
pullup: true
name: "Pir Sensor"
id: pir
filters:
# - delayed_on: 50ms
# - delayed_off: 500ms
- delayed_off: ${pir_delay_off}
device_class: motion
# on_press:
# then:
# - light.turn_on: led
- platform: gpio
pin:
number: GPIO12
mode:
input: true
pullup: true
name: "mmWave Sensor"
id: mmwave
# filters:
# - delayed_on: 50ms
device_class: occupancy
on_press:
then:
- light.turn_on: led
on_release:
then:
- light.turn_off: led
- platform: template
name: "Occupancy"
id: occupancy
device_class: occupancy
lambda: |-
if ( id(mmwave).state or id(pir).state) {
return true;
}
else if (id(mmwave).state == 0 and id(pir).state == 0) {
return false;
}
else {
return id(occupancy).state;
}
sensor:
- platform: uptime
name: "Uptime Sensor"
- platform: wifi_signal
name: "WiFi Signal Sensor"
update_interval: 60s
- platform: bh1750
name: "Light Sensor"
address: 0x23
update_interval: 5s
switch:
- platform: template
name: "mmWave Status"
id: "mmwave_sensor"
internal: true
entity_category: config
optimistic: true
restore_mode: DISABLED
turn_on_action:
- uart.write: "sensorStart\r\n"
turn_off_action:
- uart.write: "sensorStop\r\n"
number:
- platform: template
name: Farthest Detection #Value range: 1.9 ~ 12m Default: 6
id: Farthest_Detection
entity_category: config
min_value: 1.9
max_value: 12
initial_value: 6
optimistic: true
step: 0.1
restore_value: true
unit_of_measurement: m
mode: box
set_action:
- switch.turn_off: mmwave_sensor
- delay: 500ms
- uart.write: !lambda
std::string ranges = "setRange 1.8 " + str_sprintf("%.1f",id(Farthest_Detection).state) + "\r\n";
return std::vector<uint8_t>(ranges.begin(), ranges.end());
- delay: 500ms
- uart.write: "saveConfig\r\n"
- delay: 500ms
- switch.turn_on: mmwave_sensor
- platform: template
name: Maintain Sensitivity #Value range: 0 ~ 9 Default Maintain sensitivity: 7
id: Maintain_Sensitivity
entity_category: config
min_value: 0
max_value: 9
initial_value: 7
optimistic: true
step: 1
restore_value: true
mode: slider
set_action:
- switch.turn_off: mmwave_sensor
- delay: 500ms
- uart.write: !lambda
std::string sensitivitys = "setSensitivity " + str_sprintf("%.0f",id(Maintain_Sensitivity).state) + " " + str_sprintf("%.0f",id(Trigger_Sensitivity).state) + "\r\n";
return std::vector<uint8_t>(sensitivitys.begin(), sensitivitys.end());
- delay: 500ms
- uart.write: "saveConfig\r\n"
- delay: 500ms
- switch.turn_on: mmwave_sensor
- platform: template
name: Trigger Sensitivity #Value range: 0 ~ 9 Default Trigger sensitivity: 5
id: Trigger_Sensitivity
entity_category: config
min_value: 0
max_value: 9
initial_value: 5
optimistic: true
step: 1
restore_value: true
mode: slider
set_action:
- switch.turn_off: mmwave_sensor
- delay: 500ms
- uart.write: !lambda
std::string sensitivityss = "setSensitivity " + str_sprintf("%.0f",id(Maintain_Sensitivity).state) + " " + str_sprintf("%.0f",id(Trigger_Sensitivity).state) + "\r\n";
return std::vector<uint8_t>(sensitivityss.begin(), sensitivityss.end());
- delay: 500ms
- uart.write: "saveConfig\r\n"
- delay: 500ms
- switch.turn_on: mmwave_sensor
- platform: template
name: Detection Delay #Confirmation delay Value range: 0 ~ 100 default 0.050 seconds.
id: Detection_Delay
entity_category: config
min_value: 0.05
max_value: 60
initial_value: 0.05
optimistic: true
step: 0.05
mode: box
restore_value: true
unit_of_measurement: seconds
set_action:
- switch.turn_off: mmwave_sensor
- delay: 500ms
- uart.write: !lambda |-
std::string detections = "setLatency " + str_sprintf("%.1f",id(Detection_Delay).state) + " " + str_sprintf("%.0f",id(Fading_Time).state) + "\r\n";
return std::vector<uint8_t>(detections.begin(),detections.end());
- delay: 500ms
- uart.write: "saveConfig\r\n"
- delay: 500ms
- switch.turn_on: mmwave_sensor
- platform: template
name: Fading Time #Fade-out delay Value range: 0.5 ~ 1500, default 15 seconds.
id: Fading_Time
entity_category: config
min_value: 0.5
max_value: 300
initial_value: 15
optimistic: true
step: 0.5
restore_value: true
unit_of_measurement: seconds
mode: auto
set_action:
- switch.turn_off: mmwave_sensor
- delay: 500ms
- uart.write: !lambda |-
std::string fadings = "setLatency " + str_sprintf("%.1f",id(Detection_Delay).state) + " " + str_sprintf("%.0f",id(Fading_Time).state) + "\r\n";
return std::vector<uint8_t>(fadings.begin(), fadings.end());
- delay: 500ms
- uart.write: "saveConfig\r\n"
- delay: 500ms
- switch.turn_on: mmwave_sensor
- platform: template
name: Blockade Time #Configure block time Value range: 1 ~ 255, default 1 seconds.
id: Blockade_Time
entity_category: config
min_value: 1
max_value: 255
initial_value: 1
optimistic: true
step: 1
restore_value: true
unit_of_measurement: seconds
mode: box
set_action:
- switch.turn_off: mmwave_sensor
- delay: 500ms
- uart.write: !lambda
std::string blockades = "setInhibit " + str_sprintf("%.0f",x) + "\r\n";
return std::vector<uint8_t>(blockades.begin(), blockades.end());
- delay: 500ms
- uart.write: "saveConfig\r\n"
- delay: 500ms
- switch.turn_on: mmwave_sensor
button:
- platform: factory_reset
name: Restart with Factory Default Settings
id: Reset
entity_category: config
internal: true
- platform: template
name: "Reset device"
id: "factory_reset_device"
entity_category: config
internal: true
on_press:
- switch.turn_off: mmwave_sensor
- delay: 500ms
- uart.write: "resetCfg\r\n"
- delay: 1s
- switch.turn_on: mmwave_sensor
- button.press: Reset
- platform: restart
name: Restart_esp
id: restart_esp
entity_category: config
internal: true
- platform: template
name: "Restart_mmWave"
id: "restart_mmwave"
entity_category: config
internal: true
on_press:
- uart.write: "resetSystem\r\n"
- platform: template
name: Restart device
entity_category: config
on_press:
- button.press: restart_mmwave
- delay: 1s
- button.press: restart_esp
text_sensor:
- platform: wifi_info
ip_address:
name: "IP Address"
ssid:
name: "Connected SSID"
disabled_by_default: true
mac_address:
name: "Mac Address"
disabled_by_default: true
time:
- platform: sntp
id: my_time
Thank you @sparkydave for the info and for including your example config. In my prior reply I wrote:
So to be clear, in order to edit & apply the updates to my PS01, I need to go to ESPHome Web UI, click “EDIT” for the PS01 device I want to edit, replace the yaml (and include my api encryption key, as well as WiFi settings). Then, I click the “INSTALL” option on that same screen where I enter the yaml. Is that correct?
Appreciate your assistance with this, as I’ve never updated a yaml config for a ESPhome device (and I couldn’t find documentation on it for this device). Thank you.
Yep, that’s the correct process. Make sure your device name stays the same with the new config code.
Will do! Thank you for the information. After I’ve had a chance to try this I’ll update the thread.
OK, so I followed the steps on one of my PS01s and I have the same issue: Upon restart the blue light on the front just blinks for minutes. I did the power cycle (unplug PS01, wait 10 seconds, plug back in) 10 minutes ago and it’s still got a blinking blue light on the front and all sensors for this PS01 device show up as “Unavailable” in my Home Assistant dashboard.
So my home network is using DHCP to assign IP addresses. I did not set up an IP reservation for this device in my DHCP server… is that necessary? I noticed the IP it had before doesn’t respond to pings, but looking at the IP assignments in my router app shows that the sensor still has the same IP assigned… looks like it is not even coming onto the network.
To summarize, these are the steps I followed.
As I finish this update it’s been 20 minutes and the blue light on front of the device is still flashing. Does anyone have any ideas what I could try next? Both PS01 devices show the same behavior so I don’t think it’s a single flaky device. When I first got the devices they were joined to Home Assistant but not adopted by ESPHome. In that state I could not update firmware on the devices, but they were able to recover quickly from a power cycle (<1 minute). Now they never seem to connect unless I restart Home Assistant or reboot the Home Assistant server, which is a big annoyance. Thanks for any tips.
It’s definitely best to assign fixed IP addresses to your devices, either via assignments in the router or on the device itself.
One other detail I left out above @sparkydave: After the update was finished I went back into ESPHome Web UI, adopted the newly-installed device and deleted the old device (the old name, recall I had to rename it to update the yaml). When I adopted the device I clicked “skip” on install as I did not want to overwrite anything I had just installed. Just including that in case it is important… thanks.
Hi @sparkydave & everyone else reading this, shortly before writing this I noticed the PS01 sensor came back online… 28 minutes after I plugged it back in!!! I wish I knew why it took so long to come back online. Nearly 30 minutes to return to a usable state is way too long. I am going to leave the other PS01 on the “Athom firmware/yaml” so I could compare behavior between the two.
OK, I created DHCP IP reservations for these two PS01 devices in the router. Now they will always have the same IP addresses. I am not sure what else I could do with these to try to fix them. It should not take nearly 30 minutes to recover from a power cycle. Anyone have any suggestions? Thanks!
Yeah, that’s definitely not normal. Mine come back online within seconds.
OK @sparkydave, I think creating IP allocations via DHCP did the trick. I did two power cycle tests with both devices. Unplugged both, waited 20 seconds, plugged back in. Both were back online, pingable and working again in about 54 seconds.
That’s much better than nearly 30 minutes for the last test of the PS01 I updated the YAML on. Based on this I don’t think the YAML/Athom firmware was the cause, but perhaps the fact I wasn’t reserving IP addresses for these Athom devices in my router’s DHCP table.
I will try a few other tests over the upcoming days, but I’m hoping this DHCP IP allocation trick fixed it. Thank you for the suggestion! And I appreciate the help in explaining how to update YAML/compile code for ESPHome devices.
It is worth reading the following section on
Most of the issues are solved by setting fixed IP and turning on “Use ping for status”. You can find this in the ESPHome add-on as below
My nodes reconnect after a reboot within a few seconds
Thank you @JulianDH ! I made the change in the config to use ping for checking status.
Then I restarted esphome… I did a power cycle of the two devices and one came back in about 25 seconds and another in 15 seconds. So that is definitely better than before, when it was almost a minute.
If I can keep the restart time down to 1 minute or less after a power cycle, I’m very satisfied, since the only time these will probably go offline is during a power outage (which is rare). Thanks again for the helpful info.
On restart my Athom Presence Sensor takes 6 seconds for the device to reappear as active and report the state of the sensors. Something is wrong if it takes a minute. There are many ESPHome threads on peoples battles with networking.
Thanks for the tip!
@sparkydave and @juliandh, I figured out the issue… my Athom PS01 sensors were taking a long time to connect (again) because of my wireless network. It’s a mesh system with a router (base) unit and a node (satellite) downstairs. Last night I unplugged a PS01 to move a cord and when I plugged it back in, it still didn’t connect after 30 minutes!!! I had to go to sleep but when I woke up this morning I did some troubleshooting.
I’m fairly certain the PS01 was bouncing back and forth between the two units (base and satellite) and for some reason was not able to “sync up” with one or the other. I tried setting DHCP IP reservations and binding the PS01s (forcing them) to connect to the router which is on the same level/floor, but that didn’t seem to help. It would still take a long time to connect (as you both noted it should only take seconds).
Anyway I saw this morning in Home Assistant that the PS01 finally connected last night after more than an hour of being unavailable… unacceptable. I got an old WiFi extender out of the closet, and set it up on a different network (acting as an extender/repeater for the existing wireless network). Next I updated the secrets file for the PS01s with the new WiFi network & password, reinstalled the YAML for both of them, and voila, then came online within 10 seconds. I have since done several power cycle tests and they came back online within 4 seconds, 10 seconds, 15 seconds and 7 seconds. This is much faster than when I was using the mesh network.
I have had other issues with the mesh system (it’s ASUS, and it sucks). I will never use ASUS again! I should have checked this right away but it’s been so long since I had a wireless issue at the house that I didn’t think of it. Thanks for all the guidance and suggestions to this point… really appreciate the help.