I’d like to show current zigbee2mqtt installed version.
So I configured a sensor like:
- platform: file
file_path: /opt/zigbee2mqtt/npm-shrinkwrap.json
name: zigbee2mqtt_current_version
value_template: "{{ value_json.version }}"
where npm-shrinkwrap.json is:
{
"name": "zigbee2mqtt",
"version": "1.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@babel/code-frame": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz",
"integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==",
"dev": true,
"requires": {
"@babel/highlight": "^7.0.0"
}
},
...
....// omitted
}
I’ve also set in confguration.yaml:
homeassistant:
whitelist_external_dirs:
- '/opt/zigbee2mqtt'
But I get always UNKNOWN.
In HA log i don’t get any error.
I also tried to use:
- platform: file
file_path: /home/homeassistant/.homeassistant/other/npm-shrinkwrap.json
name: zigbee2mqtt_current_version
value_template: "{{ value_json.version }}"
and move npm-shrinkwrap.json inside /home/homeassistant/.homeassistant/other dir to try, but always get UNKNOWN value.
What can be the problem? or how can I found the problem? I’m using latest 0.85.1