I am gettings device info as mqtt like this:
Topic: deviceinfo/newlogserver
{
"state": 6.8,
"attributes": {
"newlogserver_minne_totalt": 1971,
"newlogserver_minne_anvant": 1729,
"newlogserver_minne_ledigt": 241,
"newlogserver_hdd_totalt": 19.5,
"newlogserver_hdd_anvant": 11.7,
"newlogserver_hdd_ledigt": 6.8
}
}
HA configuration.yaml
mqtt:
sensor:
- name: "Deviceinfo newlogserver"
unique_id: "deviceinfo_newlogserver"
state_topic: "deviceinfo/newlogserver"
value_template: "{{ value_json.state }}"
json_attributes_topic: "deviceinfo/newlogserver"
json_attributes_template: "{{ value_json.attributes | tojson }}"
unit_of_measurement: 'GB free'
I am sending this data to InfluxDB2.
My initial problem was that I had trouble finding the data.
So I added unit_of_measurement
of GB free
and I could find the data.
GB Free
is not a very good unit for all the measurements, it does not really matter but it looks bad.
Is there a way of settings a separate unit for the attributes? It could be data
or something.
… or is it better to separate it all to separate sensors? I have six devices sending this data so that would make 36 sensors.