The program converts the given hex code to informative data of door status upon opening or closing:
- Temperature
- Humidity
- Magnetic Status
The given hex code in a format of EM300 (Environment Monitoring Sensor)
- Golang
- "encoding/hex"
- "fmt"
Run the program using
go run .
Use one of these hexadecimal codes to take out the data
0367F600046882060001
Output:
Temperature: 24.6 C
Humidity: 65%
MagneticStatus: Open
0367FFFFE1046882060001
Output:
Temperature: -31.0 C
Humidity: 65%
MagneticStatus: Open
Ansar Issabekov https://www.linkedin.com/in/ansarissabekov/
EM300 Series (Environment Monitoring Sensor)
- Section “5.2 Sensor Data” explains how to decode the measurements the sensor sends.