Advertisement
adorobis

hex2str

Mar 27th, 2023
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #configuration.yaml
  2. sensor:
  3. - platform: command_line
  4. name: Arylic Title String
  5. unique_id: arylic_title_string
  6. command: "python3 /config/custom_files/hex2str.py {{ states('sensor.arylic_title') }}"
  7. command_timeout: 30
  8. scan_interval: 60
  9.  
  10. #/config/custom_files/hex2str.py
  11. import sys
  12. if len(sys.argv) > 1:
  13. n = sys.argv[1]
  14. print(bytearray.fromhex(n).decode())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement