I’m having difficulties creating a transform in the dia.yml file for converting the sensor temperature to Fahrenheit.
Looking over the example in the following guide:
http://www.idigi.com/pdf/idigi-dia103.pdf
I see the following samples:
Transforms Examples:
- Multi-channel operation. Note the use of the built-in functions sum and len provided by Python.
- name: avg_temperature
unit: C
channels: - temp_sensors.sensor1
- temp_sensors.sensor2
- temp_sensors.sensor3
expr: sum(c) / len(c)
- Unit conversion. Given a temperature in Celsius, convert to Fahrenheit. Note that transforms can use other transforms.
- name: temperature_f
unit: F
channels: - transforms.avg_temperature
expr: (9.0/5.0) * c[0] + 32
Admittedly, I am new to Python. I have tried various transform entries and came up with the following errors when running dia.py on the ConnectPort unit:
SettingNotFound: “setting ‘instance_list’ not found”
Is a template required when using a transform?
Does a transform entry in the .yml file need to be earlier than the sensor device?
I don’t need an average temperature, just simply change the unit value to fahrenheit and have it show on the web (idigi_dia.html). Is there a better way to accomplish this?
Appreciate any assistance.