Hi everyone. This is my first post, so please go easy with me.
I use opensourceautomation.com software for Windows, but its kind of clunky and now the website has gone offline, its time to move on.
I created some home brew hardware a few years ago with PIC microcontrollers.
Low powered PIRs and temp sensors that transmit their data over to a receiver on 434/315 Mhz.
The receiver then converts the 4 bytes of data into serial, 9600 8N1 and sends it into the comm port.
With a plugin I wrote for OSA, everything worked well.
Over the last few days, I’ve been trying to integrate this into HA.
I’ve tested the incoming bytes using some terminal software on the Linux machine. It is working fine.
I’ve got this far, and I can see data coming into Home Assistant, but I can’t for the life of me figure out how to convert each of the 4 bytes into its decimal value.
This is what I have in my configuration.yaml so far:
sensor:
- platform: serial
serial_port: /dev/ttyUSB0
baudrate: 9600
bytesize: 8
parity: N
stopbits: 1
- platform: template
sensors:
temperature_sensor:
friendly_name: Temp
unit_of_measurement: ""
value_template: "{{ states('sensor.serial_sensor') [0:1] }}"
This does show the first byte of 4 as a character, but I’ve tried all sorts to get its ASCII numeric value.
As an int, float etc. Nothing I’ve tried has worked.
Hope this is enough information for someone to help?
If you need more info, please let me know.
Kind regards,
Ian.