poratnir
(Nir Porat)
1
Hey I have some issues with HA platform for DHT22
I manged to get data from sensor using direct command line
I.E
sudo ./AdafruitDHT.py 22 19
Output is:Temp=20.3* Humidity=65.3%
what is the best way to insulate the data and have the results into command line sensor?
lolouk44
(lolouk44)
2
Check this page:
It explains how the command line sensor works and gives you examples
poratnir
(Nir Porat)
3
Hey,
I could not find any soultion for parsing
lolouk44
(lolouk44)
4
try this
sensor:
- platform: command_line
name: DHT22 Temperature
command: "sudo ./AdafruitDHT.py 22 19"
# If errors occur, remove degree symbol below
unit_of_measurement: "°C"
value_template: '{{ value.split("=")[1].split("*")[0]}}'
- platform: command_line
name: DHT22 Humidity
command: "sudo ./AdafruitDHT.py 22 19"
# If errors occur, remove degree symbol below
unit_of_measurement: "%"
value_template: '{{ value.split("Humidity=")[1].split("%")[0]}}'