Thank you that helped a lot,
this is what I ended up with I added " ESTABLISHED" just to make sure it was connected and not just trying to connect
if u use this just make sure that you add or remove enough spaces " " between 8888 and ESTABLISHED so it can get a match, this should be 35 chars long in total
>>192.168.1.133:8888 ESTABLISHED<<
- platform: command_line
name: zigbee connected
command: /bin/bash -c "( netstat -tn | grep -c '192.168.1.133:8888 ESTABLISHED' || true)"
scan_interval: 20
command_timeout: 10
unit_of_measurement: ' '
Big thank you for the work you all put into this