One file will do. As long as the values are on the last line of the file you can use this:
to create sensors. However as it does not support attribute templates you will have to create 8 sensors, one of temperature and one of humidity for each room.
I am aware of that, I need to use File sensor for it, but I have no idea how to separate the informations, having in this text file.
it looks like this.
There may be a problem with this being interpreted as a string rather than JSON data so try this first and see if it works
sensor:
- platform: file
file_path: /home/user/.homeassistant/sensor-data.txt # change this to the path to your file
name: Bathroom Temperature
value_template: "{{ value_json[0].indoor_temp }}"
If it does work then this is the template for Bathroom Humidity:
I’m guessing there are only 8 values there (indoor_temp and humidity for each room) that are required. Maybe a ninth for outdoor_temp (they all seem to be the same).
Lol, I’m trying to avoid it. It would be great if all of these integrations followed the same ideals when creating sensors. They should all emulate MQTT imo. Then these goofy issues would be solved. 1 file sensor, x number of template sensors. Or better yet, seeing that it’s a list of 4 senors, create 4 sensors with attributes. There’s so many options.
One more question.
What should trigger the update?
I’ve updated the text file several times now, and HA still showing me the data from 15:23, even though it has data source from 17:10. It’s like the file has been cached…
*I’ve even restarted HA, and datas are not updated.
okay that’s solved too.
for some reason in the root directory of .homeassistant it didn’t want to refresh.
moved to another directory, whitlested that one, and now it’s fine.