MRobi
(Mike)
July 12, 2023, 12:47am
23
mikeybatoz:
i cracked the advertised packet data yesterday!
#!/usr/bin/expect -f
set prompt "#"
set address 34:85:18:6a:52:52
spawn bluetoothctl
expect -re $prompt
send "connect $address\r"
expect "Connection successful"
send "menu gatt\r"
send "select-attribute /org/bluez/hci0/dev_34_85_18_6A_52_52/service002e/char0032\r"
send "notify on\r"
sleep 1
send "exit\r"
send "exit\r"
send "quit\r"
expect eof
/config/./FILENAME.sh | grep 1e | awk ‘NR==1 { print"0x" $15 $16 }’ | xargs printf “%d\n” - vpd
/config/./FILENAME.sh | grep 1e | awk ‘NR==1 { print"0x" $13 $14 }’ | xargs printf “%d\n” - humidity
/config/./FILENAME.sh | grep 1e | awk ‘NR==1 { print"0x" $11 $12 }’ | xargs printf “%d\n” - Temperature in C
/config/./FILENAME.sh | grep 1e | awk 'NR==1 { print "0x" $11 $12 }' | xargs printf "%d\n" | xargs -n 1 bash -c echo $(($1 * 9/5 + 3200 ))' args | xargs -n 1 bash -c echo $(($1 /100 ))' args”
- Temperature in Fahrenheit
Would you be able to ELI5 how to use this to populate the sensor data into HA? I don’t really care if I can control the controller since it’s just running through an automation itself, I’d just like to be able to get all of the data from the controller onto my dashboard