Alda
September 5, 2022, 5:53am
1
On my odroid n2+ system I want get working communication with external device via sensor command
Command which I’m sending is from device manual and tested that’s working.
Command line Sensor - Home Assistant (home-assistant.io)
Into configuration.yaml I added :
# Example configuration.yaml entry
sensor:
- platform: command_line
name: Heat unit
command: "echo -en '\x10\x01\xFF\xFF\x10\x30\xF8\x02\xE3\x61\xFF' > /dev/ttyUSB0"
unit_of_measurement: "°C"
value_template: "{{ value | multiply(0.001) | round(1) }}"
Question is how to call this command and how read a response ?
tom_l
September 5, 2022, 5:58am
2
You don’t. Home Assistant will send the command regularly (polling) and update the state for you.
Alda
September 5, 2022, 6:01am
3
so on the main screen I will add only entity ?
I can’t see any with name Heat unit
tom_l
September 5, 2022, 6:08am
4
Look in developer Tools → States, do you see sensor.heat_unit
?
If not, check your logs for errors.
You did do a config check and restart Home Assistant after creating it, didn’t you?
Alda
September 5, 2022, 6:10am
5
no not there and in the log I can see :
2022-09-05 08:02:16.401 ERROR (MainThread) [homeassistant.components.sensor] command_line: Error on device update!
Alda
September 5, 2022, 6:15am
6
I found a reason of the problem here :
value_template: "{{ value | multiply(0.001) | round(1) }}"
so I changed to :
value_template: "{{ value }}"
only to see what is received
problem is that value is still 0