Ping an Lan device online, automation not working

I like to use HA to monitor my solar inverter status to ensure it is online. Thinking using Ping the invertor to check if it is ok and report fault if it is offline.

My HA is HA core loaded on container at Qnap NAS with latest 2023.9.3

I added following at configuration.yaml to create binary_sensor ping

command_line:

  • binary_sensor:
    command: ‘ping -c 1 192.168.18.30 | grep “1 received” | wc -l’
    name: “is_solaredge_online”
    device_class: connectivity
    payload_on: 1
    payload_off: 0

after restart, I can see entity is_solaredge_online

in Automation, add trigger as show photo.

run the test. it sent notifcation ok. However, if I block invertor ip address or turn off invertor for more than 5 mins, it doesn’t trigger the event.

further I noticed in developer tools, state of entity “states. is_solaredge_online” is off.

Suspend binary.sensor ping I create doesn’t work. how to test and see result? And where did I go wrong?

Ping is now set up via the UI: https://www.home-assistant.io/blog/2023/12/06/release-202312/#integrations-now-available-to-set-up-from-the-ui

Also in future please format your posts correctly: https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

Thanks. thought paste the text works. now trying to do so with pre-format method.

spend a day to search the web and read note about how to upgrade HA version.

My Home Assistant version is 2023.9.3 in container station (v3.0.5.623) at Qnap NAS.
Tried to work through via Qnap web console. it seems not successful. Not sure how to get easy upgrade