Vasek
May 18, 2025, 3:38pm
1
Hi, I am calling python script from configuration.yaml, but there is no even sensor/value of cellartemp. Trying name: “cellartemp” and name: cellartemp, but nothing is happening… Python script works fine outside HA. Please help:
sensor:
- platform: command_line
name: "cellartemp"
command: "python3 /custom_components/shellycloud/cellar_temp.py"
scan_interval: 3600
value_template: "{{ value | float }}"
Vasek
May 18, 2025, 5:44pm
3
Hello. no just ubuntu python on the host system and calling it directly…
zoogara
(Daryl)
May 19, 2025, 7:09am
4
Have you checked the logs to make sure the script is returning a value?
fuatakgun
(Fuat Akgün)
May 19, 2025, 8:10am
5
Vasek
May 19, 2025, 4:10pm
6
I do not see any value… But calling the script directly from Ubuntu environment returns the value properly.
this is the script:
import requests
import json
url = "https://shelly-1...../device/status?id=dxxx&auth_key=12345asdf"
response = requests.get(url)
data = response.json()
temperature = data['data']['device_status']['temperature:0']['tC']
print(temperature)